Whamcloud - gitweb
LU-12681 osc: wrong cache of LVB attrs 39/40739/2
authorVitaly Fertman <c17818@cray.com>
Mon, 16 Sep 2019 13:46:40 +0000 (16:46 +0300)
committerOleg Drokin <green@whamcloud.com>
Thu, 4 Mar 2021 08:34:20 +0000 (08:34 +0000)
commitd9329ccb757f06f0ff9df2a2c1b627bb29015c81
treee50eddc06d468029bf4cca4afc77272fdbc85d95
parent63b0c8f28dbd8513774219b8802370a638668811
LU-12681 osc: wrong cache of LVB attrs

osc object keeps the cache of LVB, obtained on lock enqueue, in
lov_oinfo. This cache gets all the modifications happenning on
the client, whereas the original LVB in locks does not get them.
At the same time, this cache is lost on object destroy, which
may appear on layout change in particular.

ldlm locks are left in LRU and could be matched on next operations.
First enqueue does not match a lock in LRU due to @kms_ignore in
enqueue_base, however if the lock will be obtained on a small offset
with some locks existent in LRU on larger offsets, the obtained size
will be cut by the policy region when set to KMS.

2nd enqueue can already match and add stale data to oinfo. Thus the
OSC cache is left with a small KMS. However the logic of preparing
a partial page code checks the KMS to decide if to read a page and
as it is small,the page is not read and therefore the non-read part
of the page is zeroed.

The object destroy detaches dlm locks from osc object, offload the
current osc oinfo cache to all the locks, so that it could be
reconstructed for the next osc oinfo. Introduce per-lock flag to
control the cached attribute status and drop re-enqueue after osc
object replacement.

This patch also fixes the handling of KMS_IGNORE added in LU-11964.
It is used only for skip the self lock in a search there is no other
logic for it and it is not needed for DOM locks at all - all the
relevant semantics is supposed to be accomplished by cbpending flag.

Lustre-change: https://review.whamcloud.com/36199
Lustre-commit: 8ac020df4592fc6e85edd75d54cb3795a4e50f8e

Change-Id: Iba45bb3e5ee181c82c2f22deb299228b1519cddb
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/40739
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_dlm_flags.h
lustre/llite/namei.c
lustre/mdc/mdc_dev.c
lustre/osc/osc_internal.h
lustre/osc/osc_lock.c
lustre/osc/osc_object.c
lustre/osc/osc_request.c