From: Al Viro Date: Fri, 13 Apr 2012 15:49:04 +0000 (-0400) Subject: btrfs: btrfs_root_readonly() broken on big-endian X-Git-Tag: v3.3.4~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0f97b2f7316b31570474f501cfc82aaa043b541;p=thirdparty%2Fkernel%2Fstable.git btrfs: btrfs_root_readonly() broken on big-endian commit 6ed3cf2cdfce4c9f1d73171bd3f27d9cb77b734e upstream. ->root_flags is __le64 and all accesses to it go through the helpers that do proper conversions. Except for btrfs_root_readonly(), which checks bit 0 as in host-endian... Signed-off-by: Al Viro Cc: Chris Mason Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 80b6486fd5e64..91128d7e9d391 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -2115,7 +2115,7 @@ BTRFS_SETGET_STACK_FUNCS(root_last_snapshot, struct btrfs_root_item, static inline bool btrfs_root_readonly(struct btrfs_root *root) { - return root->root_item.flags & BTRFS_ROOT_SUBVOL_RDONLY; + return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_RDONLY)) != 0; } /* struct btrfs_root_backup */