From: Alexander.Boyko Date: Thu, 26 Jul 2012 06:16:51 +0000 (+0400) Subject: LU-1675: fix fid for ll_get_parent X-Git-Tag: v1_8_8_60_WC1~2 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=90616957a9fdf1d9cc22c0899fe7faa4829afac1;p=fs%2Flustre-release.git LU-1675: fix fid for ll_get_parent When nfs reexport occured between 1.8 client and 2.0 server, nfs client do mkdir a, cd a, and get -521 error, ll_get_parent() fail with -22 error, and mds print "mdt_body_unpack()) Invalid fid: [0x2010e0901000001:0x0:0x4000]". This patch fix fid translation for the ptlrpc request/reply. Signed-off-by: Alexander Boyko Xyratex-bug-id: MRP-522 Change-Id: Ib1a79e36ead478ebb874e7e04761bc43f33a410f Reviewed-on: http://review.whamcloud.com/3475 Tested-by: Hudson Reviewed-by: Fan Yong Reviewed-by: Cory Spitz Tested-by: Maloo Reviewed-by: Johann Lombardi --- diff --git a/lustre/llite/llite_nfs.c b/lustre/llite/llite_nfs.c index 976cc15..a85d281 100644 --- a/lustre/llite/llite_nfs.c +++ b/lustre/llite/llite_nfs.c @@ -266,9 +266,7 @@ struct dentry *ll_get_parent(struct dentry *dchild) sbi = ll_s2sbi(dir->i_sb); - fid.id = (__u64)dir->i_ino; - fid.generation = dir->i_generation; - fid.f_type = S_IFDIR; + ll_inode2fid(&fid, dir); rc = mdc_getattr_name(sbi->ll_mdc_exp, &fid, dotdot, strlen(dotdot) + 1, 0, 0, &req); @@ -278,9 +276,9 @@ struct dentry *ll_get_parent(struct dentry *dchild) } body = lustre_msg_buf(req->rq_repmsg, REPLY_REC_OFF, sizeof (*body)); - LASSERT((body->valid & OBD_MD_FLGENER) && (body->valid & OBD_MD_FLID)); - fid.id = body->ino; - fid.generation = body->generation; + LASSERT(body->valid & OBD_MD_FLID); + + fid = body->fid1; result = ll_iget_for_nfs(dir->i_sb, &fid); if (IS_ERR(result))