NFSv4: Don't ask for delegated attributes when adding a hard link
authorTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 9 Apr 2018 01:06:40 +0000 (21:06 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 4 Jun 2018 16:07:07 +0000 (12:07 -0400)
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs4proc.c

index 744a6367618db214cda6682e400e5bc174a12e38..544cdcb79b4fa60f9a61a7f2296e895737b2df53 100644 (file)
@@ -4378,11 +4378,12 @@ static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
 static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
 {
        struct nfs_server *server = NFS_SERVER(inode);
+       __u32 bitmask[NFS4_BITMASK_SZ];
        struct nfs4_link_arg arg = {
                .fh     = NFS_FH(inode),
                .dir_fh = NFS_FH(dir),
                .name   = name,
-               .bitmask = server->attr_bitmask,
+               .bitmask = bitmask,
        };
        struct nfs4_link_res res = {
                .server = server,
@@ -4404,9 +4405,9 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct
                status = PTR_ERR(res.label);
                goto out;
        }
-       arg.bitmask = nfs4_bitmask(server, res.label);
 
        nfs4_inode_make_writeable(inode);
+       nfs4_bitmap_copy_adjust_setattr(bitmask, nfs4_bitmask(server, res.label), inode);
 
        status = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, &res.seq_res, 1);
        if (!status) {