From 3f774e441856542ad7c465597c76afd3a015be61 Mon Sep 17 00:00:00 2001 From: wang di Date: Sun, 2 Feb 2014 18:06:14 -0800 Subject: [PATCH] LU-3186 lmv: do not need allocate FID for open by FID We do not need allocate FID or set op_fid2 if it is for Open by FID, otherwise, it will cause the MDT to open the file with new FID. Signed-off-by: wang di Change-Id: I67e5a52c643228a6d8bd0190ca1a78b047fd1e7a Reviewed-on: http://review.whamcloud.com/6099 Reviewed-by: Fan Yong Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/lmv/lmv_intent.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lustre/lmv/lmv_intent.c b/lustre/lmv/lmv_intent.c index 14f49d3..47722b4 100644 --- a/lustre/lmv/lmv_intent.c +++ b/lustre/lmv/lmv_intent.c @@ -179,7 +179,10 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data, if (IS_ERR(tgt)) RETURN(PTR_ERR(tgt)); - if (it->it_op & IT_CREAT) { + /* If it is ready to open the file by FID, do not need + * allocate FID at all, otherwise it will confuse MDT */ + if ((it->it_op & IT_CREAT) && + !(it->it_flags & MDS_OPEN_BY_FID)) { /* * For open with IT_CREATE and for IT_CREATE cases allocate new * fid and setup FLD for it. -- 1.8.3.1