From da5773e2b498a4edacc26fbf610d0b7628818d93 Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Thu, 25 Sep 2014 22:15:36 -0400 Subject: [PATCH] LU-5648 ofd: In destroy orphan case always let MDS know last id It appears that if we think MDS asked us to delete too many precreate objects (more than 2 MAX_PRECREATE counts) then we don't do the precreation, but do not let MDS know it needs to advance the last_id forward by quite a bit. This lead to reassigning these objects to other files after recovery. Change-Id: Icbd5b9e3cd81129f56ee5cd3aafd5f418affbecc Signed-off-by: Oleg Drokin Reviewed-on: http://review.whamcloud.com/12067 Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Tested-by: Jenkins Tested-by: Maloo --- lustre/ofd/ofd_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index 5e34ecc..e3ffc17 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -1636,7 +1636,8 @@ static int ofd_create_hdl(struct tgt_session_info *tsi) CDEBUG(D_HA, "ofd_last_id() = "LPU64" -> diff = %d\n", ofd_seq_last_oid(oseq), diff); if (-diff > OST_MAX_PRECREATE) { - /* FIXME: should reset precreate_next_id on MDS */ + /* Let MDS know that we are so far ahead. */ + ostid_set_id(&rep_oa->o_oi, ofd_seq_last_oid(oseq) + 1); rc = 0; } else if (diff < 0) { rc = ofd_orphans_destroy(tsi->tsi_env, exp, -- 1.8.3.1