]> git.hungrycats.org Git - linux/commit
Btrfs: fix lockdep warning about log_mutex
authorLiu Bo <bo.li.liu@oracle.com>
Thu, 1 Dec 2016 00:20:25 +0000 (16:20 -0800)
committerZygo Blaxell <zblaxell@thirteen.furryterror.org>
Thu, 15 Dec 2016 05:14:32 +0000 (00:14 -0500)
commit5747b559b5e01a45813449b213982eb0f3a8dbe6
tree9b929ef2e5a6c0f979da406f60f6bcea69236140
parent73e052f7ee70f1b33ea5a227259cdfe494721458
Btrfs: fix lockdep warning about log_mutex

While checking INODE_REF/INODE_EXTREF for a corner case, we may acquire a
different inode's log_mutex with holding the current inode's log_mutex, and
lockdep has complained this with a possilble deadlock warning.

Fix this by using mutex_lock_nested() when processing the other inode's
log_mutex.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
(cherry picked from commit 958dcc5403af9bbe9647d6c038f335cf429dbe46)
fs/btrfs/tree-log.c