ext4: lock block groups when initializing
authorEric Sandeen <sandeen@redhat.com>
Sun, 3 Aug 2008 01:21:08 +0000 (21:21 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 3 Aug 2008 01:21:08 +0000 (21:21 -0400)
commitb5f10eed8125702929e57cca7e5956b1b9b6d015
treee5b38a6f654baea3658bf100320a4d66387988a3
parente29d1cde63be0b5f1739416b5574a83c34bf8eeb
ext4: lock block groups when initializing

I noticed when filling a 1T filesystem with 4 threads using the
fs_mark benchmark:

fs_mark -d /mnt/test -D 256 -n 100000 -t 4 -s 20480 -F -S 0

that I occasionally got checksum mismatch errors:

EXT4-fs error (device sdb): ext4_init_inode_bitmap: Checksum bad for group 6935

etc.  I'd reliably get 4-5 of them during the run.

It appears that the problem is likely a race to init the bg's
when the uninit_bg feature is enabled.

With the patch below, which adds sb_bgl_locking around initialization,
I was able to complete several runs with no errors or warnings.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/balloc.c
fs/ext4/ialloc.c
fs/ext4/mballoc.c
fs/ext4/super.c