From 8ed71bef3de010210ccada3127c701dc3cb70dac Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Wed, 24 Jan 2024 11:02:32 -0500 Subject: [PATCH] EX-8996 ofd: handle 'missing object' reads When the read code (eg, mdt_preprw_read) finds there is no object, it will return a read with 0 pages, but not fail the read. The assert for local and remote pages needs to recognize this case. Signed-off-by: Patrick Farrell Change-Id: Idc6ff70f71abc100f750a63eca73a754a56f6435 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53807 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Mikhail Pershin Reviewed-by: Andreas Dilger --- lustre/target/tgt_handler.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index 959ba58..4b70cce 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -2579,9 +2579,12 @@ int tgt_brw_read(struct tgt_session_info *tsi) /* if there's no compression, the local page count should be identical * to that requested by the client + * + * Note on 'empty' reads, where the object is not found, we return 0 + * pages without failing the read, so we check for that case */ LASSERT(ergo(compr_type == LL_COMPR_TYPE_NONE, - npages_local == npages_remote)); + (npages_local == 0) || (npages_local == npages_remote))); if (body->oa.o_valid & OBD_MD_FLFLAGS && body->oa.o_flags & OBD_FL_SHORT_IO) { -- 1.8.3.1