Re: [patch] ext2_fill_super breakage

From: Brian Gerst (bgerst@didntduck.org)
Date: Thu Mar 28 2002 - 17:45:46 EST


Andrew Morton wrote:
> In 2.5.7 there is a thinko in the allocation and initialisation
> of the fs-private superblock for ext2. It's passing the wrong type
> to the sizeof operator (which of course gives the wrong size)
> when allocating and clearing the memory.

Same bug with bfs patch (only in -dj tree so far).

-- 

Brian Gerst

diff -urN linux-2.5.7-dj2/fs/bfs/inode.c linux/fs/bfs/inode.c --- linux-2.5.7-dj2/fs/bfs/inode.c Thu Mar 28 16:34:37 2002 +++ linux/fs/bfs/inode.c Thu Mar 28 16:35:43 2002 @@ -292,11 +292,11 @@ int i, imap_len; struct bfs_sb_info * info; - info = kmalloc(sizeof(struct bfs_super_block), GFP_KERNEL); + info = kmalloc(sizeof(*info), GFP_KERNEL); if (!info) return -ENOMEM; s->u.generic_sbp = info; - memset(info, 0, sizeof(struct bfs_super_block)); + memset(info, 0, sizeof(*info)); sb_set_blocksize(s, BFS_BSIZE);

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 31 2002 - 22:00:16 EST