Whamcloud - gitweb
LU-7268 scrub: NOT assign LMA for EA inode
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_compat.c
index ec004e4..0779f25 100644 (file)
@@ -563,6 +563,13 @@ static int osd_obj_update_entry(struct osd_thread_info *info,
                GOTO(out, rc);
        }
 
+       /* The EA inode should NOT be in OI, old OI scrub may added
+        * such OI mapping by wrong, replace it. */
+       if (unlikely(osd_is_ea_inode(inode))) {
+               iput(inode);
+               goto update;
+       }
+
        rc = osd_get_lma(info, inode, dentry, lma);
        if (rc == -ENODATA) {
                rc = osd_get_idif(info, inode, dentry, oi_fid);
@@ -705,10 +712,11 @@ static int osd_obj_add_entry(struct osd_thread_info *info,
 
        inode = info->oti_inode;
        if (unlikely(inode == NULL)) {
-               OBD_ALLOC_PTR(inode);
-               if (inode == NULL)
+               struct ldiskfs_inode_info *lii;
+               OBD_ALLOC_PTR(lii);
+               if (lii == NULL)
                        RETURN(-ENOMEM);
-               info->oti_inode = inode;
+               inode = info->oti_inode = &lii->vfs_inode;
        }
 
        inode->i_sb = osd_sb(osd);