[LU-15856] "lfs setdirstripe -D ... <dir>" should create directory if missing Created: 13/May/22  Updated: 05/Jan/23

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.14.0, Lustre 2.12.4
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Andreas Dilger Assignee: Lai Siyao
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Cloners
Clones LU-13560 'lfs mkdir -i N' should be 'sticky' o... Resolved
Related
is related to LU-13417 DNE3: mkdir() automatically create re... Resolved
is related to LU-10784 DNE3: mkdir() automatically create re... Resolved
is related to LU-5170 lfs usability Open
Rank (Obsolete): 9223372036854775807

 Description   

Currently, "lfs setdirstripe -D <layout> <dir>" will fail if "<dir>" does not already exist. However, from a usability point of view, it would make sense for the "lfs" utility to create the target "<dir>" if it does not yet exist using the specified "<layout>", and then set the same default "<layout>" on the directory for subdirectories created therein. It doesn't make sense to force the user to run the command twice to do this.

In the ideal case, the client could send a single "MDS_REINT" RPC to the MDS with "<layout>", the same as "lfs mkdir <layout> <dir>" and just add a flag that indicates "store the same layout as the default", rather than having to send two separate RPCs. However, for compatibility with older MDS nodes, and to backport this fix to older releases, it makes sense for "lfs_setdirstripe()" to handle this in userspace if the "llapi_dir_set_default_lmv()" command fails with "-ENOENT" by calling "llapi_dir_create()" and then retrying "llapi_dir_set_default_lmv()" once.


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