]> git.baikalelectronics.ru Git - kernel.git/commitdiff
NFSv4: Observe the NFS_MOUNT_SOFTREVAL flag in _nfs4_proc_lookupp
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 20 Oct 2020 18:30:35 +0000 (14:30 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 2 Dec 2020 19:05:51 +0000 (14:05 -0500)
We need to respect the NFS_MOUNT_SOFTREVAL flag in _nfs4_proc_lookupp,
by timing out if the server is unavailable.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs4proc.c

index 9e0ca9b2b210b01e07e40f535b28703b1eaf9ff4..a5b9356bee6ae090c0214bb42fcde1a5db2967c7 100644 (file)
@@ -4397,6 +4397,10 @@ static int _nfs4_proc_lookupp(struct inode *inode,
                .rpc_argp = &args,
                .rpc_resp = &res,
        };
+       unsigned short task_flags = 0;
+
+       if (NFS_SERVER(inode)->flags & NFS_MOUNT_SOFTREVAL)
+               task_flags |= RPC_TASK_TIMEOUT;
 
        args.bitmask = nfs4_bitmask(server, label);
 
@@ -4404,7 +4408,7 @@ static int _nfs4_proc_lookupp(struct inode *inode,
 
        dprintk("NFS call  lookupp ino=0x%lx\n", inode->i_ino);
        status = nfs4_call_sync(clnt, server, &msg, &args.seq_args,
-                               &res.seq_res, 0);
+                               &res.seq_res, task_flags);
        dprintk("NFS reply lookupp: %d\n", status);
        return status;
 }