diff options
author | Soumya Koduri <skoduri@redhat.com> | 2015-06-12 13:45:09 +0530 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2015-06-27 16:22:51 -0700 |
commit | b68f671b2b8a0aafef8f98145aee7044edaa907d (patch) | |
tree | 96a8e2d6a252692887161b3e255aae2cf1db62ce /api/src/glfs-handleops.c | |
parent | 58a736111fa1db4f10c6646e81066434260f674f (diff) |
Upcall/gfapi: Return ENOTSUP when upcall feature is disabled
Changes to detect the list of upcall events enabled using GF_FOP_IPC
and return ENOTSUP to applications in case if they poll for any of
the events disabled.
Change-Id: Icc748054ef903598288119dbe99b1e337174662a
BUG: 1231132
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: http://review.gluster.org/11196
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'api/src/glfs-handleops.c')
-rw-r--r-- | api/src/glfs-handleops.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c index c010f0c9a0f..f458cb4bd58 100644 --- a/api/src/glfs-handleops.c +++ b/api/src/glfs-handleops.c @@ -1881,6 +1881,18 @@ pub_glfs_h_poll_upcall (struct glfs *fs, struct callback_arg *up_arg) __GLFS_ENTRY_VALIDATE_FS (fs, err); + /* check if upcalls are enabled */ + if (!fs->upcall_features) { + errno = ENOTSUP; + goto restore; + } + + /* check if GF_UPCALL_CACHE_INVALIDATION is supported */ + if (!(fs->upcall_features & (1 << GF_UPCALL_CACHE_INVALIDATION))) { + errno = ENOTSUP; + goto restore; + } + /* get the active volume */ subvol = glfs_active_subvol (fs); |