From d6278602caabac85b49887dc45e83b3cadfeb19b Mon Sep 17 00:00:00 2001 From: vmallika Date: Thu, 27 Nov 2014 18:38:59 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/9205 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- .../features/snapview-client/src/snapview-client.c | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'xlators/features') 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, -- cgit