Commit 23c05e82 authored by Lai Siyao's avatar Lai Siyao Committed by Oleg Drokin
Browse files

LU-13437 mdc: remote object support getattr from cache

For historical reason, IT_GETATTR lock revalidate matches
LOOKUP|UPDATE|PERM lock bits because for MDS < 2.4, permission is
protected by LOOKUP lock, but this will cause remote object not
able to match the cached lock because LOOKUP and UPDATE lock are
fetched separately.

Add sanity 803b, and rename 803 to 803a.

Lustre-change: https://review.whamcloud.com/40218
Lustre-commit: 72a1ca99

Signed-off-by: default avatarLai Siyao <lai.siyao@whamcloud.com>
Change-Id: I3ac38fe34472736849307bb7f1eebb5de9343a5c
Reviewed-by: default avatarAndreas Dilger <adilger@whamcloud.com>
Reviewed-by: default avatarMike Pershin <mpershin@whamcloud.com>
Signed-off-by: default avatarMinh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/40451

Tested-by: default avatarjenkins <devops@whamcloud.com>
Tested-by: default avatarMaloo <maloo@whamcloud.com>
Reviewed-by: default avatarOleg Drokin <green@whamcloud.com>
parent d3dfcba3
......@@ -1143,7 +1143,6 @@ int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
* but for old MDTs (< 2.4), permission is covered
* by LOOKUP lock, so it needs to match all bits here.*/
policy.l_inodebits.bits = MDS_INODELOCK_UPDATE |
MDS_INODELOCK_LOOKUP |
MDS_INODELOCK_PERM;
break;
case IT_READDIR:
......
......@@ -21105,7 +21105,7 @@ test_802() {
}
run_test 802 "simulate readonly device"
 
test_803() {
test_803a() {
[[ $MDSCOUNT -lt 2 ]] && skip_env "needs >= 2 MDTs"
[ $MDS1_VERSION -lt $(version_code 2.10.54) ] &&
skip "MDS needs to be newer than 2.10.54"
......@@ -21153,7 +21153,39 @@ test_803() {
[ $after_used -le $((before_used + 1)) ] ||
error "after ($after_used) > before ($before_used) + 1"
}
run_test 803 "verify agent object for remote object"
run_test 803a "verify agent object for remote object"
test_803b() {
[[ $MDSCOUNT -lt 2 ]] && skip_env "needs >= 2 MDTs"
[ $MDS1_VERSION -lt $(version_code 2.13.56) ] &&
skip "MDS needs to be newer than 2.13.56"
[ $PARALLEL == "yes" ] && skip "skip parallel run"
for i in $(seq 0 $((MDSCOUNT - 1))); do
$LFS mkdir -i $i $DIR/$tdir.$i || error "mkdir $tdir.$i"
done
local before=0
local after=0
local tmp
stat $DIR/$tdir.* >/dev/null || error "stat $tdir.*"
for i in $(seq 0 $((MDSCOUNT - 1))); do
tmp=$(do_facet mds$i $LCTL get_param mdt.*-MDT000$i.md_stats |
awk '/getattr/ { print $2 }')
before=$((before + tmp))
done
stat $DIR/$tdir.* >/dev/null || error "stat $tdir.*"
for i in $(seq 0 $((MDSCOUNT - 1))); do
tmp=$(do_facet mds$i $LCTL get_param mdt.*-MDT000$i.md_stats |
awk '/getattr/ { print $2 }')
after=$((after + tmp))
done
[ $before -eq $after ] || error "getattr count $before != $after"
}
run_test 803b "remote object can getattr from cache"
 
test_804() {
[[ $MDSCOUNT -lt 2 ]] && skip_env "needs >= 2 MDTs"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment