Whamcloud - gitweb
LU-12025 osp: allow OS_STATE_* flags from OSTs 72/36872/3
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 28 Feb 2019 00:37:08 +0000 (17:37 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 12 Dec 2019 23:05:44 +0000 (23:05 +0000)
commitb0194200146a54ee45df208da88dcc6b916fb51f
tree390038f4e987aa5500a171f7fb9ee668760fc1ab
parent4da97f7d7f26b49207b7c5c24e6306861188a4b7
LU-12025 osp: allow OS_STATE_* flags from OSTs

Allow OS_STATE_* flags to be sent from the OST, so that the
OS_STATE_NOPRECREATE can be used to prevent a newly-added OST
from being used until it is ready.  Add the "no_precreate"
parameter on the OFD that can be set from userspace.

Close a race in the cached opd_statfs.os_state handling in
osp_pre_update_statfs().  It was being overwritten by the
new statfs data from the OST, but was globally visible for a
short time to the precreate threads before the OS_STATE_*
flags were set on the cached statfs data again.

Similarly, there was a race with updating the opd_pre_status
if the OST was out of space, where it would be cleared after
a successful statfs, and wouldn't be set to -ENOSPC until a
short time later.

Split osp_pre_update_status() into osp_pre_update_msfs() that
only copies the statfs data into the cache after all of the
flags are set.  Don't clear flags from the cache, they will
only be cleared when new statfs data is sent.

Add a test that the 'N'OPRECREATE flag appears in "lfs df".

Lustre-change: https://review.whamcloud.com/35029
Lustre-commit: 9b0ebf78f7919a144673edadc4a95bad84fae2d3

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I9c1c7a097f3de8edfdeef2b437f40936e73ebbe5
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/36872
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/ofd/lproc_ofd.c
lustre/ofd/ofd_internal.h
lustre/ofd/ofd_obd.c
lustre/osp/osp_dev.c
lustre/osp/osp_precreate.c
lustre/tests/sanity.sh