Whamcloud - gitweb
EX-3082 lipe: posix scan cannot get projid
authorLei Feng <flei@whamcloud.com>
Mon, 26 Apr 2021 08:28:57 +0000 (16:28 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 29 Apr 2021 01:43:51 +0000 (01:43 +0000)
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 <flei@whamcloud.com>
Test-Parameters: trivial
Reviewed-on: https://review.whamcloud.com/43447
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lipe/src/posix_ea.c

index a6e61e4..34e2f30 100644 (file)
@@ -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;