summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/check-integrity.c
diff options
context:
space:
mode:
authorStefan Behrens <sbehrens@giantdisaster.de>2012-11-27 16:10:21 +0000
committerChris Mason <chris.mason@fusionio.com>2012-12-16 20:46:13 -0500
commitcb3806ec88a7e1e9d1fbde34cbc0bf153b7e7c3f (patch)
tree2e02ffad4235261cdb04b1eca1cbc9e7e83a3798 /fs/btrfs/check-integrity.c
parentb66f00da0cfceb856c17706b77906b63437f6fda (diff)
downloadlinux-cb3806ec88a7e1e9d1fbde34cbc0bf153b7e7c3f.tar.gz
linux-cb3806ec88a7e1e9d1fbde34cbc0bf153b7e7c3f.tar.bz2
linux-cb3806ec88a7e1e9d1fbde34cbc0bf153b7e7c3f.zip
Btrfs: fix race in check-integrity caused by usage of bitfield
The structure member mirror_num is modified concurrently to the structure member is_iodone. This doesn't require any locking by design, unless everything is stored in the same 32 bits of a bit field. This was the case and xfstest 284 was able to trigger false warnings from the checker code. This patch seperates the bits and fixes the race. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/check-integrity.c')
-rw-r--r--fs/btrfs/check-integrity.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c
index badc6f141b6f..11d47bfb62b4 100644
--- a/fs/btrfs/check-integrity.c
+++ b/fs/btrfs/check-integrity.c
@@ -137,7 +137,7 @@ struct btrfsic_block {
unsigned int never_written:1; /* block was added because it was
* referenced, not because it was
* written */
- unsigned int mirror_num:2; /* large enough to hold
+ unsigned int mirror_num; /* large enough to hold
* BTRFS_SUPER_MIRROR_MAX */
struct btrfsic_dev_state *dev_state;
u64 dev_bytenr; /* key, physical byte num on disk */