[LU-16760] "lfs find" support for fscrypt and other file attributes Created: 21/Apr/23  Updated: 28/Aug/23  Resolved: 24/Aug/23

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.15.2
Fix Version/s: Lustre 2.16.0

Type: Improvement Priority: Minor
Reporter: Andreas Dilger Assignee: Sebastien Buisson
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-15837 "lfs find -printf" improvements Open
is related to LU-15743 "lfs find" is missing "-xattr" support Open
is related to LU-575 lfs find fixes Resolved
Rank (Obsolete): 9223372036854775807

 Description   

Add support to "lfs find" to detect fscrypt files.

It is not really clear that this fits into any of the existing search types, so a reasonable solution would be to add a new option like "[!] --attrs=[^]ATTR[,...]" argument that fetches the file attribute flags (FS_ENCRYPT_FL, FS_IMMUTABLE_FL, ...) that are already returned by statx() and then add logic to include/exclude files or directories with(out) those those attributes.



 Comments   
Comment by Andreas Dilger [ 21/Apr/23 ]

It would also be useful to be able to print the file attribute flags with "-printf %La" or similar, and they would print a comma-separated list of named attribute flags, and hex value of any unknown attributes.

Comment by Andreas Dilger [ 21/Apr/23 ]

I've also filed https://savannah.gnu.org/bugs/?64088 "find should support file attribute flags (immutable, append-only, fscrypt, etc.)" for upstream find, so that we might use the same option names, but I don't have high hopes on it getting implemented any time soon.

Comment by Gerrit Updater [ 04/Jul/23 ]

"Sebastien Buisson <sbuisson@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51562
Subject: LU-16760 utils: support 'lfs find --attrs' and '-printf %La'
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: e293c9bbae71d39b07d87eceab77394eed431765

Comment by Gerrit Updater [ 24/Aug/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51562/
Subject: LU-16760 utils: support 'lfs find --attrs' and '-printf %La'
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: f0ab3ac6d6e31472c20ef538b799b96a512087f7

Comment by Peter Jones [ 24/Aug/23 ]

Landed for 2.16

Generated at Sat Feb 10 03:29:46 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.