Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0af2c4bf authored by Anand Jain's avatar Anand Jain Committed by David Sterba
Browse files

btrfs: undo writable superblocke when sprouting fails



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: default avatarAnand Jain <anand.jain@oracle.com>
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 4b865cab
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -2496,6 +2496,8 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
	return ret;
	return ret;


error_trans:
error_trans:
	if (seeding_dev)
		sb->s_flags |= MS_RDONLY;
	btrfs_end_transaction(trans);
	btrfs_end_transaction(trans);
	rcu_string_free(device->name);
	rcu_string_free(device->name);
	btrfs_sysfs_rm_device_link(fs_info->fs_devices, device);
	btrfs_sysfs_rm_device_link(fs_info->fs_devices, device);