btrfs: fix mount/umount race
Do *NOT* skip doomed superblocks in btrfs_test_super(); we want sget() to wait for their shutdown to complete. Since we don't mutilate ->s_fs_info in ->put_super() anymore (or free what it used to point to until the superblock is past being findable by sget()), we can just DTRT there and report a match. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Родитель
aea52e19dd
Коммит
6de1d09d96
|
@ -733,20 +733,15 @@ static int btrfs_test_super(struct super_block *s, void *data)
|
||||||
struct btrfs_root *test_root = data;
|
struct btrfs_root *test_root = data;
|
||||||
struct btrfs_root *root = btrfs_sb(s);
|
struct btrfs_root *root = btrfs_sb(s);
|
||||||
|
|
||||||
/*
|
|
||||||
* If this super block is going away, return false as it
|
|
||||||
* can't match as an existing super block.
|
|
||||||
*/
|
|
||||||
if (!atomic_read(&s->s_active))
|
|
||||||
return 0;
|
|
||||||
return root->fs_info->fs_devices == test_root->fs_info->fs_devices;
|
return root->fs_info->fs_devices == test_root->fs_info->fs_devices;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int btrfs_set_super(struct super_block *s, void *data)
|
static int btrfs_set_super(struct super_block *s, void *data)
|
||||||
{
|
{
|
||||||
s->s_fs_info = data;
|
int err = set_anon_super(s, data);
|
||||||
|
if (!err)
|
||||||
return set_anon_super(s, data);
|
s->s_fs_info = data;
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Загрузка…
Ссылка в новой задаче