[PATCH 2.6.25-rc3-mm1] fix ext2 borkage

From: Hugh Dickins
Date: Tue Mar 04 2008 - 14:13:32 EST


use-page_cache_xxx-in-ext2.patch gave me lots of EXT2-fs error (device
loop0): ext2_find_entry: dir 52629 size 5120 exceeds block count 2
so I stopped it quickly. Creating a directory entry was muddling up the
directory and the linked inode, writing directory page out to the latter.

Signed-off-by: Hugh Dickins <hugh@xxxxxxxxxxx>
---

fs/ext2/dir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- 2.6.25-rc3-mm1/fs/ext2/dir.c 2008-03-04 11:37:47.000000000 +0000
+++ linux/fs/ext2/dir.c 2008-03-04 18:25:24.000000000 +0000
@@ -472,7 +472,7 @@ void ext2_set_link(struct inode *dir, st
int ext2_add_link (struct dentry *dentry, struct inode *inode)
{
struct inode *dir = dentry->d_parent->d_inode;
- struct address_space *mapping = inode->i_mapping;
+ struct address_space *mapping = dir->i_mapping;
const char *name = dentry->d_name.name;
int namelen = dentry->d_name.len;
unsigned chunk_size = ext2_chunk_size(dir);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/