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)
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);
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;
}
* 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;
}
/* 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)) {
/**
* It scans the /lost+found, and for the OST-object (with filter_fid
- * or filter_fid_old), move them back to its proper /O/<seq>/d<x>.
+ * or filter_fid_18_23), move them back to its proper /O/<seq>/d<x>.
*/
#ifdef HAVE_FILLDIR_USE_CTX
static int osd_ios_lf_fill(struct dir_context *buf,
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);
RETURN(rc);
}
-static void osd_scrub_stop(struct osd_device *dev)
+void osd_scrub_stop(struct osd_device *dev)
{
struct lustre_scrub *scrub = &dev->od_scrub.os_scrub;
* 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)