Whamcloud - gitweb
LU-13437 llite: pack parent FID in getattr
[fs/lustre-release.git] / lustre / llite / file.c
index f411a71..d158d1a 100644 (file)
@@ -4695,6 +4695,7 @@ static int ll_inode_revalidate_fini(struct inode *inode, int rc)
 
 static int ll_inode_revalidate(struct dentry *dentry, enum ldlm_intent_flags op)
 {
+       struct inode *parent;
        struct inode *inode = dentry->d_inode;
        struct obd_export *exp = ll_i2mdexp(inode);
        struct lookup_intent oit = {
@@ -4708,9 +4709,14 @@ static int ll_inode_revalidate(struct dentry *dentry, enum ldlm_intent_flags op)
        CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p),name=%s\n",
               PFID(ll_inode2fid(inode)), inode, dentry->d_name.name);
 
+       if (exp_connect_flags2(exp) & OBD_CONNECT2_GETATTR_PFID)
+               parent = dentry->d_parent->d_inode;
+       else
+               parent = inode;
+
        /* Call getattr by fid, so do not provide name at all. */
-       op_data = ll_prep_md_op_data(NULL, dentry->d_parent->d_inode, inode,
-                                    NULL, 0, 0, LUSTRE_OPC_ANY, NULL);
+       op_data = ll_prep_md_op_data(NULL, parent, inode, NULL, 0, 0,
+                                    LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data))
                RETURN(PTR_ERR(op_data));