From 35e8ecabd7db36431ea93f523095bc21078ecef8 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Sun, 13 Nov 2016 16:43:36 +0530 Subject: system/posix-acl: Log reason for EACCES It is becoming increasingly difficult to debug the reason why posix-acl decides to fail a fop with EACCES. This patch prints a big log everytime such a condition occurs giving out the details that may help in finding why the fop is errored out. Change-Id: I2505baaafb5d77ef6c187554ff027df9b20468db BUG: 1394548 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/15837 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Raghavendra Talur --- libglusterfs/src/common-utils.c | 9 ++++++++- libglusterfs/src/common-utils.h | 2 ++ libglusterfs/src/glfs-message-id.h | 6 +++++- libglusterfs/src/glusterfs-acl.h | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 14a344958fd..18c2a39d60e 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -36,7 +36,6 @@ #endif #include -#include "glusterfs-acl.h" #include "compat-errno.h" #include "logging.h" #include "common-utils.h" @@ -4588,3 +4587,11 @@ gf_bits_index (uint64_t n) { return ffsll(n) - 1; } + +const char* +gf_fop_string (glusterfs_fop_t fop) +{ + if ((fop > GF_FOP_NULL) && (fop < GF_FOP_MAXVALUE)) + return gf_fop_list[fop]; + return "INVALID"; +} diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index 082a44403dc..324555b34f5 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -866,4 +866,6 @@ gf_bits_count (uint64_t n); int32_t gf_bits_index (uint64_t n); +const char* +gf_fop_string (glusterfs_fop_t fop); #endif /* _COMMON_UTILS_H */ diff --git a/libglusterfs/src/glfs-message-id.h b/libglusterfs/src/glfs-message-id.h index 8601c5cc5ab..d77e90cbec9 100644 --- a/libglusterfs/src/glfs-message-id.h +++ b/libglusterfs/src/glfs-message-id.h @@ -181,7 +181,11 @@ GLFS_MSGID_COMP_SYMLINK_CACHE_END #define GLFS_MSGID_COMP_INDEX GLFS_MSGID_COMP_LEASES_END #define GLFS_MSGID_COMP_INDEX_END (GLFS_MSGID_COMP_INDEX +\ - GLFS_MSGID_SEGMENT) + GLFS_MSGID_SEGMENT) + +#define GLFS_MSGID_COMP_POSIX_ACL GLFS_MSGID_COMP_INDEX_END +#define GLFS_MSGID_COMP_POSIX_ACL_END (GLFS_MSGID_COMP_POSIX_ACL +\ + GLFS_MSGID_SEGMENT) /* --- new segments for messages goes above this line --- */ #endif /* !_GLFS_MESSAGE_ID_H_ */ diff --git a/libglusterfs/src/glusterfs-acl.h b/libglusterfs/src/glusterfs-acl.h index 55f94ff0509..2a1661686bc 100644 --- a/libglusterfs/src/glusterfs-acl.h +++ b/libglusterfs/src/glusterfs-acl.h @@ -100,6 +100,7 @@ struct posix_acl_ctx { uid_t uid; gid_t gid; mode_t perm; + glusterfs_fop_t fop; struct posix_acl *acl_access; struct posix_acl *acl_default; }; -- cgit