[LU-10030] add native lfs tools support for project quota Created: 25/Sep/17  Updated: 17/Oct/19  Resolved: 04/Jan/18

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.11.0, Lustre 2.12.0, Lustre 2.10.4

Type: New Feature Priority: Minor
Reporter: Wang Shilong (Inactive) Assignee: Wang Shilong (Inactive)
Resolution: Fixed Votes: 0
Labels: patch

Issue Links:
Blocker
is blocking LUDOC-393 update manual to reflect lfs project... Resolved
Related
is related to LU-11154 use proper flags for FS_IOC_{FSSET,F... Resolved
Rank (Obsolete): 9223372036854775807

 Description   

Currently, we are using chattr/lsattr for project quota
interface, this have some problems:

1)Client side need patched e2fsprogs or latest upstream
e2fsprogs.
2)Project quota will be no longer osd-ldiskfs based, ZFS
too, zfs guys might dislike ldiskfs tool dependency for them.
3)customers argue chattr might be a little dangerous.

So we'd better add native lfs tools for project quota.



 Comments   
Comment by Gerrit Updater [ 25/Sep/17 ]

Wang Shilong (wshilong@ddn.com) uploaded a new patch: https://review.whamcloud.com/29190
Subject: LU-10030 utils: add lfs tool to change/list project of file
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: a037f56081d7d1e4d4f263996a4621b1137d0df0

Comment by Peter Jones [ 25/Sep/17 ]

Thanks

Comment by James A Simmons [ 29/Sep/17 ]

Is this a client feature or server?

Comment by Wang Shilong (Inactive) [ 30/Sep/17 ]

This is only Client side.

Comment by Nathan Rutman [ 24/Oct/17 ]

Currently this is kind of a mess - chattr -P depends on special build, sanity-quota silently disables project quota tests without it, the manual doesn't explain that a special chattr is needed. This patch is a good improvement, but it doesn't quite finish - i.e. remove chattr from sanity-quota, link in LUDOC ticket for the manual fixes.

Comment by Wang Shilong (Inactive) [ 24/Oct/17 ]

Hello Nathan Rutman,

Thanks for good suggestion, link has been done, and will remove chattr from sanity-quota when refreshing patch.

Thanks,
Shilong

Comment by Gerrit Updater [ 14/Nov/17 ]

Wang Shilong (wshilong@ddn.com) uploaded a new patch: https://review.whamcloud.com/30072
Subject: LU-10030 llite: extend inode flags into GET/SETXATTR ioctl
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 299b758caaf8c4710249ba9a28a9f84a7b055172

Comment by Gerrit Updater [ 22/Nov/17 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/30072/
Subject: LU-10030 llite: extend inode flags into GET/SETXATTR ioctl
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 311e8d539b1932593462de428c46ea176b8905db

Comment by Gerrit Updater [ 04/Jan/18 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/29190/
Subject: LU-10030 utils: add lfs tool to change/list project of file
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 022c5a9a77d4612dce28b76a7691b7af1cefd058

Comment by Peter Jones [ 04/Jan/18 ]

Looks like this is all landed for 2.11

Comment by Gerrit Updater [ 20/Apr/18 ]

Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/32098
Subject: LU-10030 utils: add lfs tool to change/list project of file
Project: fs/lustre-release
Branch: b2_10
Current Patch Set: 1
Commit: 4c4c6097eeeb9785c6be9892cad823b2c0e077f8

Comment by Gerrit Updater [ 20/Apr/18 ]

Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/32099
Subject: LU-10030 llite: extend inode flags into GET/SETXATTR ioctl
Project: fs/lustre-release
Branch: b2_10
Current Patch Set: 1
Commit: ae23eab7537a11e499d6e3747dfa8e03d2f01c60

Comment by Gerrit Updater [ 20/Apr/18 ]

Andreas Dilger (andreas.dilger@intel.com) uploaded a new patch: https://review.whamcloud.com/32106
Subject: LU-10030 llite: use MDS_ATTR_ATTR_FLAG for ia_valid
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 7a076f2688c6fd30dd420b8829d359d1826835e4

Comment by Gerrit Updater [ 20/Apr/18 ]

Andreas Dilger (andreas.dilger@intel.com) uploaded a new patch: https://review.whamcloud.com/32107
Subject: LU-10030 idl: use proper ATTR/MDS_ATTR/MDS_OPEN flags
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: a7e53750fb1fc117353c859785cd7cf379604968

Comment by Gerrit Updater [ 21/Apr/18 ]

Andreas Dilger (andreas.dilger@intel.com) uploaded a new patch: https://review.whamcloud.com/32112
Subject: LU-10030 hsm: make changelog flag argument __u32
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 920d58535e5dc467a753c8cc1a83fd988337d29b

Comment by Gerrit Updater [ 03/May/18 ]

John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/32099/
Subject: LU-10030 llite: extend inode flags into GET/SETXATTR ioctl
Project: fs/lustre-release
Branch: b2_10
Current Patch Set:
Commit: 9c79f3b17605e090e8d0c31d3f34021959aa05d7

Comment by Gerrit Updater [ 03/May/18 ]

John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/32098/
Subject: LU-10030 utils: add lfs tool to change/list project of file
Project: fs/lustre-release
Branch: b2_10
Current Patch Set:
Commit: d856eedc96e057698a11f063bd7cb3236d191121

Comment by Gerrit Updater [ 17/Jul/18 ]

James Simmons (uja.ornl@yahoo.com) uploaded a new patch: https://review.whamcloud.com/32825
Subject: LU-10030 clio: don't use spare bits in iattr.ia_valid
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: c588aa7cf5d4b02b06993a3a285441cc2765fc3c

Comment by Alexander Mitin [ 18/Jul/18 ]

The wrong constant is used in the implementation of this feature.

File: lustre/utils/lfs_project.c

When process fsx.fsx_xflags bits the following functions use the wrong constant value to check the project inherit flag.

  • project_check_one()
  • project_set_one()
  • project_clear_one()

These functions are using FS_IOC_FSGETXATTR and FS_IOC_FSGETXATTR ioctl calls to get or set fsxattr structure.

Currently, to process fsx_xflags field from the fsxattr structure these functions use the constant LL_PROJINHERIT_FL, which is defined as the following:

#define LL_PROJINHERIT_FL 0x20000000

However, when processing fsx_xflags from the fsxattr structure , the different constant should be used: FS_XFLAG_PROJINHERIT, which is defined in linux/fs.h file as following:

#define FS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */

See the following 

https://github.com/torvalds/linux/blob/master/include/uapi/linux/fs.h#L155

https://github.com/torvalds/linux/blob/master/include/uapi/linux/fs.h#L178

https://unix.stackexchange.com/questions/448637/file-system-inode-flags-difference-between-fs-ioc-getflags-and-fs-ioc-fsgetxatt/448639

 

 

Comment by Wang Shilong (Inactive) [ 18/Jul/18 ]

Hi Alexander Mitin,

thanks for pointing this out, we should fix this.

Thanks,
Shilong

Comment by Wang Shilong (Inactive) [ 18/Jul/18 ]

Hi Alexander Mitin,

I pushed a proposed patch for this problem:
https://review.whamcloud.com/#/c/32828/

Thanks,
Shilong

Comment by Gerrit Updater [ 19/Jul/18 ]

James Simmons (uja.ornl@yahoo.com) uploaded a new patch: https://review.whamcloud.com/32840
Subject: LU-10030 clio: don't use spare bits in iattr.ia_valid
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: dc805c219826e3e729fafb77479052a52dd29b6a

Comment by Gerrit Updater [ 05/Oct/18 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/32825/
Subject: LU-10030 clio: don't use spare bits in iattr.ia_valid
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 3a6bbda28826ec1eda59ecb9f442a31f87bb409c

Comment by Gerrit Updater [ 29/Oct/18 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/32107/
Subject: LU-10030 idl: use proper ATTR/MDS_ATTR/MDS_OPEN flags
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 9c2ffe39bd32f85dab4fbb13855112e57b1dbc5a

Comment by Gerrit Updater [ 30/Oct/18 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33512
Subject: LU-10030 mds: add enums for MDS_OPEN and MDS_ATTR flags
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: a1ccd134fa30acf8c4e86ef8e600fa018c368890

Comment by Gerrit Updater [ 13/Nov/18 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/32112/
Subject: LU-10030 hsm: make changelog flag argument an enum
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 2496089a0017f5b0ff94a7a7994f4c62c8f30d94

Comment by Gerrit Updater [ 17/Oct/19 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36469
Subject: LU-10030 mds: add enums for MDS_OPEN flags
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 7622048ecbd5ceab7fa72951a587769cac941da7

Generated at Sat Feb 10 02:31:25 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.