[PATCH] correction to super_block cleanups

Brian Gerst (bgerst@didntduck.org)
Tue, 12 Mar 2002 20:12:21 -0500


This is a multi-part message in MIME format.
--------------030508020701050200070404
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I forgot to zero out the newly allocated memory in the previous patches.
First patch is for the changes included in 2.5.7-pre1, second is
incremental to the ext2 and ncp patches.

-- 

Brian Gerst

--------------030508020701050200070404 Content-Type: text/plain; name="sb-zeroing-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sb-zeroing-1"

diff -ruN linux/fs/cramfs/inode.c linux2/fs/cramfs/inode.c --- linux/fs/cramfs/inode.c Tue Mar 12 17:35:10 2002 +++ linux2/fs/cramfs/inode.c Tue Mar 12 20:01:37 2002 @@ -201,6 +201,7 @@ if (!sbi) return -ENOMEM; sb->u.generic_sbp = sbi; + memset(sbi, 0, sizeof(struct cramfs_sb_info)); sb_set_blocksize(sb, PAGE_CACHE_SIZE); diff -ruN linux/fs/minix/inode.c linux2/fs/minix/inode.c --- linux/fs/minix/inode.c Tue Mar 12 17:35:10 2002 +++ linux2/fs/minix/inode.c Tue Mar 12 20:01:10 2002 @@ -178,6 +178,7 @@ if (!sbi) return -ENOMEM; s->u.generic_sbp = sbi; + memset(sbi, 0, sizeof(struct minix_sb_info)); /* N.B. These should be compile-time tests. Unfortunately that is impossible. */

--------------030508020701050200070404 Content-Type: text/plain; name="sb-zeroing-2" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sb-zeroing-2"

diff -ruN linux/fs/ext2/super.c linux2/fs/ext2/super.c --- linux/fs/ext2/super.c Tue Mar 12 19:59:57 2002 +++ linux2/fs/ext2/super.c Tue Mar 12 20:03:16 2002 @@ -469,6 +469,7 @@ if (!sbi) return -ENOMEM; sb->u.generic_sbp = sbi; + memset(sbi, 0, sizeof(struct ext2_super_block)); /* * See what the current blocksize for the device is, and diff -ruN linux/fs/ncpfs/inode.c linux2/fs/ncpfs/inode.c --- linux/fs/ncpfs/inode.c Tue Mar 12 19:59:51 2002 +++ linux2/fs/ncpfs/inode.c Tue Mar 12 20:04:09 2002 @@ -319,6 +319,8 @@ if (!server) return -ENOMEM; sb->u.generic_sbp = server; + memset(server, 0, sizeof(struct ncp_server)); + error = -EFAULT; if (raw_data == NULL) goto out;

--------------030508020701050200070404--

- 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/