summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2014-11-27 18:38:59 +0530
committerVijay Bellur <vbellur@redhat.com>2014-11-28 03:56:01 -0800
commitd6278602caabac85b49887dc45e83b3cadfeb19b (patch)
tree50c179c8516662c954989765de8d6b6ec66df1ea /xlators
parent9ff09ed29cd6659c82f6dc6f9c3f17b570b97697 (diff)
gluster/uss: Handle notify in snapview-client
As there are two subvolumes in snapview-client, there is a possibility that the regular subvolume is still down and snapd subvolume come up first. So if we don't handle this situation CHILD_UP event will be propagated upwards to fuse when regular subvolume is still down. This can cause data unavailable for the application Change-Id: I9e5166ed22c2cf637c15db0457c2b57ca044078e BUG: 1168643 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9205 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/snapview-client/src/snapview-client.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c
index ea0feeaf4b2..0f8913d18ce 100644
--- a/xlators/features/snapview-client/src/snapview-client.c
+++ b/xlators/features/snapview-client/src/snapview-client.c
@@ -1662,6 +1662,31 @@ fini (xlator_t *this)
return;
}
+int
+notify (xlator_t *this, int event, void *data, ...)
+{
+ xlator_t *subvol = NULL;
+ int ret = 0;
+
+ subvol = data;
+
+ /* As there are two subvolumes in snapview-client, there is
+ * a possibility that the regular subvolume is still down and
+ * snapd subvolume come up first. So if we don't handle this situation
+ * CHILD_UP event will be propagated upwards to fuse when
+ * regular subvolume is still down.
+ * This can cause data unavailable for the application.
+ * So for now send notifications up only for regular subvolume.
+ *
+ * TODO: In future if required we may need to handle
+ * notifications from virtual subvolume
+ */
+ if (subvol != SECOND_CHILD (this))
+ ret = default_notify (this, event, data);
+
+ return ret;
+}
+
struct xlator_fops fops = {
.lookup = svc_lookup,
.opendir = svc_opendir,