summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2017-09-28 14:51:09 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-20 10:10:30 +0100
commitda76a65a011490a0b0bd9f50d872f26e629d1eed (patch)
tree6d1b47b7d253eba0e32486fd2b4c924b97558298 /fs
parent9e87c49d62f4c5b9ae4a56b8f62865c4712c8d4d (diff)
btrfs: undo writable superblocke when sprouting fails
[ Upstream commit 0af2c4bf5a012a40a2f9230458087d7f068339d0 ] When new device is being added to seed FS, seed FS is marked writable, but when we fail to bring in the new device, we missed to undo the writable part. This patch fixes it. Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/volumes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index abc57f7b2716..0c11121a8ace 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2501,6 +2501,8 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
return ret;
error_trans:
+ if (seeding_dev)
+ sb->s_flags |= MS_RDONLY;
btrfs_end_transaction(trans);
rcu_string_free(device->name);
btrfs_sysfs_rm_device_link(fs_info->fs_devices, device);