Whamcloud - gitweb
LU-17987 ofd: always trust OST last_id 74/55574/4
authorLai Siyao <lai.siyao@whamcloud.com>
Thu, 30 May 2024 08:19:59 +0000 (04:19 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 23 Aug 2024 21:58:28 +0000 (21:58 +0000)
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 <lai.siyao@whamcloud.com>
Change-Id: I838aa0ab15e6adaaa340356e54ab597a43a9fdf4
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55574
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ofd/ofd_dev.c

index 00cd1bb..a1bed17 100644 (file)
@@ -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),