public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: add checksum calculation when clearing UNINIT flag
@ 2008-11-07 10:22 Frédéric Bohé
  2008-11-07 13:52 ` Theodore Tso
  0 siblings, 1 reply; 5+ messages in thread
From: Frédéric Bohé @ 2008-11-07 10:22 UTC (permalink / raw)
  To: linux-ext4

From: Frederic Bohe <frederic.bohe@bull.net>

Block group's checksum need to be re-calculated during the
initialization of an UNINIT'd group. This fix a race when several
threads try to allocate a new inode in an UNINIT'd group.

Signed-off-by: Frederic Bohe <frederic.bohe@bull.net>
---
 ialloc.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux/fs/ext4/ialloc.c
===================================================================
--- linux.orig/fs/ext4/ialloc.c	2008-11-06 17:22:14.000000000 +0100
+++ linux/fs/ext4/ialloc.c	2008-11-07 10:43:41.000000000 +0100
@@ -718,6 +718,8 @@ got:
 			gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT);
 			free = ext4_free_blocks_after_init(sb, group, gdp);
 			gdp->bg_free_blocks_count = cpu_to_le16(free);
+			gdp->bg_checksum = ext4_group_desc_csum(sbi, group,
+								gdp);
 		}
 		spin_unlock(sb_bgl_lock(sbi, group));
--
 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-11-11  1:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-07 10:22 [PATCH] ext4: add checksum calculation when clearing UNINIT flag Frédéric Bohé
2008-11-07 13:52 ` Theodore Tso
2008-11-07 14:27   ` Aneesh Kumar K.V
2008-11-07 14:38     ` Theodore Tso
2008-11-11  1:23       ` Andreas Dilger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox