Whamcloud - gitweb
LU-7268 scrub: NOT assign LMA for EA inode 43/17043/3
authorFan Yong <fan.yong@intel.com>
Thu, 17 Sep 2015 16:40:03 +0000 (00:40 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 9 Dec 2015 02:25:52 +0000 (02:25 +0000)
Originally, when OI scrub scans the device, if the target inode has
no FID-in-LMA EA, then it will generate an IGIF mode FID and store
it in the LMA EA. Such behavior is not suitable if the target inode
is used for large EA. The OI scrub should skip the EA inode that is
marked as "LDISKFS_EA_INODE_FL".

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I52b05b864ef8a2797a2f3dda0f80f95227809c34
Reviewed-on: http://review.whamcloud.com/17043
Tested-by: Jenkins
Reviewed-by: Kalpak Shah <kalpak.shah@seagate.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/osd-ldiskfs/osd_compat.c
lustre/osd-ldiskfs/osd_internal.h
lustre/osd-ldiskfs/osd_oi.c
lustre/osd-ldiskfs/osd_scrub.c

index 637b1bd..0779f25 100644 (file)
@@ -563,6 +563,13 @@ static int osd_obj_update_entry(struct osd_thread_info *info,
                GOTO(out, rc);
        }
 
                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);
        rc = osd_get_lma(info, inode, dentry, lma);
        if (rc == -ENODATA) {
                rc = osd_get_idif(info, inode, dentry, oi_fid);
index 7ad0c24..b47f653 100644 (file)
@@ -913,6 +913,11 @@ static inline char *osd_name(struct osd_device *osd)
        return osd->od_dt_dev.dd_lu_dev.ld_obd->obd_name;
 }
 
        return osd->od_dt_dev.dd_lu_dev.ld_obd->obd_name;
 }
 
+static inline bool osd_is_ea_inode(struct inode *inode)
+{
+       return !!(LDISKFS_I(inode)->i_flags & LDISKFS_EA_INODE_FL);
+}
+
 extern const struct dt_body_operations osd_body_ops;
 extern struct lu_context_key osd_key;
 
 extern const struct dt_body_operations osd_body_ops;
 extern struct lu_context_key osd_key;
 
index c377368..6f15760 100644 (file)
@@ -658,6 +658,13 @@ int osd_oi_insert(struct osd_thread_info *info, struct osd_device *osd,
                        return rc;
                }
 
                        return 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, &info->oti_obj_dentry, lma);
                iput(inode);
                if (rc == -ENODATA)
                rc = osd_get_lma(info, inode, &info->oti_obj_dentry, lma);
                iput(inode);
                if (rc == -ENODATA)
index 31b879b..ff639e2 100644 (file)
@@ -497,6 +497,10 @@ osd_scrub_check_update(struct osd_thread_info *info, struct osd_device *dev,
                        GOTO(out, rc);
                }
 
                        GOTO(out, rc);
                }
 
+               /* The inode has been reused as EA inode, ignore it. */
+               if (unlikely(osd_is_ea_inode(inode)))
+                       GOTO(out, rc = 0);
+
                sf->sf_flags |= SF_UPGRADE;
                sf->sf_internal_flags &= ~SIF_NO_HANDLE_OLD_FID;
                dev->od_check_ff = 1;
                sf->sf_flags |= SF_UPGRADE;
                sf->sf_internal_flags &= ~SIF_NO_HANDLE_OLD_FID;
                dev->od_check_ff = 1;
@@ -536,6 +540,10 @@ iget:
                                        rc = 0;
                                GOTO(out, rc);
                        }
                                        rc = 0;
                                GOTO(out, rc);
                        }
+
+                       /* The inode has been reused as EA inode, ignore it. */
+                       if (unlikely(osd_is_ea_inode(inode)))
+                               GOTO(out, rc = 0);
                }
 
                if (!scrub->os_partial_scan)
                }
 
                if (!scrub->os_partial_scan)
@@ -958,6 +966,10 @@ static int osd_iit_iget(struct osd_thread_info *info, struct osd_device *dev,
                RETURN(rc);
        }
 
                RETURN(rc);
        }
 
+       /* It is an EA inode, no OI mapping for it, skip it. */
+       if (osd_is_ea_inode(inode))
+               GOTO(put, rc = SCRUB_NEXT_CONTINUE);
+
        if (scrub &&
            ldiskfs_test_inode_state(inode, LDISKFS_STATE_LUSTRE_NOSCRUB)) {
                /* Only skip it for the first OI scrub accessing. */
        if (scrub &&
            ldiskfs_test_inode_state(inode, LDISKFS_STATE_LUSTRE_NOSCRUB)) {
                /* Only skip it for the first OI scrub accessing. */