From 53940ff3eee8dcd48b677b17f8def55454f549e8 Mon Sep 17 00:00:00 2001 From: Lai Siyao Date: Thu, 30 May 2024 04:19:59 -0400 Subject: [PATCH] LU-17987 ofd: always trust OST last_id In normal precreate, the last_id on OST is always trustable because it's maintained in memory, and it should be MDT that messes up the last created FID in reconnect. Even if the gap is more than OST_MAX_PRECREATE, reply the last_id to MDT to avoid leaving OST in unavailable status. Signed-off-by: Lai Siyao Change-Id: I838aa0ab15e6adaaa340356e54ab597a43a9fdf4 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55574 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Mikhail Pershin Reviewed-by: Oleg Drokin --- lustre/ofd/ofd_dev.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index 00cd1bb..a1bed17 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -1588,15 +1588,7 @@ static int ofd_create_hdl(struct tgt_session_info *tsi) if (sync_trans < 0) GOTO(out, rc = sync_trans); - if (diff <= -OST_MAX_PRECREATE) { - /* LU-5648 */ - CERROR("%s: invalid precreate request for " - DOSTID", last_id %llu. " - "Likely MDS last_id corruption\n", - ofd_name(ofd), POSTID(&oa->o_oi), - ofd_seq_last_oid(oseq)); - GOTO(out, rc = -EINVAL); - } else if (diff < 0) { + if (diff < 0) { LCONSOLE(D_INFO, "%s: MDS LAST_ID "DFID" (%llu) is %lld behind OST LAST_ID "DFID" (%llu), trust the OST\n", ofd_name(ofd), PFID(&oa->o_oi.oi_fid), -- 1.8.3.1