Whamcloud - gitweb
LU-12998 mds: add no_create parameter to stop creates
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 23 Apr 2022 00:10:36 +0000 (18:10 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 29 Dec 2023 11:12:43 +0000 (11:12 +0000)
commitb2be94f559c7639e93ad9ee02d3a2a0cdafa0172
treeabc6d264fe4745271b1a5ec4781808411dc0ffc1
parent046936e828404d434f6dee4b507c34633505d8f1
LU-12998 mds: add no_create parameter to stop creates

Add an target tunable parameter and mount option "no_create" to
disable new *directory* creation on an MDT.  This sends the
flag OS_STATFS_NOCREATE to the clients, and the DNE MDT space
balance will avoid selecting that MDT when creating a new
subdirectory, without disabling access to existing files/dirs.

This allows "soft disabling" an MDT in advance of storage
upgrades to minimize new directories and files created on that
MDT, reduce future migration, and/or backup/restore workload.

As yet it does not totally disable *file* creation on the MDT,
but it may be extended to do so in the future.

This is analogous to the "no_precreate" option that was added
on the OSTs, and "no_create" has been added to the OSTs for
consistency ("no_precreate" is kept for compatibility for now).

lod_declare_create() checks whether directory create target MDT is
current MDT, this may happen if nocreate is set on some MDT. Upon
such mismatch, call dt_statfs() to fetch latest statfs to know
whether nocreate is set.

lmv_create() will choose another MDT if target MDT is set with
nocreate, but in case the flag is cleared, call obd_statfs() to fetch
cached statfs and check again.

Lustre-change: https://review.whamcloud.com/47124
Lustre-commit: 1dbcd0bab881fac38d8a5e4ef1559f12618f8f0e
Lustre-change: https://review.whamcloud.com/53437
Lustre-commit: 066262a04cb8e0cbf49a20b7bf036d4484399afe (TBD)

Test-Parameters: testlist=conf-sanity env=ONLY=112b,ONLY_REPEAT=50
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: I53cfb48ade2f844b18bfc630e7fcea6de9ce7057
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53189
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
23 files changed:
contrib/scripts/spelling.txt
lustre/include/lu_target.h
lustre/include/lustre_disk.h
lustre/include/obd.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/lmv/lmv_obd.c
lustre/lod/lod_object.c
lustre/lod/lod_qos.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_lproc.c
lustre/obdclass/lu_tgt_descs.c
lustre/obdclass/obd_mount.c
lustre/ofd/lproc_ofd.c
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_internal.h
lustre/ofd/ofd_obd.c
lustre/osp/osp_precreate.c
lustre/ptlrpc/wiretest.c
lustre/tests/conf-sanity.sh
lustre/tests/test-framework.sh
lustre/utils/lfs.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c