Whamcloud - gitweb
LU-11670 osc: glimpse - search for active lock 06/36406/4
authorPatrick Farrell <pfarrell@whamcloud.com>
Mon, 9 Sep 2019 15:56:07 +0000 (11:56 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 12 Dec 2019 23:05:15 +0000 (23:05 +0000)
commit2548cb9e32bfca897de577f88836629f72641369
treee5ed5d8a972544fbd1bf326367025fbfebe38b4d
parent810a952303969ca0ee01639a5408ff2f0e3456d9
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.

Lustre-change: https://review.whamcloud.com/33660
Lustre-commit: b3461d11dcb04670cc2e1bfbb99306cfd3f645ef

cray-bug-id: LUS-6747
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I6c60f4133154a3d6652315f155af24bbc5752dd2
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/36406
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.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