From: Oleg Drokin Date: Fri, 26 Sep 2014 02:47:19 +0000 (-0400) Subject: LU-5648 ofd: Reject precreate requests below last_id X-Git-Tag: 2.6.93~75 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=65a17be2d9e1acdec5d9aebaed007d4cb6d0ca11;p=fs%2Flustre-release.git LU-5648 ofd: Reject precreate requests below last_id 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 Reviewed-on: http://review.whamcloud.com/12068 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: wangdi --- diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index 6a7dee0..7d7387a 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -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); } + + 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) {