summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs.h
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2010-09-22 03:32:17 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-22 04:14:27 -0700
commitf47b0c55de9941823fbefe4b3a7e37179d6d4329 (patch)
treeab22e40749a8173a869bfc1567fb2ef816196f56 /xlators/nfs/server/src/nfs.h
parent6b2e2fb0903fc56105c267881f202a4865a8b6c7 (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/nfs.h')
-rw-r--r--xlators/nfs/server/src/nfs.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/xlators/nfs/server/src/nfs.h b/xlators/nfs/server/src/nfs.h
index baee0ce0f6a..6e6b433ce66 100644
--- a/xlators/nfs/server/src/nfs.h
+++ b/xlators/nfs/server/src/nfs.h
@@ -58,20 +58,37 @@ struct nfs_initer_list {
rpcsvc_program_t *program;
};
+typedef enum {
+ GF_NFS_SUBVOLUME_NOTSTARTED = 1,
+ GF_NFS_SUBVOLUME_LOOKUPSENT,
+ GF_NFS_SUBVOLUME_STARTED,
+} nfs_subvolume_status_t;
+
+struct nfs_subvolume {
+ xlator_t *subvol;
+ nfs_subvolume_status_t status;
+};
+
+#define gf_nfs_subvolume_started(svl) ((svl)->status == GF_NFS_SUBVOLUME_STARTED)
+#define gf_nfs_subvolume_lookupsent(svl) ((svl)->status == GF_NFS_SUBVOLUME_LOOKUPSENT)
+#define gf_nfs_subvolume_notstarted(svl) ((svl)->status == GF_NFS_SUBVOLUME_NOTSTARTED)
+
+#define gf_nfs_subvolume_unused_slot(svl) ((svl)->subvol == NULL)
+#define gf_nfs_all_subvolumes_started(nf) ((nf->upsubvols == nf->allsubvols) && (!nf->subvols_started))
struct nfs_state {
rpcsvc_t *rpcsvc;
struct list_head versions;
struct mem_pool *foppool;
unsigned int memfactor;
- xlator_list_t *subvols;
gf_lock_t svinitlock;
int allsubvols;
int upsubvols;
- xlator_t **initedxl;
+ struct nfs_subvolume *subvols;
int subvols_started;
int dynamicvolumes;
+ xlator_t *nfsx;
};
#define gf_nfs_dvm_on(nfsstt) (((struct nfs_state *)nfsstt)->dynamicvolumes == GF_NFS_DVM_ON)