Revert "NFS: remove BUG possibility in nfs4_open_and_get_state"
authorTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 23 Oct 2014 16:22:31 +0000 (19:22 +0300)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 5 Nov 2014 01:53:49 +0000 (19:53 -0600)
This reverts commit f39c01047994e66e7f3d89ddb4c6141f23349d8d.

fs/nfs/nfs4proc.c

index 405bd95c1f588739a511fb1566ed47f1513e696f..8026197e2b9f40141c718789a2956c105f3295af 100644 (file)
@@ -2233,13 +2233,9 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
        ret = _nfs4_proc_open(opendata);
        if (ret != 0) {
                if (ret == -ENOENT) {
-                       dentry = opendata->dentry;
-                       if (dentry->d_inode)
-                               d_delete(dentry);
-                       else if (d_unhashed(dentry))
-                               d_add(dentry, NULL);
-
-                       nfs_set_verifier(dentry,
+                       d_drop(opendata->dentry);
+                       d_add(opendata->dentry, NULL);
+                       nfs_set_verifier(opendata->dentry,
                                         nfs_save_change_attribute(opendata->dir->d_inode));
                }
                goto out;