aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2007-11-16 17:13:24 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-11-26 16:24:22 -0500
commitf16c960332b125491178fc2da7ea7893b0d65d05 (patch)
treee2f65c7b9b15e006e42ca4c6366c6d887e9bacad
parentcfcb43ff7ce28f347a39e1a7519e01850b588718 (diff)
NFS: mount failure causes bad page state
While testing a kernel based upon ecd744eec3aa8bbc949ec04ed3fbf7ecb2958a0e (with wrong boot arguments), I got the following bad page state entry while NFS was trying to mount it's rootfs: IP-Config: Complete: device=eth0, addr=192.168.1.101, mask=255.255.255.0, gw=255.255.255.255, host=192.168.1.101, domain=, nis-domain=(none), bootserver=192.168.1.100, rootserver=192.168.1.100, rootpath= Looking up port of RPC 100003/2 on 192.168.1.100 rpcbind: server 192.168.1.100 not responding, timed out Root-NFS: Unable to get nfsd port number from server, using default Looking up port of RPC 100005/1 on 192.168.1.100 rpcbind: server 192.168.1.100 not responding, timed out Root-NFS: Unable to get mountd port number from server, using default mount: server 192.168.1.100 not responding, timed out Root-NFS: Server returned error -5 while mounting /nfs/rootfs/ VFS: Unable to mount root fs via NFS, trying floppy. Bad page state in process 'swapper' page:c02b1260 flags:0x00000400 mapping:00000000 mapcount:0 count:0 Trying to fix it up, but a reboot is needed Backtrace: [<c0023e34>] (dump_stack+0x0/0x14) from [<c0062570>] (bad_page+0x70/0xac) [<c0062500>] (bad_page+0x0/0xac) from [<c0064914>] (free_hot_cold_page+0x80/0x178) [<c0064894>] (free_hot_cold_page+0x0/0x178) from [<c0064a74>] (free_hot_page+0x14/0x18) [<c0064a60>] (free_hot_page+0x0/0x18) from [<c0067078>] (put_page+0xf8/0x154) [<c0066f80>] (put_page+0x0/0x154) from [<c007dbc8>] (kfree+0xc8/0xd0) [<c007db00>] (kfree+0x0/0xd0) from [<c00cbb54>] (nfs_get_sb+0x230/0x710) [<c00cb924>] (nfs_get_sb+0x0/0x710) from [<c0084334>] (vfs_kern_mount+0x58/0xac)[<c00842dc>] (vfs_kern_mount+0x0/0xac) from [<c00843c0>] (do_kern_mount+0x38/0xf4) [<c0084388>] (do_kern_mount+0x0/0xf4) from [<c0099c7c>] (do_mount+0x1e8/0x614) ... This seems to be caused by use of an uninitialised structure due to NULL options being passed to nfs_validate_mount_data(). Ensure that the parsed mount data is always initialised. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> (Trond: added fix for the same bug in nfs4_validate_mount_data()). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/super.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 71067d1ac9d9..2426e713b77f 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1054,10 +1054,11 @@ static int nfs_validate_mount_data(void *options,
1054{ 1054{
1055 struct nfs_mount_data *data = (struct nfs_mount_data *)options; 1055 struct nfs_mount_data *data = (struct nfs_mount_data *)options;
1056 1056
1057 memset(args, 0, sizeof(*args));
1058
1057 if (data == NULL) 1059 if (data == NULL)
1058 goto out_no_data; 1060 goto out_no_data;
1059 1061
1060 memset(args, 0, sizeof(*args));
1061 args->flags = (NFS_MOUNT_VER3 | NFS_MOUNT_TCP); 1062 args->flags = (NFS_MOUNT_VER3 | NFS_MOUNT_TCP);
1062 args->rsize = NFS_MAX_FILE_IO_SIZE; 1063 args->rsize = NFS_MAX_FILE_IO_SIZE;
1063 args->wsize = NFS_MAX_FILE_IO_SIZE; 1064 args->wsize = NFS_MAX_FILE_IO_SIZE;
@@ -1536,10 +1537,11 @@ static int nfs4_validate_mount_data(void *options,
1536 struct nfs4_mount_data *data = (struct nfs4_mount_data *)options; 1537 struct nfs4_mount_data *data = (struct nfs4_mount_data *)options;
1537 char *c; 1538 char *c;
1538 1539
1540 memset(args, 0, sizeof(*args));
1541
1539 if (data == NULL) 1542 if (data == NULL)
1540 goto out_no_data; 1543 goto out_no_data;
1541 1544
1542 memset(args, 0, sizeof(*args));
1543 args->rsize = NFS_MAX_FILE_IO_SIZE; 1545 args->rsize = NFS_MAX_FILE_IO_SIZE;
1544 args->wsize = NFS_MAX_FILE_IO_SIZE; 1546 args->wsize = NFS_MAX_FILE_IO_SIZE;
1545 args->timeo = 600; 1547 args->timeo = 600;