summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2014-07-17 07:44:12 +0400
committerBen Hutchings <ben@decadent.org.uk>2020-04-28 21:02:21 +0300
commit1e404ae2039471ae9ee38f2181d8316c9307b5eb (patch)
tree625530baa5418e67e4d64b7773df5a21bfacb0a5 /fs
parent6a293f46d3eaafcbc4a3316f2ac80de9b1398415 (diff)
downloadlinux-1e404ae2039471ae9ee38f2181d8316c9307b5eb.tar.xz
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 <wangsl.fnst@cn.fujitsu.com> Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/ctree.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 796f1d2374ff..52f24459b9ee 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))