Whamcloud - gitweb
LU-6368 ldlm: Do not use cbpending for group locks 93/14093/8
authorPatrick Farrell <paf@cray.com>
Mon, 13 Apr 2015 15:36:52 +0000 (10:36 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 28 Apr 2015 05:01:37 +0000 (05:01 +0000)
commit3e6c20afa18a64c5cb949ecf2ed0f49202ba3e15
treedadcca23af29277bfdacd1789a3a5ae700484390
parent59efcfeb109edd2c695ce961fb8c872d9c515116
LU-6368 ldlm: Do not use cbpending for group locks

Currently, the CBPENDING flag is set on group locks when
the osc lock above them is released (osc_cancel_base).

This results in a situation where a new group lock request
on a resource does not match an existing group lock because
LDLM_FL_CBPENDING is set on the existing lock.

So two group locks are granted on the same resource, which
is not valid, since a given client can only have one group
lock on a particular resource.

Since group locks are manually released and not called back
like other LDLM locks, the CBPENDING flag doesn't make
sense.  Since they must be manually released, they also
cannot go in the LDLM LRU cache and must be fully released
immediately once they are no longer in use.

This was previously accomplished by setting CBPENDING when
the corresponding osc lock is released, but as noted above,
this prevents the group lock matching some future lock
requests.

This patch uses the fact that group locks have an l_writers
reference which they keep until they are manually released,
so we remove them when they have no more reader or writer
references, without checking cbpending.

Additionally, this patch adds several sendfile tests,
courtesy of Frank Zago <fzago@cray.com>.

Signed-off-by: Patrick Farrell <paf@cray.com>
Change-Id: I2845750777cbc9849b18999f1b77f791034c50b0
Reviewed-on: http://review.whamcloud.com/14093
Reviewed-by: frank zago <fzago@cray.com>
Tested-by: Jenkins
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ldlm/ldlm_lock.c
lustre/osc/osc_internal.h
lustre/osc/osc_lock.c
lustre/osc/osc_request.c
lustre/tests/Makefile.am
lustre/tests/sanity.sh
lustre/tests/sendfile_grouplock.c [new file with mode: 0644]