ufs: fix deadlocks introduced by sb mutex merge
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Tue, 2 Sep 2014 07:40:17 +0000 (11:40 +0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 7 Sep 2014 17:26:39 +0000 (13:26 -0400)
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>

No differences found