[LU-12383] lfs project inhert difference between ldiskfs and zfs Created: 04/Jun/19 Updated: 12/Jul/19 Resolved: 16/Jun/19 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.13.0 |
| Fix Version/s: | Lustre 2.13.0, Lustre 2.12.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Nathaniel Clark | Assignee: | Wang Shilong (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | quota | ||
| Issue Links: |
|
||||||||
| Severity: | 3 | ||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||
| Description |
|
Regular files inherit the Project Inherit flag in ldiskfs, zfs they do not. Given the following commands: mkdir proj lfs project -sp 1000 proj touch proj/test lfs project proj ldiskfs output: 1000 P proj/test ZFS 0.8.0 output: 1000 - proj/test Both correctly set inherit on sub-directories.
This difference in behavior causes sanity-quota test_54 to fail for ZFS 0.8.0 https://testing.whamcloud.com/test_sets/afa8f438-81b8-11e9-869c-52540065bddc |
| Comments |
| Comment by Nathaniel Clark [ 05/Jun/19 ] |
|
Is there a specification for behavior of the INHERIT bit on regular files? It seems that it doesn't make sense for the inherit bit to be set on a regular file, just on sub-directories. There would be three ways to fix this.
My initial impression is that, I'm not sure #1 is "correct". #2 seems like a hack, so I think #3 is best option, since I don't feel like it makes sense for a regular file to have this bit set. |
| Comment by Andreas Dilger [ 05/Jun/19 ] |
|
How does the inheritance of this flag work on native ext4 and XFS? To my thinking, it doesn't make sense to inherit this flag on regular files, only directories. That would imply the correct fix is a fourth option - not to inherit the flag in ldiskfs, and match the behavior of ZFS, but let's first see how other filesystems handle it. |
| Comment by Wang Shilong (Inactive) [ 06/Jun/19 ] |
|
I just checked Upstream ext4 and xfs: XFS only inherit inherit flag for Directory, but ext4 always inherit it for dirs/regular files. 1) Alter lfs project -c to only complain if inherit bit is "missing" from Directory. Notice, even we have inherit flag for regular files, it dose no harm as well. |
| Comment by Gerrit Updater [ 06/Jun/19 ] |
|
Wang Shilong (wshilong@ddn.com) uploaded a new patch: https://review.whamcloud.com/35076 |
| Comment by Wang Shilong (Inactive) [ 06/Jun/19 ] |
|
Following simple ext4 patch shall fix the problem: diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 1cb67859e051..ceb74093e138 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -421,7 +421,8 @@ struct flex_groups {
EXT4_PROJINHERIT_FL | EXT4_CASEFOLD_FL)
/* Flags that are appropriate for regular files (all but dir-specific ones). */
-#define EXT4_REG_FLMASK (~(EXT4_DIRSYNC_FL | EXT4_TOPDIR_FL | EXT4_CASEFOLD_FL))
+#define EXT4_REG_FLMASK (~(EXT4_DIRSYNC_FL | EXT4_TOPDIR_FL | EXT4_CASEFOLD_FL |\
+ EXT4_PROJINHERIT_FL))
/* Flags that are appropriate for non-directories/regular files. */
#define EXT4_OTHER_FLMASK (EXT4_NODUMP_FL | EXT4_NOATIME_FL)
|
| Comment by Wang Shilong (Inactive) [ 06/Jun/19 ] |
|
FYI, I sent two Linux upstream patches to fix ext4 and f2fs: http://patchwork.ozlabs.org/patch/1110877/ |
| Comment by Andreas Dilger [ 06/Jun/19 ] |
|
Please also submit an ldiskfs patch for this, I have also reviewed the ext4 patch on the list. |
| Comment by Wang Shilong (Inactive) [ 11/Jun/19 ] |
|
Andreas, Since there won't be obvious errors with |
| Comment by Andreas Dilger [ 11/Jun/19 ] |
|
I think it makes sense to include ldiskfs-side patches, so that we get fewer "corrupt" inodes on a filesystem, and hopefully they can mostly be aged out of the filesystem after the ldsiskfs patch has been around for some time. We will also want a patch for e2fsck to detect and repair these errors on non-directory inodes without complaining too much. |
| Comment by Gerrit Updater [ 16/Jun/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35076/ |
| Comment by Peter Jones [ 16/Jun/19 ] |
|
Landed for 2.13 |
| Comment by Li Xi [ 17/Jun/19 ] |
|
Should we create another ticket to track the ldiskfs patch? |
| Comment by Peter Jones [ 17/Jun/19 ] |
|
We can reopen this one if it seems likely to complete this work during the 2.13 cycle. If that is in doubt then, sure, let's have a new ticket linked to this one |
| Comment by Gerrit Updater [ 01/Jul/19 ] |
|
Wang Shilong (wshilong@ddn.com) uploaded a new patch: https://review.whamcloud.com/35393 |
| Comment by Gerrit Updater [ 12/Jul/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35393/ |