patch-2.3.99-pre7 linux/fs/nfsd/nfsctl.c

Next file: linux/fs/nfsd/vfs.c
Previous file: linux/fs/nfsd/nfscache.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre6/linux/fs/nfsd/nfsctl.c linux/fs/nfsd/nfsctl.c
@@ -240,7 +240,7 @@
 	if (cmd<0 || cmd > CMD_MAX)
 		goto done;
 	err = -EFAULT;
-	argsize = sizes[cmd].argsize + sizeof(int); /* int for ca_version */
+	argsize = sizes[cmd].argsize + (int)&((struct nfsctl_arg *)0)->u;
 	respsize = sizes[cmd].respsize;	/* maximum */
 	if (!access_ok(VERIFY_READ, argp, argsize)
 	 || (resp && !access_ok(VERIFY_WRITE, resp, respsize))) {
@@ -288,7 +288,7 @@
 		break;
 	case NFSCTL_GETFS:
 		err = nfsctl_getfs(&arg->ca_getfs, &res->cr_getfs);
-		respsize = res->cr_getfs.fh_size+sizeof(int);
+		respsize = res->cr_getfs.fh_size+ (int)&((struct knfsd_fh*)0)->fh_base;
 		break;
 	default:
 		err = -EINVAL;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)