From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Cc: <dsterba@suse.cz>
Subject: [PATCH RFC v2 1/5] btrfs: Fix the bug that fs_info->pending_changes is never cleared.
Date: Tue, 20 Jan 2015 17:05:33 +0800 [thread overview]
Message-ID: <1421744737-16586-2-git-send-email-quwenruo@cn.fujitsu.com> (raw)
In-Reply-To: <1421744737-16586-1-git-send-email-quwenruo@cn.fujitsu.com>
Fs_info->pending_changes is never cleared since the original code uses
cmpxchg(&fs_info->pending_changes, 0, 0), which will only clear it if
pending_changes is already 0.
This will cause a lot of problem when mount it with inode_cache mount
option.
If the btrfs is mounted as inode_cache, pending_changes will always be
1, even when the fs is frozen.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
fs/btrfs/transaction.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index a605d4e..e88b59d 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -2118,7 +2118,7 @@ void btrfs_apply_pending_changes(struct btrfs_fs_info *fs_info)
unsigned long prev;
unsigned long bit;
- prev = cmpxchg(&fs_info->pending_changes, 0, 0);
+ prev = xchg(&fs_info->pending_changes, 0);
if (!prev)
return;
--
2.2.2
next prev parent reply other threads:[~2015-01-20 9:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-20 9:05 [PATCH RFC v2 0/5] Fix bugs introduced by the new pending changes Qu Wenruo
2015-01-20 9:05 ` Qu Wenruo [this message]
2015-01-20 16:01 ` [PATCH RFC v2 1/5] btrfs: Fix the bug that fs_info->pending_changes is never cleared David Sterba
2015-01-20 9:05 ` [PATCH RFC v2 2/5] btrfs: Add btrfs_start_transaction_freeze() to start transaction in btrfs_freeze() Qu Wenruo
2015-01-20 9:05 ` [PATCH RFC v2 3/5] btrfs: Handle pending changes " Qu Wenruo
2015-01-20 9:05 ` [PATCH RFC v2 4/5] Revert "btrfs: move commit out of sysfs when changing label" Qu Wenruo
2015-01-20 9:05 ` [PATCH RFC v2 5/5] Revert "btrfs: move commit out of sysfs when changing features" Qu Wenruo
2015-01-20 15:53 ` [PATCH RFC v2 0/5] Fix bugs introduced by the new pending changes 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=1421744737-16586-2-git-send-email-quwenruo@cn.fujitsu.com \
--to=quwenruo@cn.fujitsu.com \
--cc=dsterba@suse.cz \
--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).