Whamcloud - gitweb
LU-18748 class: print statfs_state for OBD devices 59/58259/21
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 27 Feb 2025 02:36:01 +0000 (19:36 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 26 Mar 2025 04:00:56 +0000 (04:00 +0000)
commit0523ed8625ec33398056601ddff67fdc15279fb7
tree8ae792859f7fa802d8b8b71f9fba2a590b13c927
parent67d4234e5180c2a12371f2072d032f1323936ce1
LU-18748 class: print statfs_state for OBD devices

In addition to the regular os_filesfree, os_kbytesfree, etc.
parameters available for each OBD device, add os_state as
a "statfs_state" parameter that contain a single character
fir each of the OS_STATE_* flags that indicate an uncommon
aspec of the target, so that it can be checked.

This allows checking if an OST is read-only ('R' character),
out of blocks ('B'), or inodes ('I'), degraded ('D'),
or is flash-based (non-rotational) storage decoce ('f').

Remove old procfs wrappers for printing statfs data, since
they are no longer used in any parts of the code.

Modify sanity test_56c() to verify that the new statfs_state
is matching the state printed by "lfs df -v".  Allow this
subtest to be run on flash devices that already have 'f' set.
Remove hard-coded waits. Clean up properly in case of errors.

Fix up the code style of sanity test_79 to match current rules.

Allow restore_lustre_params() to accept a filename argument, and
remove it after restore, rather than needing this in all callers.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I0462acdb7b9b7ec76792c9ff50206af2ae2540e5
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58259
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Artem Blagodarenko <ablagodarenko@ddn.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/include/dt_object.h
lustre/include/lprocfs_status.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/llite/lproc_llite.c
lustre/obdclass/dt_object.c
lustre/obdclass/lprocfs_status.c
lustre/tests/sanity.sh
lustre/utils/lfs.c