Whamcloud - gitweb
LU-13577 wbc: reimplement mkdir() by using intent lock 47/38647/32
authorQian Yingjin <qian@ddn.com>
Mon, 18 May 2020 07:18:08 +0000 (15:18 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 30 Apr 2024 06:51:35 +0000 (06:51 +0000)
commit668dfb53de8c3ccb9f17ba93a449eb454cf17899
treee7d2db1d4bcb6c044d00b34a3ee752d4a3277130
parent1ffbec13c0f745d0b9c6b91959b1afa52f99d63b
LU-13577 wbc: reimplement mkdir() by using intent lock

This patch reworks mkdir() by using intent lock.
Instead of reint mkdir implementation without any lock returned,
a ibits lock (current PR LOOKUP|PERM) is granted to the client and
cached on the client-side lock namespaces by the mkdir() intent
lock request.

This is also a basic requirement for the coming WBC feature, i.e,
create a new directory and an EX WBC lock is returned from MDT in
intent lock request, then this root WBC directory can be safely
cached on the client under the protection of the root WBC EX lock.

This patch also adds a tuning parameter "llite.*.intent_mkdir" to
enable or disable mkdir() by using intent lock. It is set with 0
by default to disable intent mkdir().

Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I94e4c2f8262d7ffb27d85b5569070049a47354d7
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/38647
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
17 files changed:
lustre/llite/llite_internal.h
lustre/llite/lproc_llite.c
lustre/llite/namei.c
lustre/lmv/lmv_intent.c
lustre/lmv/lmv_internal.h
lustre/lmv/lmv_obd.c
lustre/mdc/mdc_locks.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_lib.c
lustre/mdt/mdt_recovery.c
lustre/mdt/mdt_reint.c
lustre/tests/replay-single-lmv.sh
lustre/tests/replay-single.sh
lustre/tests/sanity-pcc.sh
lustre/tests/sanity.sh
lustre/tests/sanityn.sh