From 41998544b8a34b3c385f2a6adb7ebc01ba496182 Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Tue, 4 Jun 2013 13:19:24 -0500 Subject: [PATCH] LU-3435 util: Improvement to error logging for l_getidentity The LU-2107 patch to l_getidentity does not set the data->idd_err value to errno, and does not log the uid when getgrouplist() fails. This patch fixes both of those concerns. Signed-off-by: Patrick Farrell Change-Id: I8a5715bada61a4c69d4d875b60097f9414a25f1c Reviewed-on: http://review.whamcloud.com/6533 Reviewed-by: Keith Mannthey Tested-by: Hudson Tested-by: Maloo Reviewed-by: Emoly Liu Reviewed-by: Oleg Drokin --- lustre/utils/l_getidentity.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lustre/utils/l_getidentity.c b/lustre/utils/l_getidentity.c index 936f494..3729f3f 100644 --- a/lustre/utils/l_getidentity.c +++ b/lustre/utils/l_getidentity.c @@ -137,7 +137,8 @@ int get_groups_local(struct identity_downcall_data *data, groups_tmp = malloc(maxgroups * sizeof(gid_t)); if (groups_tmp == NULL) { free(pw_name); - errlog("malloc error\n"); + data->idd_err = errno ? errno : ENOMEM; + errlog("malloc error=%u\n",data->idd_err); return -1; } @@ -146,7 +147,9 @@ int get_groups_local(struct identity_downcall_data *data, 0) { free(pw_name); free(groups_tmp); - errlog("getgrouplist() error\n"); + data->idd_err = errno ? errno : EIDRM; + errlog("getgrouplist() error for uid %u: error=%u\n", + data->idd_uid, data->idd_err); return -1; } -- 1.8.3.1