linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: linux-btrfs@vger.kernel.org
Cc: Jeff Mahoney <jeffm@suse.com>, David Sterba <dsterba@suse.cz>
Subject: [PATCH 1/4] btrfs: commit transaction after setting label and features
Date: Fri,  7 Feb 2014 14:33:57 +0100	[thread overview]
Message-ID: <cbcf98e954a26f6bd43b819e48814d1e1d81bf8f.1391779611.git.dsterba@suse.cz> (raw)
In-Reply-To: <cover.1391779611.git.dsterba@suse.cz>

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 --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)
 	spin_lock(&root->fs_info->super_lock);
 	strcpy(super_block->label, label);
 	spin_unlock(&root->fs_info->super_lock);
-	ret = btrfs_end_transaction(trans, root);
+	ret = btrfs_commit_transaction(trans, root);
 
 out_unlock:
 	mnt_drop_write_file(file);
@@ -4689,7 +4689,7 @@ static int btrfs_ioctl_set_features(struct file *file, void __user *arg)
 	btrfs_set_super_incompat_flags(super_block, newflags);
 	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
-- 
1.8.5.2


  reply	other threads:[~2014-02-07 13:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07 13:33 [PATCH 0/4] Btrfs updates for 3.14-rc - sysfs, ioctl David Sterba
2014-02-07 13:33 ` David Sterba [this message]
2014-02-07 13:34 ` [PATCH 2/4] btrfs: reserve no transaction units in btrfs_ioctl_set_features David Sterba
2014-02-07 13:34 ` [PATCH 3/4][RFC] btrfs: export global block reserve size as space_info David Sterba
2014-02-10 17:03   ` Chris Mason
2014-04-04 14:56     ` Jeff Mahoney
2014-02-07 13:34 ` [PATCH 4/4] Revert "btrfs: add ioctl to export size of global metadata reservation" David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cbcf98e954a26f6bd43b819e48814d1e1d81bf8f.1391779611.git.dsterba@suse.cz \
    --to=dsterba@suse.cz \
    --cc=jeffm@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).