From: Wang Shilong Date: Thu, 17 Jul 2014 03:44:12 +0000 (+0800) Subject: Btrfs: fix wrong max inline data size limit X-Git-Tag: v3.16.83~230 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e404ae2039471ae9ee38f2181d8316c9307b5eb;p=thirdparty%2Fkernel%2Fstable.git Btrfs: fix wrong max inline data size limit commit c01a5c074c0f6f85a3b02e39432b9e5576ab51de upstream. inline data is stored from offset of @disk_bytenr in struct btrfs_file_extent_item. So substracting total size of struct btrfs_file_extent_item is wrong, fix it. Signed-off-by: Wang Shilong Reviewed-by: David Sterba Signed-off-by: Chris Mason Signed-off-by: Ben Hutchings --- diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 796f1d2374fff..52f24459b9ee7 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -394,7 +394,7 @@ struct btrfs_header { #define BTRFS_LEAF_DATA_SIZE(r) (__BTRFS_LEAF_DATA_SIZE(r->leafsize)) #define BTRFS_MAX_INLINE_DATA_SIZE(r) (BTRFS_LEAF_DATA_SIZE(r) - \ sizeof(struct btrfs_item) - \ - sizeof(struct btrfs_file_extent_item)) + offsetof(struct btrfs_file_extent_item, disk_bytenr)) #define BTRFS_MAX_XATTR_SIZE(r) (BTRFS_LEAF_DATA_SIZE(r) - \ sizeof(struct btrfs_item) -\ sizeof(struct btrfs_dir_item))