Whamcloud - gitweb
LU-12025 osp: allow OS_STATE_* flags from OSTs 29/35029/8
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 28 Feb 2019 00:37:08 +0000 (17:37 -0700)
committerOleg Drokin <green@whamcloud.com>
Tue, 22 Oct 2019 23:57:26 +0000 (23:57 +0000)
commit9b0ebf78f7919a144673edadc4a95bad84fae2d3
tree09b401271d206b9f19d6dd77d1f8f3909a0257aa
parent6e73b5705c6f1cda391b3a9cec8825eb9f914d38
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".

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I9c1c7a097f3de8edfdeef2b437f40936e73ebbe5
Reviewed-on: https://review.whamcloud.com/35029
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@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