diff options
author | Trond Myklebust <trondmy@gmail.com> | 2020-03-01 18:21:42 -0500 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2020-03-16 12:04:33 -0400 |
commit | 65286b883c6de6b30928c837c47c167e82bde0b2 (patch) | |
tree | d40b431adb770b253c21305c9680ed3456b22ffe /fs/nfs/dns_resolve.c | |
parent | 6a30e47fa0c358cc84002e6a429f5f229e0b7b07 (diff) | |
download | linux-65286b883c6de6b30928c837c47c167e82bde0b2.tar.bz2 |
nfsd: export upcalls must not return ESTALE when mountd is down
If the rpc.mountd daemon goes down, then that should not cause all
exports to start failing with ESTALE errors. Let's explicitly
distinguish between the cache upcall cases that need to time out,
and those that do not.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfs/dns_resolve.c')
-rw-r--r-- | fs/nfs/dns_resolve.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c index 89bd5581f317..963800037609 100644 --- a/fs/nfs/dns_resolve.c +++ b/fs/nfs/dns_resolve.c @@ -152,12 +152,13 @@ static int nfs_dns_upcall(struct cache_detail *cd, struct cache_head *ch) { struct nfs_dns_ent *key = container_of(ch, struct nfs_dns_ent, h); - int ret; - ret = nfs_cache_upcall(cd, key->hostname); - if (ret) - ret = sunrpc_cache_pipe_upcall(cd, ch); - return ret; + if (test_and_set_bit(CACHE_PENDING, &ch->flags)) + return 0; + if (!nfs_cache_upcall(cd, key->hostname)) + return 0; + clear_bit(CACHE_PENDING, &ch->flags); + return sunrpc_cache_pipe_upcall_timeout(cd, ch); } static int nfs_dns_match(struct cache_head *ca, |