[1/4] btrfs: commit transaction after setting label and features
diff mbox

Message ID cbcf98e954a26f6bd43b819e48814d1e1d81bf8f.1391779611.git.dsterba@suse.cz
State Accepted
Headers show

Commit Message

David Sterba Feb. 7, 2014, 1:33 p.m. UTC
From: Jeff Mahoney <jeffm@suse.com>

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: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
 fs/btrfs/ioctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff mbox

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index b0134892dc70..8e48b81e1515 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -4525,7 +4525,7 @@  static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg)
 	strcpy(super_block->label, label);
-	ret = btrfs_end_transaction(trans, root);
+	ret = btrfs_commit_transaction(trans, root);
@@ -4689,7 +4689,7 @@  static int btrfs_ioctl_set_features(struct file *file, void __user *arg)
 	btrfs_set_super_incompat_flags(super_block, newflags);
-	return btrfs_end_transaction(trans, root);
+	return btrfs_commit_transaction(trans, root);
 long btrfs_ioctl(struct file *file, unsigned int