Whamcloud - gitweb
LU-5648 ofd: Reject precreate requests below last_id 68/12068/4
authorOleg Drokin <oleg.drokin@intel.com>
Fri, 26 Sep 2014 02:47:19 +0000 (22:47 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 8 Jan 2015 05:16:34 +0000 (05:16 +0000)
Such requests are a sure sign that MDS idea about precreated
objects for us is invalid. If we don't reject it here, objects
would be potentially doubly used by multiple files.

Change-Id: I633081d3768104009e1d5e9392cdfbb79f2fd221
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/12068
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
lustre/ofd/ofd_dev.c

index 6a7dee0..7d7387a 100644 (file)
@@ -1680,6 +1680,16 @@ static int ofd_create_hdl(struct tgt_session_info *tsi)
                                       ofd_name(ofd), POSTID(&oa->o_oi));
                                GOTO(out, rc = -EINVAL);
                        }
                                       ofd_name(ofd), POSTID(&oa->o_oi));
                                GOTO(out, rc = -EINVAL);
                        }
+
+                       if (diff < 0) {
+                               /* LU-5648 */
+                               CERROR("%s: invalid precreate request for "
+                                      DOSTID", last_id " LPU64 ". "
+                                      "Likely MDS last_id corruption\n",
+                                      ofd_name(ofd), POSTID(&oa->o_oi),
+                                      ofd_seq_last_oid(oseq));
+                               GOTO(out, rc = -EINVAL);
+                       }
                }
        }
        if (diff > 0) {
                }
        }
        if (diff > 0) {