Skip to content

Clean up bitmap loading

Theodore Ts'o linux-ext4 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ext4: remove block bitmap initialization in ext4_new_inode()fs/ext4/ialloc.c+0 -274 replies
2/3ext4: fold ext4_claim_inode into ext4_new_inodefs/ext4/ialloc.c+75 -1320 replies
3/3ext4: fix race when setting bitmap_uptdate flagfs/ext4/balloc.c fs/ext4/ext4.h fs/ext4/ialloc.c +1 more+77 -880 replies

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] Clean up bitmap loading

The code to load the block and inode bitmaps was a wretched hive of scum and villany.... the code to handle uninitialized bitmap violated the ext4 journal write protocols, which meant it was possible for file system corruptions if the file system crashed at exactly the wrong time. In addition there was a race that could cause blocks or inodes to be doubly allocated if two processes race against each other while trying to load an uninitialized bitmap block.

Finally, it was hard to understand the code because it was badly structured, and the with the block bitmap uninit code duplicated in three different places, one unnecessary, and not all of the completely identical. Fixing this means we can trim a cool 100 lines from the ext4 sources.

Theodore Ts'o (3):
ext4: remove block bitmap initialization in ext4_new_inode()
ext4: fold ext4_claim_inode into ext4_new_inode
ext4: fix race when setting bitmap_uptdate flag

 fs/ext4/balloc.c  |   59 ++++++++----
 fs/ext4/ext4.h    |   11 ++-
 fs/ext4/ialloc.c  |  256 ++++++++++++++++++----------------------------------
 fs/ext4/mballoc.c |   79 +++-------------
 4 files changed, 153 insertions(+), 252 deletions(-)
Signature · 1 line
1.7.8.11.gefc1f.dirty