NFSD: only call fh_unlock() once in nfsd_link()
[sfrench/cifs-2.6.git] / fs / nfsd / vfs.c
index 00b0b80c0c44746a1fdd6b688f4633dc0a029b3e..cce4130e70080c9285f9c59f98f90260cb80b4c1 100644 (file)
@@ -1541,9 +1541,10 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,
        dirp = d_inode(ddir);
 
        dnew = lookup_one_len(name, ddir, len);
-       host_err = PTR_ERR(dnew);
-       if (IS_ERR(dnew))
-               goto out_nfserr;
+       if (IS_ERR(dnew)) {
+               err = nfserrno(PTR_ERR(dnew));
+               goto out_unlock;
+       }
 
        dold = tfhp->fh_dentry;
 
@@ -1562,17 +1563,17 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,
                else
                        err = nfserrno(host_err);
        }
-out_dput:
        dput(dnew);
-out_unlock:
-       fh_unlock(ffhp);
+out_drop_write:
        fh_drop_write(tfhp);
 out:
        return err;
 
-out_nfserr:
-       err = nfserrno(host_err);
-       goto out_unlock;
+out_dput:
+       dput(dnew);
+out_unlock:
+       fh_unlock(ffhp);
+       goto out_drop_write;
 }
 
 static void