diff options
author | 2015-08-14 18:33:07 +0800 | |
---|---|---|
committer | 2015-10-01 18:07:59 +0200 | |
commit | 73416dab235e5ff030e3b3c61da0cd6ced324fc9 (patch) | |
tree | eacb4410f3b1e79be065d826cc7894441fafc3c1 /fs/btrfs/root-tree.c | |
parent | Btrfs: add helper for closing one device (diff) | |
download | linux-73416dab235e5ff030e3b3c61da0cd6ced324fc9.tar.gz linux-73416dab235e5ff030e3b3c61da0cd6ced324fc9.tar.bz2 linux-73416dab235e5ff030e3b3c61da0cd6ced324fc9.zip |
Btrfs: move kobj stuff out of dev_replace lock range
To avoid deadlock described in commit 084b6e7c7607 ("btrfs: Fix a
lockdep warning when running xfstest."), we should move kobj stuff out
of dev_replace lock range.
"It is because the btrfs_kobj_{add/rm}_device() will call memory
allocation with GFP_KERNEL,
which may flush fs page cache to free space, waiting for it self to do
the commit, causing the deadlock.
To solve the problem, move btrfs_kobj_{add/rm}_device() out of the
dev_replace lock range, also involing split the
btrfs_rm_dev_replace_srcdev() function into remove and free parts.
Now only btrfs_rm_dev_replace_remove_srcdev() is called in dev_replace
lock range, and kobj_{add/rm} and btrfs_rm_dev_replace_free_srcdev() are
called out of the lock range."
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
[added lockup description]
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/root-tree.c')
0 files changed, 0 insertions, 0 deletions