From 2d4030566018f400c3f5828f842c6a02d6d3d8e2 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Thu, 2 Sep 2021 21:24:04 +0300 Subject: [PATCH] LU-14980 mdd: unlock object before changelog we can't hold the object (osd) lock over transaction start due to the locking rules. and we don't need the object to be locked as only the fid is used at that point. Signed-off-by: Alex Zhuravlev Change-Id: Iaeb4645bfc9271d21d3644398c4c83f8e9b7aa04 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/44828 Reviewed-by: Oleg Drokin Reviewed-by: Mikhail Pershin Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- lustre/mdd/mdd_object.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lustre/mdd/mdd_object.c b/lustre/mdd/mdd_object.c index 24d9291..982c300 100644 --- a/lustre/mdd/mdd_object.c +++ b/lustre/mdd/mdd_object.c @@ -3362,12 +3362,18 @@ find: } } + /* we can't hold object lock over transaction start + * and we don't actually need the object to be locked */ + mdd_write_unlock(env, mdd_obj); + /* FYI, only the bottom 32 bits of open_flags are recorded */ mdd_changelog(env, type, open_flags, md_dev, mdd_object_fid(mdd_obj)); - EXIT; + GOTO(unlocked, rc); + out: mdd_write_unlock(env, mdd_obj); +unlocked: return rc; } -- 1.8.3.1