diff options
author | Amar Tumballi <amar@kadalu.io> | 2020-03-04 00:46:08 +0530 |
---|---|---|
committer | Xavi Hernandez <xhernandez@redhat.com> | 2020-03-13 12:15:21 +0000 |
commit | eb916c057036db8289b41265797e5dce066d1512 (patch) | |
tree | 35f9e09a454a38b2ef3bf5b317e295d4f90de948 | |
parent | 2668e9f1892dbe898e41e3a14701258d78cb8f46 (diff) |
utime: resolve an issue of permission denied logs
In case where uid is not set to be 0, there are possible errors
from acl xlator. So, set `uid = 0;` with pid indicating this is
set from UTIME activity.
The message "E [MSGID: 148002] [utime.c:146:gf_utime_set_mdata_setxattr_cbk] 0-dev_SNIP_data-utime: dict set of key for set-ctime-mdata failed [Permission denied]" repeated 2 times between [2019-12-19 21:27:55.042634] and [2019-12-19 21:27:55.047887]
Change-Id: Ieadf329835a40a13ac0bf908dac776e66954466c
Fixes: #832
Signed-off-by: Amar Tumballi <amar@kadalu.io>
-rw-r--r-- | libglusterfs/src/glusterfs/common-utils.h | 3 | ||||
-rw-r--r-- | xlators/features/utime/src/utime.c | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/libglusterfs/src/glusterfs/common-utils.h b/libglusterfs/src/glusterfs/common-utils.h index dd73a240c59..13e413c3632 100644 --- a/libglusterfs/src/glusterfs/common-utils.h +++ b/libglusterfs/src/glusterfs/common-utils.h @@ -167,7 +167,8 @@ enum _gf_special_pid { GF_CLIENT_PID_SCRUB = -9, GF_CLIENT_PID_TIER_DEFRAG = -10, GF_SERVER_PID_TRASH = -11, - GF_CLIENT_PID_ADD_REPLICA_MOUNT = -12 + GF_CLIENT_PID_ADD_REPLICA_MOUNT = -12, + GF_CLIENT_PID_SET_UTIME = -13, }; enum _gf_xlator_ipc_targets { diff --git a/xlators/features/utime/src/utime.c b/xlators/features/utime/src/utime.c index 3b8dadd3191..eb6ee6f76f4 100644 --- a/xlators/features/utime/src/utime.c +++ b/xlators/features/utime/src/utime.c @@ -192,8 +192,18 @@ gf_utime_set_mdata_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, loc.inode = inode_ref(inode); gf_uuid_copy(loc.gfid, stbuf->ia_gfid); + + pid_t pid = frame->root->pid; + uid_t uid = frame->root->uid; + gid_t gid = frame->root->gid; + frame->root->uid = 0; + frame->root->gid = 0; + frame->root->pid = GF_CLIENT_PID_SET_UTIME; STACK_WIND(frame, gf_utime_set_mdata_setxattr_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->setxattr, &loc, dict, 0, NULL); + frame->root->uid = uid; + frame->root->gid = gid; + frame->root->pid = pid; dict_unref(dict); inode_unref(loc.inode); |