lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Tue, 25 Nov 2008 15:29:33 +0100 From: Frédéric Bohé <frederic.bohe@...l.net> To: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com> Cc: Alex Zhuravlev <Alex.Zhuravlev@....COM>, Theodore Tso <tytso@....EDU>, cmm@...ibm.com, sandeen@...hat.com, linux-ext4@...r.kernel.org Subject: Re: [PATCH -V2 3/5] ext4: Fix the race between read_block_bitmap and mark_diskspace_used > Ok the changes was not done for this purpose. I need to make sure we > update bitmap and clear group_desc uninit flag after taking sb_bgl_lock > That means when we claim blocks we can't use mb_set_bits with > sb_bgl_lock because we would already be holding it. How about the below > change > > diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c > index 444ad99..53180b1 100644 > --- a/fs/ext4/mballoc.c > +++ b/fs/ext4/mballoc.c > @@ -1031,7 +1031,10 @@ static void mb_clear_bits(spinlock_t *lock, void *bm, int cur, int len) > cur += 32; > continue; > } > - mb_clear_bit_atomic(lock, cur, bm); > + if (lock) > + mb_clear_bit_atomic(lock, cur, bm); > + else > + mb_clear_bit(cur, bm); > cur++; > } > } > @@ -1049,7 +1052,10 @@ static void mb_set_bits(spinlock_t *lock, void *bm, int cur, int len) > cur += 32; > continue; > } > - mb_set_bit_atomic(lock, cur, bm); > + if (lock) > + mb_set_bit_atomic(lock, cur, bm); > + else > + mb_set_bit(cur, bm); > cur++; > } > } Aneesh, I've just tried your patch on top of the patch queue and I still have this error when I resize the fs while allocating blocks concurrently (with dd): EXT4-fs error (device md0): ext4_mb_mark_diskspace_used: Allocating block in system zone - block = 9117697 EXT4-fs error (device md0): ext4_mb_generate_buddy: EXT4-fs: group 1113: 6144 blocks in bitmap, 6014 in gd Anyway I'm not sure if it is related to the race you try to fix. FYI this error first appeared with the first set of patches concerning resize and mballoc. Regards, Frederic -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists