]> Pileus Git - ~andy/linux/blobdiff - fs/nfsd/vfs.c
locks: break delegations on unlink
[~andy/linux] / fs / nfsd / vfs.c
index 8ff6a0019b0b9cc6016da02c3210ae6840a20dfa..7a810235d5994a69d3c395e9299a26a405bc3840 100644 (file)
@@ -830,9 +830,10 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
                        flags = O_WRONLY|O_LARGEFILE;
        }
        *filp = dentry_open(&path, flags, current_cred());
-       if (IS_ERR(*filp))
+       if (IS_ERR(*filp)) {
                host_err = PTR_ERR(*filp);
-       else {
+               *filp = NULL;
+       } else {
                host_err = ima_file_check(*filp, may_flags);
 
                if (may_flags & NFSD_MAY_64BIT_COOKIE)
@@ -1316,9 +1317,8 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
                if (!fhp->fh_locked) {
                        /* not actually possible */
                        printk(KERN_ERR
-                               "nfsd_create: parent %s/%s not locked!\n",
-                               dentry->d_parent->d_name.name,
-                               dentry->d_name.name);
+                               "nfsd_create: parent %pd2 not locked!\n",
+                               dentry);
                        err = nfserr_io;
                        goto out;
                }
@@ -1328,8 +1328,8 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
         */
        err = nfserr_exist;
        if (dchild->d_inode) {
-               dprintk("nfsd_create: dentry %s/%s not negative!\n",
-                       dentry->d_name.name, dchild->d_name.name);
+               dprintk("nfsd_create: dentry %pd/%pd not negative!\n",
+                       dentry, dchild);
                goto out; 
        }
 
@@ -1910,7 +1910,7 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
        if (host_err)
                goto out_put;
        if (type != S_IFDIR)
-               host_err = vfs_unlink(dirp, rdentry);
+               host_err = vfs_unlink(dirp, rdentry, NULL);
        else
                host_err = vfs_rmdir(dirp, rdentry);
        if (!host_err)