Whamcloud - gitweb
LU-11670 osc: glimpse - search for active lock 60/33660/31
authorPatrick Farrell <pfarrell@whamcloud.com>
Mon, 9 Sep 2019 15:56:07 +0000 (11:56 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 20 Sep 2019 07:50:58 +0000 (07:50 +0000)
commitb3461d11dcb04670cc2e1bfbb99306cfd3f645ef
tree01323dde41d6531ce11760fb5172fad394ef3ac0
parent6e0d0146276353559c821916e193c90d167b14e0
LU-11670 osc: glimpse - search for active lock

When there are lock-ahead write locks on a file, the server
sends one glimpse AST RPC to each client having such (it
may have many) locks. This callback is sent to the lock
having the highest offset.

Client's glimpse callback goes up to the clio layers and
gets the global (not lock-specific) view of size.  The clio
layers are connected to the extent lock through the
l_ast_data (which points to the OSC object).

Speculative locks (AGL, lockahead) do not have l_ast_data
initialised until an IO happens under the lock. Thus, some
speculative locks may not have l_ast_data initialized.

It is possible for the client to do a write using one lock
(changing file size), but for the glimpse AST to be sent to
another lock without l_ast_data initialized.  Currently, a
lock with no l_ast_data set returns ELDLM_NO_LOCK_DATA to
the server.  In this case, this means we do not return the
updated size.

The solution is to search the granted lock tree for any lock
with initialized l_ast_data (it points to the OSC object
which is the same for all the extent locks) and to reach the
clio layers for the size through this lock instead.

cray-bug-id: LUS-6747
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I6c60f4133154a3d6652315f155af24bbc5752dd2
Reviewed-on: https://review.whamcloud.com/33660
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_dlm.h
lustre/include/obd_support.h
lustre/ldlm/ldlm_lock.c
lustre/osc/osc_lock.c
lustre/target/tgt_handler.c
lustre/tests/lockahead_test.c
lustre/tests/sanity.sh
lustre/tests/sanityn.sh