Pull f2fs updates from Jaegeuk Kim: "Another round of various bug fixes came in. Damien improved SMR drive support a bit, and Chao replaced BUG_ON() with reporting errors to user since we've not hit from users but did hit from crafted images. We've found a disk layout bug in large_nat_bits feature which supports very large NAT entries enabled at mkfs. If the feature is enabled, it will give a notice to run fsck to correct the on-disk layout. Enhancements: - reduce memory consumption for SMR drive - better discard handling for multiple partitions - tracepoints for f2fs_file_write_iter/f2fs_filemap_fault - allow to change CP_CHKSUM_OFFSET - detect wrong layout of large_nat_bitmap feature - enhance checking valid data indices Bug fixes: - Multiple partition support for SMR drive - deadlock problem in f2fs_balance_fs_bg - add boundary checks to fix abnormal behaviors on fuzzed images - inline_xattr space calculations - replace f2fs_bug_on with errors In addition, this series contains various memory boundary check and sanity check of on-disk consistency" * tag 'f2fs-for-v5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (40 commits) f2fs: fix to avoid accessing xattr across the boundary f2fs: fix to avoid potential race on sbi->unusable_block_count access/update f2fs: add tracepoint for f2fs_filemap_fault() f2fs: introduce DATA_GENERIC_ENHANCE f2fs: fix to handle error in f2fs_disable_checkpoint() f2fs: remove redundant check in f2fs_file_write_iter() f2fs: fix to be aware of readonly device in write_checkpoint() f2fs: fix to skip recovery on readonly device f2fs: fix to consider multiple device for readonly check f2fs: relocate chksum_offset for large_nat_bitmap feature f2fs: allow unfixed f2fs_checkpoint.checksum_offset f2fs: Replace spaces with tab f2fs: insert space before the open parenthesis '(' f2fs: allow address pointer number of dnode aligning to specified size f2fs: introduce f2fs_read_single_page() for cleanup f2fs: mark is_extension_exist() inline f2fs: fix to set FI_UPDATE_WRITE correctly f2fs: fix to avoid panic in f2fs_inplace_write_data() f2fs: fix to do sanity check on valid block count of segment f2fs: fix to do sanity check on valid node/block count ...
Showing the changes to include/linux (1 of 18 files). Show all
Unified · Split
| @@ -164,6 +164,10 @@ struct f2fs_checkpoint { · 163 unmodified lines | |||
| 164 | unsigned char sit_nat_version_bitmap[1]; | 164 | unsigned char sit_nat_version_bitmap[1]; |
| 165 | } __packed; | 165 | } __packed; |
| 166 | 166 | ||
| 167 | #define CP_CHKSUM_OFFSET 4092 /* default chksum offset in checkpoint */ | ||
| 168 | #define CP_MIN_CHKSUM_OFFSET \ | ||
| 169 | (offsetof(struct f2fs_checkpoint, sit_nat_version_bitmap)) | ||
| 170 | |||
| 167 | /* | 171 | /* |
| 168 | * For orphan inode management | 172 | * For orphan inode management |
| 169 | */ | 173 | */ |
| @@ -198,11 +202,12 @@ struct f2fs_extent { · 28 unmodified lines | |||
| 198 | get_extra_isize(inode)) | 202 | get_extra_isize(inode)) |
| 199 | #define DEF_NIDS_PER_INODE 5 /* Node IDs in an Inode */ | 203 | #define DEF_NIDS_PER_INODE 5 /* Node IDs in an Inode */ |
| 200 | #define ADDRS_PER_INODE(inode) addrs_per_inode(inode) | 204 | #define ADDRS_PER_INODE(inode) addrs_per_inode(inode) |
| 201 | #define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */ | 205 | #define DEF_ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */ |
| 206 | #define ADDRS_PER_BLOCK(inode) addrs_per_block(inode) | ||
| 202 | #define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */ | 207 | #define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */ |
| 203 | 208 | ||
| 204 | #define ADDRS_PER_PAGE(page, inode) \ | 209 | #define ADDRS_PER_PAGE(page, inode) \ |
| 205 | (IS_INODE(page) ? ADDRS_PER_INODE(inode) : ADDRS_PER_BLOCK) | 210 | (IS_INODE(page) ? ADDRS_PER_INODE(inode) : ADDRS_PER_BLOCK(inode)) |
| 206 | 211 | ||
| 207 | #define NODE_DIR1_BLOCK (DEF_ADDRS_PER_INODE + 1) | 212 | #define NODE_DIR1_BLOCK (DEF_ADDRS_PER_INODE + 1) |
| 208 | #define NODE_DIR2_BLOCK (DEF_ADDRS_PER_INODE + 2) | 213 | #define NODE_DIR2_BLOCK (DEF_ADDRS_PER_INODE + 2) |
| @@ -267,7 +272,7 @@ struct f2fs_inode { · 58 unmodified lines | |||
| 267 | } __packed; | 272 | } __packed; |
| 268 | 273 | ||
| 269 | struct direct_node { | 274 | struct direct_node { |
| 270 | __le32 addr[ADDRS_PER_BLOCK]; /* array of data block address */ | 275 | __le32 addr[DEF_ADDRS_PER_BLOCK]; /* array of data block address */ |
| 271 | } __packed; | 276 | } __packed; |
| 272 | 277 | ||
| 273 | struct indirect_node { | 278 | struct indirect_node { |