From 276221c2a1d26a824032eabcaa7e4accda36f5d1 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Mon, 22 Apr 2019 20:31:12 +0300 Subject: [PATCH] LU-10894 dom: mdc_lock_flush() improvement There is small improvement in osc_lock_flush() to don't match other locks for write lock because there are none. Do the same in mdc_lock_flush(). Signed-off-by: Mikhail Pershin Change-Id: Ie18ef63b2f969f762f0263f8b93aea726f89305f Reviewed-on: https://review.whamcloud.com/34738 Tested-by: Jenkins Reviewed-by: Patrick Farrell Tested-by: Maloo Reviewed-by: Andrew Perepechko Reviewed-by: Oleg Drokin --- lustre/mdc/mdc_dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/mdc/mdc_dev.c b/lustre/mdc/mdc_dev.c index a59b1a8..f148f46 100644 --- a/lustre/mdc/mdc_dev.c +++ b/lustre/mdc/mdc_dev.c @@ -261,7 +261,9 @@ static int mdc_lock_flush(const struct lu_env *env, struct osc_object *obj, result = 0; } - rc = mdc_lock_discard_pages(env, obj, start, end, discard); + /* Avoid lock matching with CLM_WRITE, there can be no other locks */ + rc = mdc_lock_discard_pages(env, obj, start, end, + mode == CLM_WRITE || discard); if (result == 0 && rc < 0) result = rc; -- 1.8.3.1