diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2014-09-02 11:40:17 +0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-09-07 21:26:39 +0400 |
commit | 9ef7db7f38d0472dd9c444e42d5c5175ccbe5451 (patch) | |
tree | 38098751b8e07a868788fda862f96763b55d0763 /fs/ufs/inode.c | |
parent | 81b6b06197606b4bef4e427a197aeb808e8d89e1 (diff) | |
download | linux-9ef7db7f38d0472dd9c444e42d5c5175ccbe5451.tar.xz |
ufs: fix deadlocks introduced by sb mutex merge
Commit 0244756edc4b ("ufs: sb mutex merge + mutex_destroy") introduces
deadlocks in ufs_new_inode() and ufs_free_inode().
Most callers of that functions acqure the mutex by themselves and
ufs_{new,free}_inode() do that via lock_ufs(),
i.e we have an unavoidable double lock.
The patch proposes to resolve the issue by making sure that
ufs_{new,free}_inode() are not called with the mutex held.
Found by Linux Driver Verification project (linuxtesting.org).
Cc: stable@vger.kernel.org # 3.16
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs/inode.c')
-rw-r--r-- | fs/ufs/inode.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index 7c580c97990e..be7d42c7d938 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c @@ -902,9 +902,6 @@ void ufs_evict_inode(struct inode * inode) invalidate_inode_buffers(inode); clear_inode(inode); - if (want_delete) { - lock_ufs(inode->i_sb); - ufs_free_inode (inode); - unlock_ufs(inode->i_sb); - } + if (want_delete) + ufs_free_inode(inode); } |