summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2014-05-07 20:13:43 +0530
committerVijay Bellur <vbellur@redhat.com>2014-05-29 09:25:46 -0700
commitcc0378d39f4082f51d5ef6e02b3007fe9e78cb31 (patch)
treef5c82bece9cf1a2fd79685ef2d89bcd2a5b8428f /libglusterfs
parent58b9edee87bba3ffe812cf15f171926be017575b (diff)
user servicable snapshots
Change-Id: Idbf27dbe088e646a8ab81cedc5818413795895ea Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Signed-off-by: Anand Subramanian <anands@redhat.com> Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/7700 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/syncop.c17
-rw-r--r--libglusterfs/src/xlator.h1
2 files changed, 17 insertions, 1 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index 9705a7d5452..3dd622c8e99 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -2174,6 +2174,21 @@ syncop_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
return 0;
}
+/* posix_acl xlator will respond in different ways for access calls from
+ fuse and access calls from nfs. For fuse, checking op_ret is sufficient
+ to check whether the access call is successful or not. But for nfs the
+ mode of the access that is permitted is put into op_errno before unwind.
+ With syncop, the caller of syncop_access will not be able to get the
+ mode of the access despite call being successul (since syncop_access
+ returns only the op_ret collected in args).
+ Now, if access call is failed, then args.op_ret is returned to recognise
+ the failure. But if op_ret is zero, then the mode of access which is
+ set in args.op_errno is returned. Thus the caller of syncop_access
+ has to check whether the return value is less than zero or not. If the
+ return value it got is less than zero, then access call is failed.
+ If it is not, then the access call is successful and the value the caller
+ got is the mode of the access.
+*/
int
syncop_access (xlator_t *subvol, loc_t *loc, int32_t mask)
{
@@ -2184,7 +2199,7 @@ syncop_access (xlator_t *subvol, loc_t *loc, int32_t mask)
if (args.op_ret < 0)
return -args.op_errno;
- return args.op_ret;
+ return args.op_errno;
}
diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h
index 1daa06ec2ed..47ae6cdd6b6 100644
--- a/libglusterfs/src/xlator.h
+++ b/libglusterfs/src/xlator.h
@@ -29,6 +29,7 @@
#include "latency.h"
#define FIRST_CHILD(xl) (xl->children->xlator)
+#define SECOND_CHILD(xl) (xl->children->next->xlator)
#define GF_SET_ATTR_MODE 0x1
#define GF_SET_ATTR_UID 0x2