summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2021-04-01 20:57:56 +0200
committerTrond Myklebust <trond.myklebust@hammerspace.com>2021-04-14 15:36:29 +0200
commit1301e421b75b90b1a6101961b3aca2d91a9a0599 (patch)
tree4c24b18988db5beaa630ca5646d7cd25f72bc770 /fs/nfs/nfs4proc.c
parentNFSv4: nfs4_inc/dec_nlink_locked should also invalidate ctime (diff)
downloadlinux-1301e421b75b90b1a6101961b3aca2d91a9a0599.tar.xz
linux-1301e421b75b90b1a6101961b3aca2d91a9a0599.zip
NFSv4: link must update the inode nlink.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to '')
-rw-r--r--fs/nfs/nfs4proc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index d05f4ca5d9c0..2215f20e0e78 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1176,6 +1176,14 @@ nfs4_inc_nlink_locked(struct inode *inode)
}
static void
+nfs4_inc_nlink(struct inode *inode)
+{
+ spin_lock(&inode->i_lock);
+ nfs4_inc_nlink_locked(inode);
+ spin_unlock(&inode->i_lock);
+}
+
+static void
nfs4_dec_nlink_locked(struct inode *inode)
{
nfs_set_cache_invalid(inode, NFS_INO_INVALID_CHANGE |
@@ -4791,6 +4799,7 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct
if (!status) {
nfs4_update_changeattr(dir, &res.cinfo, res.fattr->time_start,
NFS_INO_INVALID_DATA);
+ nfs4_inc_nlink(inode);
status = nfs_post_op_update_inode(inode, res.fattr);
if (!status)
nfs_setsecurity(inode, res.fattr, res.label);