Skip to contentSkip to conversation

xfs_quota: fix false error reporting of project inheritance flag is not set

PATCH In review Achilles Gaikwad 2 participants 2 messages Jan 6, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xfs_quota: fix false error reporting of project inheritance flag is not set

After kernel commit:

9336e3a7 "xfs: project id inheritance is a directory only flag"

xfs stopped setting the project inheritance flag on regular files, but userspace quota code still checks for it and will now issue the error:

"project inheritance flag is not set"

for every regular file during quotacheck. Fix this by only checking for the flag on directories.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1663502

---
 quota/project.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
quota/project.c +1 -1
index e4e7a012..11f3be04 100644
@@ -126,7 +126,7 @@ check_project(
 			printf(_("%s - project identifier is not set"
 				 " (inode=%u, tree=%u)\n"),
 				path, fsx.fsx_projid, (unsigned int)prid);
-		if (!(fsx.fsx_xflags & FS_XFLAG_PROJINHERIT))
+		if (!(fsx.fsx_xflags & FS_XFLAG_PROJINHERIT) && S_ISDIR(stat->st_mode))
 			printf(_("%s - project inheritance flag is not set\n"),
 				path);
 	}
Signature · 1 line
2.20.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Achilles Gaikwad

After kernel commit:

9336e3a7 "xfs: project id inheritance is a directory only flag"

xfs stopped setting the project inheritance flag on regular files, but userspace quota code still checks for it and will now issue the error:

Quoted 8 lines

"project inheritance flag is not set"

for every regular file during quotacheck. Fix this by only checking for the flag on directories.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1663502

Looks ok to me...

--D

Quoted 20 lines
---
 quota/project.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
quota/project.c +1 -1
index e4e7a012..11f3be04 100644
@@ -126,7 +126,7 @@ check_project(
 			printf(_("%s - project identifier is not set"
 				 " (inode=%u, tree=%u)\n"),
 				path, fsx.fsx_projid, (unsigned int)prid);
-		if (!(fsx.fsx_xflags & FS_XFLAG_PROJINHERIT))
+		if (!(fsx.fsx_xflags & FS_XFLAG_PROJINHERIT) && S_ISDIR(stat->st_mode))
 			printf(_("%s - project inheritance flag is not set\n"),
 				path);
 	}
Signature · 1 line
2.20.1