diff options
author | Eric Sandeen <sandeen@redhat.com> | 2008-08-02 21:21:08 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-08-02 21:21:08 -0400 |
commit | b5f10eed8125702929e57cca7e5956b1b9b6d015 (patch) | |
tree | e5b38a6f654baea3658bf100320a4d66387988a3 /fs/ext4/super.c | |
parent | e29d1cde63be0b5f1739416b5574a83c34bf8eeb (diff) |
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>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 876e1c620365..511997ef6f0e 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1621,6 +1621,7 @@ static int ext4_check_descriptors(struct super_block *sb) | |||
1621 | "(block %llu)!", i, inode_table); | 1621 | "(block %llu)!", i, inode_table); |
1622 | return 0; | 1622 | return 0; |
1623 | } | 1623 | } |
1624 | spin_lock(sb_bgl_lock(sbi, i)); | ||
1624 | if (!ext4_group_desc_csum_verify(sbi, i, gdp)) { | 1625 | if (!ext4_group_desc_csum_verify(sbi, i, gdp)) { |
1625 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " | 1626 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " |
1626 | "Checksum for group %lu failed (%u!=%u)\n", | 1627 | "Checksum for group %lu failed (%u!=%u)\n", |
@@ -1629,6 +1630,7 @@ static int ext4_check_descriptors(struct super_block *sb) | |||
1629 | if (!(sb->s_flags & MS_RDONLY)) | 1630 | if (!(sb->s_flags & MS_RDONLY)) |
1630 | return 0; | 1631 | return 0; |
1631 | } | 1632 | } |
1633 | spin_unlock(sb_bgl_lock(sbi, i)); | ||
1632 | if (!flexbg_flag) | 1634 | if (!flexbg_flag) |
1633 | first_block += EXT4_BLOCKS_PER_GROUP(sb); | 1635 | first_block += EXT4_BLOCKS_PER_GROUP(sb); |
1634 | } | 1636 | } |