Whamcloud - gitweb
LU-9964 llite: prevent mulitple group locks 91/35791/5
authorAlexander Boyko <c17825@cray.com>
Wed, 14 Aug 2019 09:06:14 +0000 (05:06 -0400)
committerOleg Drokin <green@whamcloud.com>
Sat, 7 Sep 2019 02:07:45 +0000 (02:07 +0000)
commitaba68250a67a10104c534bd726f67b31a7f35692
treeaa03138027424cb1462410fd82fc248eb8a64805
parentfe0e096567ba148d5690316d2bad2226c0cf70bf
LU-9964 llite: prevent mulitple group locks

The patch adds mutex for group lock enqueue. It also adds waiting
of group lock users on a client side for a same node. This prevents
mulitple locks on the same resource and fixes a bugs when two locks
cover the same dirty pages.

The patch adds test sanity 244b. It creates threads which
opens file, takes group lock, writes data, puts group lock, closes.
It recreates the problem when a client has two or more group locks
for a single file. This leads to a wrong behaviour for a flush etc.
osc_cache_writeback_range()) ASSERTION( hp == 0 && discard == 0 )
failed
One more test for group lock with open file and fork. It checks that
childs doesn't unlock file until the last close.

Cray-bug-id: LUS-7232
Signed-off-by: Alexander Boyko <c17825@cray.com>
Change-Id: Iaf65cf26219211b76daaa1a91eeb80092c328f2d
Reviewed-on: https://review.whamcloud.com/35791
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Andriy Skulysh <c17819@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ldlm/ldlm_request.c
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/osc/osc_lock.c
lustre/tests/group_lock_test.c
lustre/tests/sanity.sh