Commit d0270aca authored by Jeff Mahoney's avatar Jeff Mahoney Committed by Chris Mason

btrfs: commit transaction after setting label and features

The set_fslabel ioctl uses btrfs_end_transaction, which means it's
possible that the change will be lost if the system crashes, same for
the newly set features. Let's use btrfs_commit_transaction instead.
Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 6cc98d90
...@@ -4547,7 +4547,7 @@ static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg) ...@@ -4547,7 +4547,7 @@ static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg)
spin_lock(&root->fs_info->super_lock); spin_lock(&root->fs_info->super_lock);
strcpy(super_block->label, label); strcpy(super_block->label, label);
spin_unlock(&root->fs_info->super_lock); spin_unlock(&root->fs_info->super_lock);
ret = btrfs_end_transaction(trans, root); ret = btrfs_commit_transaction(trans, root);
out_unlock: out_unlock:
mnt_drop_write_file(file); mnt_drop_write_file(file);
...@@ -4711,7 +4711,7 @@ static int btrfs_ioctl_set_features(struct file *file, void __user *arg) ...@@ -4711,7 +4711,7 @@ static int btrfs_ioctl_set_features(struct file *file, void __user *arg)
btrfs_set_super_incompat_flags(super_block, newflags); btrfs_set_super_incompat_flags(super_block, newflags);
spin_unlock(&root->fs_info->super_lock); spin_unlock(&root->fs_info->super_lock);
return btrfs_end_transaction(trans, root); return btrfs_commit_transaction(trans, root);
} }
long btrfs_ioctl(struct file *file, unsigned int long btrfs_ioctl(struct file *file, unsigned int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment