X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fosd-ldiskfs%2Fosd_scrub.c;h=62322357d386210349c0acaf854ec9c470c97d3a;hp=acc86186670a2286e6d39198f02e5414cf716be1;hb=077570483e75e0610fd45149b926097547c434b8;hpb=54fc9a642d90f102bacd0d79e4b81fd534eb26b5 diff --git a/lustre/osd-ldiskfs/osd_scrub.c b/lustre/osd-ldiskfs/osd_scrub.c index acc8618..6232235 100644 --- a/lustre/osd-ldiskfs/osd_scrub.c +++ b/lustre/osd-ldiskfs/osd_scrub.c @@ -163,13 +163,13 @@ static int osd_scrub_convert_ff(struct osd_thread_info *info, struct osd_device *dev, struct inode *inode, const struct lu_fid *fid) { - struct filter_fid_old *ff = &info->oti_ff; - struct dentry *dentry = &info->oti_obj_dentry; - struct lu_fid *tfid = &info->oti_fid; - handle_t *jh; - int size = 0; - int rc; - bool reset = false; + struct filter_fid_18_23 *ff = &info->oti_ff_old; + struct dentry *dentry = &info->oti_obj_dentry; + struct lu_fid *tfid = &info->oti_fid; + bool fid_18_23 = false; + handle_t *jh; + int size = 0; + int rc; ENTRY; if (dev->od_scrub.os_scrub.os_file.sf_param & SP_DRYRUN) @@ -208,18 +208,18 @@ osd_scrub_convert_ff(struct osd_thread_info *info, struct osd_device *dev, if (rc == sizeof(*ff)) { /* 2) delete the old XATTR_NAME_FID */ ll_vfs_dq_init(inode); - rc = inode->i_op->removexattr(dentry, XATTR_NAME_FID); + rc = osd_removexattr(dentry, inode, XATTR_NAME_FID); if (rc) GOTO(stop, rc); - reset = true; - } else if (rc != -ENODATA && rc != sizeof(struct filter_fid)) { + fid_18_23 = true; + } else if (rc != -ENODATA && rc < (int)sizeof(struct filter_fid_24_29)) { GOTO(stop, rc = -EINVAL); } /* 3) make new LMA and add it */ rc = osd_ea_fid_set(info, inode, tfid, LMAC_FID_ON_OST, 0); - if (reset) { + if (fid_18_23) { if (rc) /* If failed, we should try to add the old back. */ size = sizeof(*ff); @@ -674,7 +674,7 @@ static int osd_scrub_get_fid(struct osd_thread_info *info, rc = osd_get_idif(info, inode, &info->oti_obj_dentry, fid); if (rc == 0) { if (scrub) - /* It is old 2.x (x <= 3) or 1.8 OST-object. */ + /* It is 2.3 or older OST-object. */ rc = SCRUB_NEXT_OSTOBJ_OLD; return rc; } @@ -685,7 +685,7 @@ static int osd_scrub_get_fid(struct osd_thread_info *info, * to generate its FID, ignore it directly. */ rc = SCRUB_NEXT_CONTINUE; else - /* It is 2.4 OST-object. */ + /* It is 2.4 or newer OST-object. */ rc = SCRUB_NEXT_OSTOBJ_OLD; return rc; } @@ -730,9 +730,16 @@ static int osd_iit_iget(struct osd_thread_info *info, struct osd_device *dev, /* Not handle the backend root object and agent parent object. * They are neither visible to namespace nor have OI mappings. */ if (unlikely(pos == osd_sb(dev)->s_root->d_inode->i_ino || - pos == osd_remote_parent_ino(dev))) + is_remote_parent_ino(dev, pos))) RETURN(SCRUB_NEXT_CONTINUE); + /* Skip project quota inode since it is greater than s_first_ino. */ +#ifdef HAVE_PROJECT_QUOTA + if (ldiskfs_has_feature_project(sb) && + pos == le32_to_cpu(LDISKFS_SB(sb)->s_es->s_prj_quota_inum)) + RETURN(SCRUB_NEXT_CONTINUE); +#endif + osd_id_gen(lid, pos, OSD_OII_NOGEN); inode = osd_iget(info, dev, lid); if (IS_ERR(inode)) { @@ -1419,8 +1426,8 @@ static const struct osd_lf_map osd_lf_maps[] = { /* PENDING */ { - .olm_name = "PENDING", - .olm_namelen = sizeof("PENDING") - 1, + .olm_name = MDT_ORPHAN_DIR, + .olm_namelen = sizeof(MDT_ORPHAN_DIR) - 1, }, /* ROOT */ @@ -2007,7 +2014,7 @@ osd_ios_scan_one(struct osd_thread_info *info, struct osd_device *dev, /** * It scans the /lost+found, and for the OST-object (with filter_fid - * or filter_fid_old), move them back to its proper /O//d. + * or filter_fid_18_23), move them back to its proper /O//d. */ #ifdef HAVE_FILLDIR_USE_CTX static int osd_ios_lf_fill(struct dir_context *buf, @@ -2284,7 +2291,11 @@ osd_ios_general_scan(struct osd_thread_info *info, struct osd_device *dev, buf.oifb_items = 0; #ifdef HAVE_DIR_CONTEXT buf.ctx.pos = filp->f_pos; +#ifdef HAVE_ITERATE_SHARED + rc = fops->iterate_shared(filp, &buf.ctx); +#else rc = fops->iterate(filp, &buf.ctx); +#endif filp->f_pos = buf.ctx.pos; #else rc = fops->readdir(filp, &buf, filldir); @@ -2638,7 +2649,7 @@ int osd_scrub_setup(const struct lu_env *env, struct osd_device *dev) * an old device, it can be found and cleared later. * * For the system with "SIF_NO_HANDLE_OLD_FID", we do not - * need to check "filter_fid_old" and to convert it to + * need to check "filter_fid_18_23" and to convert it to * "filter_fid" for each object, and all the IGIF should * have their FID mapping in OI files already. */ if (dev->od_maybe_new && rc == -ENOENT)