Whamcloud - gitweb
LU-1675: fix fid for ll_get_parent
authorAlexander.Boyko <alexander_boyko@xyratex.com>
Thu, 26 Jul 2012 06:16:51 +0000 (10:16 +0400)
committerJohann Lombardi <johann@whamcloud.com>
Thu, 13 Sep 2012 08:38:52 +0000 (04:38 -0400)
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 <alexander_boyko@xyratex.com>
Xyratex-bug-id: MRP-522
Change-Id: Ib1a79e36ead478ebb874e7e04761bc43f33a410f
Reviewed-on: http://review.whamcloud.com/3475
Tested-by: Hudson
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Cory Spitz <spitzcor@cray.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
lustre/llite/llite_nfs.c

index 976cc15..a85d281 100644 (file)
@@ -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))