Commit 3cb3fd6d authored by Trond Myklebust's avatar Trond Myklebust Committed by Trond Myklebust

NFS: Fix up sillyrename()

Ensure that we register the fact that the inode ctime has changed.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent ed7e9ad0
...@@ -448,6 +448,7 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry) ...@@ -448,6 +448,7 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry)
unsigned char silly[SILLYNAME_LEN + 1]; unsigned char silly[SILLYNAME_LEN + 1];
unsigned long long fileid; unsigned long long fileid;
struct dentry *sdentry; struct dentry *sdentry;
struct inode *inode = d_inode(dentry);
struct rpc_task *task; struct rpc_task *task;
int error = -EBUSY; int error = -EBUSY;
...@@ -485,6 +486,8 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry) ...@@ -485,6 +486,8 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry)
goto out; goto out;
} while (d_inode(sdentry) != NULL); /* need negative lookup */ } while (d_inode(sdentry) != NULL); /* need negative lookup */
ihold(inode);
/* queue unlink first. Can't do this from rpc_release as it /* queue unlink first. Can't do this from rpc_release as it
* has to allocate memory * has to allocate memory
*/ */
...@@ -509,6 +512,12 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry) ...@@ -509,6 +512,12 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry)
case 0: case 0:
/* The rename succeeded */ /* The rename succeeded */
nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
spin_lock(&inode->i_lock);
NFS_I(inode)->attr_gencount = nfs_inc_attr_generation_counter();
NFS_I(inode)->cache_validity |= NFS_INO_INVALID_CHANGE
| NFS_INO_INVALID_CTIME
| NFS_INO_REVAL_FORCED;
spin_unlock(&inode->i_lock);
d_move(dentry, sdentry); d_move(dentry, sdentry);
break; break;
case -ERESTARTSYS: case -ERESTARTSYS:
...@@ -519,6 +528,7 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry) ...@@ -519,6 +528,7 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry)
} }
rpc_put_task(task); rpc_put_task(task);
out_dput: out_dput:
iput(inode);
dput(sdentry); dput(sdentry);
out: out:
return error; return error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment