From: Lei Feng Date: Mon, 26 Apr 2021 08:28:57 +0000 (+0800) Subject: EX-3082 lipe: posix scan cannot get projid X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=6e8b70af59d5fc923fbdf1172e350480d94c862c;p=fs%2Flustre-release.git 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 --- 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;