From: Jinshan Xiong Date: Sun, 15 Oct 2017 19:19:30 +0000 (-0700) Subject: LU-9785 lov: take lov layout lock for I/O with ignore_layout X-Git-Tag: 2.10.7-RC1~22 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=4d8aa0ed769a233f49a641dab00452a67ef3e6ce;p=fs%2Flustre-release.git LU-9785 lov: take lov layout lock for I/O with ignore_layout A rule of thumb for taking lov layout configuration lock is if I/O is initiated from LLITE layer, it should grab the lock. If an I/O starts from the OSC layer, it won't be necessary because if the OSC object exists, layout reconfiguration will move forward. Right now CIT_MISC + ci_ignore_layout can identify the I/O from the OSC layer, I just use this in lov_io_init() for this purpose. In the future, an explicit bit may be defined for this. Lustre-commit: e43b0e5c0ccbacd8adf30713babd865b5a7c58c7 Lustre-change: https://review.whamcloud.com/29638 Signed-off-by: Jinshan Xiong Change-Id: I2fe37a957b5fb4161c4c723062f6469b915c1dd5 Reviewed-by: Andreas Dilger Reviewed-by: Bobi Jam Reviewed-by: Fan Yong Reviewed-by: Jinshan Xiong Reviewed-on: https://review.whamcloud.com/33965 Reviewed-by: Lai Siyao Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/lov/lov_object.c b/lustre/lov/lov_object.c index e26769c..bae68bb 100644 --- a/lustre/lov/lov_object.c +++ b/lustre/lov/lov_object.c @@ -1062,8 +1062,13 @@ int lov_io_init(const struct lu_env *env, struct cl_object *obj, PFID(lu_object_fid(&obj->co_lu)), io, io->ci_type, io->ci_ignore_layout, io->ci_verify_layout); + /* IO type CIT_MISC with ci_ignore_layout set are usually invoked from + * the OSC layer. It shouldn't take lov layout conf lock in that case, + * because as long as the OSC object exists, the layout can't be + * reconfigured. */ return LOV_2DISPATCH_MAYLOCK(cl2lov(obj), llo_io_init, - !io->ci_ignore_layout, env, obj, io); + !(io->ci_ignore_layout && io->ci_type == CIT_MISC), + env, obj, io); } /**