ext4: Handle different max offsets for bitmap & extent-based files
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | ext4: different maxbytes functions for bitmap & extent filesfs/ | +43 | 2 replies | |
| 2/3 | ext4: export iov_shorten from kernel for ext4's usefs/ | +2 | 0 replies | |
| 3/3 | ext4: store maxbytes for bitmapped files and return EFBIG as appropriatefs/ fs/ fs/ +1 more | +34 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
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