From e8d1cfd5aa4a68d3830455356f50e0e6d8437d92 Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Sun, 19 Nov 2023 19:18:37 -0500 Subject: [PATCH] EX-7601 ofd: round range locking The range locking in OFD needs to be rounded for compressed chunks. Signed-off-by: Patrick Farrell Change-Id: I530d7f655a1c09033b1a3668c009072874ab1d18 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53178 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Artem Blagodarenko --- lustre/ofd/ofd_io.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lustre/ofd/ofd_io.c b/lustre/ofd/ofd_io.c index bb16b64..4e8e5cc 100644 --- a/lustre/ofd/ofd_io.c +++ b/lustre/ofd/ofd_io.c @@ -918,10 +918,10 @@ static int ofd_preprw_write(const struct lu_env *env, struct obd_export *exp, * its bulk descriptor and the RPC will be dropped due to failed bulk * transfer, which is just fine. */ - range_lock_init(range, - rnb[0].rnb_offset, - rnb[obj->ioo_bufcnt - 1].rnb_offset + - rnb[obj->ioo_bufcnt - 1].rnb_len - 1); + /* round range lock for compression */ + if (chunk_size) + chunk_round(&begin, &end, chunk_size); + range_lock_init(range, begin, end - 1); range_lock(&fo->ofo_write_tree, range); ofd_info(env)->fti_range_locked = 1; -- 1.8.3.1