]> git.hungrycats.org Git - linux/commit
[PATCH] use-before-uninitialized value in ext3(2)_find_ goal
authorAndrew Morton <akpm@osdl.org>
Wed, 19 May 2004 09:41:54 +0000 (02:41 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 19 May 2004 09:41:54 +0000 (02:41 -0700)
commit83ee50f561a349906f463983653f94133bdbf833
tree0852a20a86cc14e914ba5924e837bf235243cf4a
parent2cb2f31fba9f82ffc1a922bf9c731b01cbbffe29
[PATCH] use-before-uninitialized value in ext3(2)_find_ goal

From: Mingming Cao <cmm@us.ibm.com>

There is a uninitialized goal value being referenced in both ext3 and ext2
find goal block functions (ext3_find_goal() and ext2_find_goal()).

In the non-sequential write case, these functions check the goal value(non
zero) before calling ext3(2)_find_near() to find the goal block to
allocate.

Since the goal value is uninitialized(non zero), the ext3(2)_find_near() is
never being called in the non-sequential write, thus ext3(2)_find_goal()
failed to guide a goal block in the random write case.

ext3(2)_new_block() takes the junk goal value and will turn it to goal 0
since it's normally beyond the filesystem block number limit.  The fix is
trivial.
fs/ext2/inode.c
fs/ext3/inode.c