Skip to content

ext4: Handle different max offsets for bitmap & extent-based files

Eric Sandeen linux-ext4 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ext4: different maxbytes functions for bitmap & extent filesfs/ext4/super.c+43 -32 replies
2/3ext4: export iov_shorten from kernel for ext4's usefs/read_write.c+2 -00 replies
3/3ext4: store maxbytes for bitmapped files and return EFBIG as appropriatefs/ext4/file.c fs/ext4/inode.c fs/ext4/super.c +1 more+34 -21 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] ext4: Handle different max offsets for bitmap & extent-based files

Basic approach: have both ext4_max_bitmap_size() and ext4_max_size() functions to compute max offsets for both types of formats.

Use vfs sb->s_maxbytes for the "native" maxbytes, i.e. extent-format files.

Put the smaller bitmap limit in a new sbi->s_bitmap_maxbytes in the ext4 superblock info structure.

Catch bitmap files in ext4_file_write() and ext4_setattr() to limit extending writes, llseeks, and truncates to too-large offsets which the VFS let through due to the extent-format maxbytes. On write, allow writes up to the max, but then stop, by using iov_shorten() to limit the size of the write to the maximum.

3 patches follow:

ext4_two_maxbytes_functions.patch - differentiate the maxbytes f'ns ext4_bitmap_maxbytes_vfs.patch - export iov_shorten from kernel ext4_bitmap_maxbytes.patch - store, and limit to, bitmap_maxbytes

Comments?

Thanks,
-Eric