Whamcloud - gitweb
LU-17628 lfs: add lfs_setstripe admin restrict 41/54341/12
authorPatrick Farrell <paf0187@gmail.com>
Mon, 1 Apr 2024 16:12:00 +0000 (12:12 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 31 Jul 2024 16:02:34 +0000 (16:02 +0000)
commit5b99b881c412993f239bf8e708ae9526ba1bc9e3
tree5c864dccc6399b1ea70886555910c0340a38bb89
parent078f0be08e41fb7760003449cb7bebe6a70bcd0c
LU-17628 lfs: add lfs_setstripe admin restrict

In some settings, it's not desirable for users to be able
to set their own striping.  This is purely a 'convenience'
restriction, where the admin prefers users not set their
own striping to avoid user error, and not a security
restriction.  This is for sites which have a sensible
default striping and prefer users not modify it.

The goal here is to avoid user error.  However, some
applications use the Lustre API to set their own striping,
and it's not desirable for such applications to fail.

So setstripe fails with an error for the 'lfs' binary, and
is silently ignored in other cases.  In all cases, the file
is created with the default layout.

Note we return EACESS for this case rather than EPERM
because EPERM is already returned (via a special case) for
setting layout on the root of the file system.  This is a
distinct case because we do not want the special group
created by this patch to be able to set the root filesystem
layout, so the root of the FS continues to be handled
separately.

Signed-off-by: Patrick Farrell <patrick.farrell@oracle.com>
Change-Id: Id2e8dd175f5e3870f3aa64b69556308706d5317c
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54341
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: wangdi <di.d.wang@oracle.com>
lustre/doc/lfs-migrate.1
lustre/doc/lfs-setstripe.1
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/lproc_llite.c
lustre/tests/sanity.sh
lustre/utils/liblustreapi.c