]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - fs/btrfs/tree-log.c
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)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Jan 2017 14:19:28 +0000 (15:19 +0100)
commit781feef7e6befafd4d9787d1f7ada1f9ccd504e4
treee8f0da62b7c2971b2f73649cf665301aef2272b9
parente321f8a801d7b4c40da8005257b05b9c2b51b072
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>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c