diff options
author | Raghavendra Bhat <raghavendra@redhat.com> | 2014-05-07 20:13:43 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-05-29 09:25:46 -0700 |
commit | cc0378d39f4082f51d5ef6e02b3007fe9e78cb31 (patch) | |
tree | f5c82bece9cf1a2fd79685ef2d89bcd2a5b8428f /libglusterfs/src/syncop.c | |
parent | 58b9edee87bba3ffe812cf15f171926be017575b (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/src/syncop.c')
-rw-r--r-- | libglusterfs/src/syncop.c | 17 |
1 files changed, 16 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; } |