From 6e8b70af59d5fc923fbdf1172e350480d94c862c Mon Sep 17 00:00:00 2001 From: Lei Feng Date: Mon, 26 Apr 2021 16:28:57 +0800 Subject: [PATCH] EX-3082 lipe: posix scan cannot get projid Regular file or directory can have projid. So if an entry is not regular AND not directory, set projid to 0. Change-Id: Id9e7dd471513817ac1cb9d146563b369f9ebe2eb Signed-off-by: Lei Feng Test-Parameters: trivial Reviewed-on: https://review.whamcloud.com/43447 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo --- lipe/src/posix_ea.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lipe/src/posix_ea.c b/lipe/src/posix_ea.c index a6e61e4..34e2f30 100644 --- a/lipe/src/posix_ea.c +++ b/lipe/src/posix_ea.c @@ -365,8 +365,7 @@ static int posix_get_projid(struct lipe_object *object, const char *path = object->u.lo_posix.lop_path; LASSERT(attrs->loa_attr_bits & LIPE_OBJECT_ATTR_ATTR); - if (((attrs->loa_mode & S_IFMT) != S_IFREG) || - ((attrs->loa_mode & S_IFMT) != S_IFDIR)) { + if (!S_ISREG(attrs->loa_mode) && !S_ISDIR(attrs->loa_mode)) { attrs->loa_projid = 0; attrs->loa_attr_bits |= LIPE_OBJECT_ATTR_PROJID; return 0; -- 1.8.3.1