Skip to content

Commit

Permalink
btrfs: fix structs where bitfields and spinlock/atomic share 8B word
Browse files Browse the repository at this point in the history
On ia64, powerpc64 and sparc64 the bitfield is modified through a RMW cycle and current
gcc rewrites the adjacent 4B word, which in case of a spinlock or atomic has
disaterous effect.

https://lkml.org/lkml/2012/2/1/220

Signed-off-by: David Sterba <dsterba@suse.cz>
  • Loading branch information
David Sterba committed Feb 15, 2012
1 parent 87826df commit c08782d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ struct btrfs_block_rsv {
u64 reserved;
struct btrfs_space_info *space_info;
spinlock_t lock;
unsigned int full:1;
unsigned int full;
};

/*
Expand Down
4 changes: 2 additions & 2 deletions fs/btrfs/extent_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ struct extent_map {
unsigned long flags;
struct block_device *bdev;
atomic_t refs;
unsigned int in_tree:1;
unsigned int compress_type:4;
unsigned int in_tree;
unsigned int compress_type;
};

struct extent_map_tree {
Expand Down

0 comments on commit c08782d

Please sign in to comment.