Whamcloud - gitweb
LU-17925 utils: fix 'lfs setstripe -c -1' interop 48/55548/11
authorRajeev Mishra <rajeevm@hpe.com>
Thu, 27 Jun 2024 03:37:18 +0000 (03:37 +0000)
committerOleg Drokin <green@whamcloud.com>
Wed, 31 Jul 2024 16:07:18 +0000 (16:07 +0000)
commit73fd18caa6f7951e88aedd17cd87689f74921a73
treeff689eea2c9184d0d384c3b5365d76fb61dae6ea
parent020e361cfdbad529e31525052e660268d7bd976d
LU-17925 utils: fix 'lfs setstripe -c -1' interop

This issue was caused by the -C option was storing -1 as 0xffdf
and -33 was stored as 0xffff, which changed the on-disk file layout
compared to all older versions storing -1 as 0xffff. This resulted
in interop failure of 'lfs setstripe -c/-C' usage.

Instead, store stripe_count as -1 = 0xffff, and -32 = 0xffe0, like
normal unsigned short.  There is no need to distinguish "-c -1"
from "-C -1" in the layout since they both mean the same thing, to
allocate one object per OST.  However, don't allow "-c -2..-32"
since this has no meaning today.  Keep these in reserve in case we
assign some meaning to them in the future.

Restore LLAPI_LAYOUT_WIDE and LOV_ALL_STRIPES definitions, since
these are part of the API and may be used by userspace applications.

Rename LOV_ALL_STRIPES_MIN to LOV_ALL_STRIPES_WIDE since it was
confusing that the "MIN" value created files with the most stripes.

Rename LOV_V1_INSANE_STRIPE_COUNT to LOV_V1_INSANE_STRIPE_INDEX
since it is really the maximum OST index and not a stripe count.

Test-Parameters: testlist=sanity-flr serverversion=2.15 env=SANITY_FLR_EXCEPT="0k 44e 205"
Fixes: 1a6ef725c285 ("LU-16938 utils: setstripe overstripe multiple OST count")
Signed-off-by: Rajeev Mishra <rajeevm@hpe.com>
Change-Id: I3908bd5a70aa35305ef8f278fb0346319055e5b3
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55548
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
15 files changed:
lustre/include/lu_object.h
lustre/include/lustre/lustreapi.h
lustre/include/uapi/linux/lustre/lustre_idl.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/lov/lov_ea.c
lustre/lov/lov_pack.c
lustre/tests/llapi_layout_test.c
lustre/tests/sanity-flr.sh
lustre/tests/sanity.sh
lustre/utils/lfs.c
lustre/utils/liblustreapi_layout.c
lustre/utils/lustreapi_internal.h