patch-2.1.65 linux/fs/nfsd/export.c

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

diff -u --recursive --new-file v2.1.64/linux/fs/nfsd/export.c linux/fs/nfsd/export.c
@@ -179,27 +179,24 @@
 	}
 
 	/* Look up the dentry */
+	err = -EINVAL;
 	dentry = lookup_dentry(nxp->ex_path, NULL, 0);
-	if (IS_ERR(dentry)) {
-		err = -EINVAL;
+	if (IS_ERR(dentry))
 		goto finish;
-	}
+	err = -ENOENT;
 	inode = dentry->d_inode;
-	if(!inode) {
-		err = -ENOENT;
+	if(!inode)
 		goto finish;
-	}
+	err = -EINVAL;
 	if(inode->i_dev != nxp->ex_dev || inode->i_ino != nxp->ex_ino) {
 		/* I'm just being paranoid... */
-		err = -EINVAL;
 		goto finish;
 	}
 
 	/* We currently export only dirs. */
-	if (!S_ISDIR(inode->i_mode)) {
-		err = -ENOTDIR;
+	err = -ENOTDIR;
+	if (!S_ISDIR(inode->i_mode))
 		goto finish;
-	}
 
 	/* If this is a sub-export, must be root of FS */
 	if ((parent = exp_parent(clp, dev)) != NULL) {
@@ -211,10 +208,9 @@
 		}
 	}
 
-	if (!(exp = kmalloc(sizeof(*exp), GFP_USER))) {
-		err = -ENOMEM;
+	err = -ENOMEM;
+	if (!(exp = kmalloc(sizeof(*exp), GFP_USER)))
 		goto finish;
-	}
 	dprintk("nfsd: created export entry %p for client %p\n", exp, clp);
 
 	strcpy(exp->ex_path, nxp->ex_path);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov