[PATCH] ext2/ext3: block allocator startup fix
We found strange blocks layout in our mail server, after careful study, we got the reason and tried to fix it. On the very fist attempt to allocate a block to the newly-initialised inode, if we are trying to add a block at logical file offset "1" then ext2_find_goal() will incorrectly assume that this was a next_alloc_block cache hit (because we think the previously-allocated block was at offset zero). Net result: why trying to extend a freshly-opened one-block file we end up deciding to place the second file block at disk block "1", rather than going off and calling ext2_find_near(). Fix it by checking that we actually do have something valid cached in next_alloc_goal. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing
Please register or sign in to comment