Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c08782da authored by David Sterba's avatar David Sterba
Browse files

btrfs: fix structs where bitfields and spinlock/atomic share 8B word

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: default avatarDavid Sterba <dsterba@suse.cz>
parent 87826df0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
};

/*
+2 −2
Original line number Diff line number Diff line
@@ -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 {