lkml.org 
[lkml]   [2002]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [patch] ext2_fill_super breakage
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);
\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.114 / U:5.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site