diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2015-01-20 04:05:33 -0500 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-01-20 20:19:40 -0500 |
commit | 6c9fe14f9d64cc12401a825a60ec5c5723496ca4 (patch) | |
tree | 903739c5be570df4074584df413b10eaf917b536 /fs/btrfs | |
parent | 6e1103a6e9b19dbdc348077d04a546b626911fc5 (diff) |
btrfs: Fix the bug that fs_info->pending_changes is never cleared.
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>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/transaction.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index a605d4e2f2bc..e88b59d13439 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) | |||
2118 | unsigned long prev; | 2118 | unsigned long prev; |
2119 | unsigned long bit; | 2119 | unsigned long bit; |
2120 | 2120 | ||
2121 | prev = cmpxchg(&fs_info->pending_changes, 0, 0); | 2121 | prev = xchg(&fs_info->pending_changes, 0); |
2122 | if (!prev) | 2122 | if (!prev) |
2123 | return; | 2123 | return; |
2124 | 2124 | ||