diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2010-09-22 03:32:17 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-22 04:14:27 -0700 |
commit | f47b0c55de9941823fbefe4b3a7e37179d6d4329 (patch) | |
tree | ab22e40749a8173a869bfc1567fb2ef816196f56 /xlators/nfs/server/src/mount3.c | |
parent | 6b2e2fb0903fc56105c267881f202a4865a8b6c7 (diff) |
nfs, nfs3: Base volume access on CHILD-UP-DOWN event
Overall, the aim of this patch is to change the result of an nfs
op depending on whether the underlying volume is up or down
as notified by CHILD_UP and CHILD_DOWN events.
This patch contains three intertwined changes:
o Only when the lookup on the root of a volume is successful does gnfs now
export the subvolume. Till now the result of the lookup was not used to
determine whether we should export that volume. Not accounting for root lookup
failure resulted in ESTALEs on first access because some children of distribute
were down at the time of the root lookup.
o Only when lookups on all the subvolumes have succeeded are
these exports enabled through NFS.
o When a child of say distribute goes down, on CHILD_DOWN event nfs will
ignore all incoming requests from the client because ignoring these
will prevent ESTALEs for those requests and in the hope that ignoring the
requests will make the client retransmit. There are risks in this approach
absent the DRC but we're willing to live with that for now.
When a child goes down, the mount exports list will continue to show it
but mount requests will be denied.
Signed-off-by: Shehjar Tikoo <shehjart@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1643 (Initial requests after mount ESTALE if DHT subvolumes connect after nfs startup)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1643
Diffstat (limited to 'xlators/nfs/server/src/mount3.c')
-rw-r--r-- | xlators/nfs/server/src/mount3.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c index 3ea4bc8e8..84e1456fb 100644 --- a/xlators/nfs/server/src/mount3.c +++ b/xlators/nfs/server/src/mount3.c @@ -766,6 +766,14 @@ mnt3svc_mnt (rpcsvc_request_t *req) goto mnterr; } + if ((is_nfs_subvolume_disabled (nfs_state (ms->nfsx), exp->vol))) { + gf_log (GF_MNT, GF_LOG_ERROR, "Volume is disabled: %s", + exp->vol->name); + ret = RPCSVC_ACTOR_ERROR; + mntstat = MNT3ERR_INVAL; + goto mnterr; + } + ret = mnt3_check_client_net (ms, req, exp->vol); if (ret == -1) { mntstat = MNT3ERR_ACCES; |