Re: [PATCH 4/6] Btrfs: fix wrong max inline data size limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 17, 2014 at 11:44:12AM +0800, Wang Shilong wrote:
> 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@xxxxxxxxxxxxxx>

Reviewed-by: David Sterba <dsterba@xxxxxxx>

>  #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))

This increases the limit of inline data by 24 bytes but fortunatelly
does not break existing filesystems because the
BTRFS_MAX_INLINE_DATA_SIZE is used at the time the inlining is decided.
IOW it is a bit pessimistic, the rest of the code uses the offsetof
value.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux