Whamcloud - gitweb
LU-1816 scrub: OI scrub skips new created objects for once
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_handler.c
index eced8db..db890c7 100644 (file)
@@ -90,6 +90,7 @@ static const char remote_obj_dir[] = "REM_OBJ_DIR";
 static const struct lu_object_operations      osd_lu_obj_ops;
 static const struct dt_object_operations      osd_obj_ops;
 static const struct dt_object_operations      osd_obj_ea_ops;
+static const struct dt_object_operations      osd_obj_otable_it_ops;
 static const struct dt_index_operations       osd_index_iam_ops;
 static const struct dt_index_operations       osd_index_ea_ops;
 
@@ -105,11 +106,17 @@ static int osd_object_invariant(const struct lu_object *l)
 
 #ifdef HAVE_QUOTA_SUPPORT
 static inline void
-osd_push_ctxt(const struct lu_env *env, struct osd_ctxt *save)
+osd_push_ctxt(const struct lu_env *env, struct osd_ctxt *save, bool is_md)
 {
-        struct md_ucred *uc = md_ucred(env);
+       struct md_ucred *uc;
         struct cred     *tc;
 
+       if (!is_md)
+               /* OFD support */
+               return;
+
+       uc = md_ucred(env);
+
         LASSERT(uc != NULL);
 
         save->oc_uid = current_fsuid();
@@ -125,10 +132,14 @@ osd_push_ctxt(const struct lu_env *env, struct osd_ctxt *save)
 }
 
 static inline void
-osd_pop_ctxt(struct osd_ctxt *save)
+osd_pop_ctxt(struct osd_ctxt *save, bool is_md)
 {
         struct cred *tc;
 
+       if (!is_md)
+               /* OFD support */
+               return;
+
         if ((tc = prepare_creds())) {
                 tc->fsuid         = save->oc_uid;
                 tc->fsgid         = save->oc_gid;
@@ -300,8 +311,8 @@ struct inode *osd_iget(struct osd_thread_info *info, struct osd_device *dev,
                iput(inode);
                inode = ERR_PTR(-ESTALE);
        } else if (is_bad_inode(inode)) {
-               CWARN("%s: bad inode: ino = %u\n",
-               dev->od_dt_dev.dd_lu_dev.ld_obd->obd_name, id->oii_ino);
+               CWARN("%.16s: bad inode: ino = %u\n",
+               LDISKFS_SB(osd_sb(dev))->s_es->s_volume_name, id->oii_ino);
                iput(inode);
                inode = ERR_PTR(-ENOENT);
        } else {
@@ -386,7 +397,7 @@ static int osd_fid_lookup(const struct lu_env *env, struct osd_object *obj,
        struct inode           *inode;
        struct osd_scrub       *scrub;
        struct scrub_file      *sf;
-       int                     result;
+       int                     result;
        int                     verify = 0;
        ENTRY;
 
@@ -420,23 +431,18 @@ static int osd_fid_lookup(const struct lu_env *env, struct osd_object *obj,
                        verify = 1;
        }
 
-       fid_zero(&oic->oic_fid);
+       /*
+        * Objects are created as locking anchors or place holders for objects
+        * yet to be created. No need to osd_oi_lookup() at here because FID
+        * shouldn't never be re-used, if it's really a duplicate FID from
+        * unexpected reason, we should be able to detect it later by calling
+        * do_create->osd_oi_insert()
+        */
+       if (conf != NULL && (conf->loc_flags & LOC_F_NEW) != 0)
+               GOTO(out, result = 0);
+
        /* Search order: 3. OI files. */
        result = osd_oi_lookup(info, dev, fid, id);
-       if (result != 0 && result != -ENOENT)
-               GOTO(out, result);
-
-       /* If fid wasn't found in oi, inode-less object is created,
-        * for which lu_object_exists() returns false. This is used
-        * in a (frequent) case when objects are created as locking
-        * anchors or place holders for objects yet to be created. */
-       if (conf != NULL && conf->loc_flags & LOC_F_NEW) {
-               if (unlikely(result == 0))
-                       GOTO(out, result = -EEXIST);
-               else
-                       GOTO(out, result = 0);
-       }
-
        if (result == -ENOENT) {
                if (!fid_is_norm(fid) ||
                    !ldiskfs_test_bit(osd_oi_fid2idx(dev,fid),
@@ -446,6 +452,9 @@ static int osd_fid_lookup(const struct lu_env *env, struct osd_object *obj,
                goto trigger;
        }
 
+       if (result != 0)
+               GOTO(out, result);
+
 iget:
        if (verify == 0)
                inode = osd_iget(info, dev, id);
@@ -454,6 +463,7 @@ iget:
        if (IS_ERR(inode)) {
                result = PTR_ERR(inode);
                if (result == -ENOENT || result == -ESTALE) {
+                       fid_zero(&oic->oic_fid);
                        result = 0;
                } else if (result == -EREMCHG) {
 
@@ -462,9 +472,10 @@ trigger:
                                result = -EINPROGRESS;
                        } else if (!scrub->os_no_scrub) {
                                result = osd_scrub_start(dev);
-                               LCONSOLE_ERROR("Trigger OI scrub by RPC for "
-                                              DFID", rc = %d\n",
-                                              PFID(fid), result);
+                               LCONSOLE_ERROR("%.16s: trigger OI scrub by RPC "
+                                              "for "DFID", rc = %d [1]\n",
+                                              LDISKFS_SB(osd_sb(dev))->s_es->\
+                                              s_volume_name,PFID(fid), result);
                                if (result == 0 || result == -EALREADY)
                                        result = -EINPROGRESS;
                                else
@@ -523,13 +534,18 @@ static int osd_object_init(const struct lu_env *env, struct lu_object *l,
        LINVRNT(osd_invariant(obj));
 
        result = osd_fid_lookup(env, obj, lu_object_fid(l), conf);
-        obj->oo_dt.do_body_ops = &osd_body_ops_new;
-        if (result == 0) {
-                if (obj->oo_inode != NULL)
-                        osd_object_init0(obj);
-        }
-        LINVRNT(osd_invariant(obj));
-        return result;
+       obj->oo_dt.do_body_ops = &osd_body_ops_new;
+       if (result == 0) {
+               if (obj->oo_inode != NULL) {
+                       osd_object_init0(obj);
+               } else if (fid_is_otable_it(&l->lo_header->loh_fid)) {
+                       obj->oo_dt.do_ops = &osd_obj_otable_it_ops;
+                       /* LFSCK iterator object is special without inode */
+                       l->lo_header->loh_attr |= LOHA_EXISTS;
+               }
+       }
+       LINVRNT(osd_invariant(obj));
+       return result;
 }
 
 /*
@@ -698,6 +714,9 @@ static void osd_trans_commit_cb(struct journal_callback *jcb, int error)
 
        /* call per-transaction callbacks if any */
        cfs_list_for_each_entry_safe(dcb, tmp, &oh->ot_dcb_list, dcb_linkage) {
+               LASSERTF(dcb->dcb_magic == TRANS_COMMIT_CB_MAGIC,
+                        "commit callback entry: magic=%x name='%s'\n",
+                        dcb->dcb_magic, dcb->dcb_name);
                cfs_list_del_init(&dcb->dcb_linkage);
                dcb->dcb_func(NULL, th, dcb, error);
        }
@@ -763,9 +782,10 @@ int osd_trans_start(const struct lu_env *env, struct dt_device *d,
                 GOTO(out, rc);
 
         if (!osd_param_is_sane(dev, th)) {
-                CWARN("%s: too many transaction credits (%d > %d)\n",
-                      d->dd_lu_dev.ld_obd->obd_name, oh->ot_credits,
-                      osd_journal(dev)->j_max_transaction_buffers);
+               CWARN("%.16s: too many transaction credits (%d > %d)\n",
+                     LDISKFS_SB(osd_sb(dev))->s_es->s_volume_name,
+                     oh->ot_credits,
+                     osd_journal(dev)->j_max_transaction_buffers);
                 /* XXX Limit the credits to 'max_transaction_buffers', and
                  *     let the underlying filesystem to catch the error if
                  *     we really need so many credits.
@@ -812,7 +832,7 @@ int osd_trans_start(const struct lu_env *env, struct dt_device *d,
                  *      data (ofd) and reverse ordering for metadata
                  *      (mdd). then at some point we'll fix the latter
                  */
-                if (lu_device_is_md(&d->dd_lu_dev)) {
+               if (dev->od_is_md) {
                         LASSERT(oti->oti_r_locks == 0);
                         LASSERT(oti->oti_w_locks == 0);
                 }
@@ -865,7 +885,7 @@ static int osd_trans_stop(const struct lu_env *env, struct thandle *th)
                  *      data (ofd) and reverse ordering for metadata
                  *      (mdd). then at some point we'll fix the latter
                  */
-                if (lu_device_is_md(&th->th_dev->dd_lu_dev)) {
+               if (osd_dt_dev(th->th_dev)->od_is_md) {
                         LASSERT(oti->oti_r_locks == 0);
                         LASSERT(oti->oti_w_locks == 0);
                 }
@@ -900,12 +920,14 @@ static int osd_trans_stop(const struct lu_env *env, struct thandle *th)
 
 static int osd_trans_cb_add(struct thandle *th, struct dt_txn_commit_cb *dcb)
 {
-        struct osd_thandle *oh = container_of0(th, struct osd_thandle,
-                                               ot_super);
+       struct osd_thandle *oh = container_of0(th, struct osd_thandle,
+                                              ot_super);
 
-        cfs_list_add(&dcb->dcb_linkage, &oh->ot_dcb_list);
+       LASSERT(dcb->dcb_magic == TRANS_COMMIT_CB_MAGIC);
+       LASSERT(&dcb->dcb_func != NULL);
+       cfs_list_add(&dcb->dcb_linkage, &oh->ot_dcb_list);
 
-        return 0;
+       return 0;
 }
 
 /*
@@ -972,6 +994,9 @@ int osd_statfs(const struct lu_env *env, struct dt_device *d,
         struct kstatfs     *ksfs;
         int result = 0;
 
+       if (unlikely(osd->od_mount == NULL))
+               return -EINPROGRESS;
+
         /* osd_lproc.c call this without env, allocate ksfs for that case */
         if (unlikely(env == NULL)) {
                 OBD_ALLOC_PTR(ksfs);
@@ -981,15 +1006,15 @@ int osd_statfs(const struct lu_env *env, struct dt_device *d,
                 ksfs = &osd_oti_get(env)->oti_ksfs;
         }
 
-        cfs_spin_lock(&osd->od_osfs_lock);
-        /* cache 1 second */
-        if (cfs_time_before_64(osd->od_osfs_age, cfs_time_shift_64(-1))) {
-                result = ll_do_statfs(sb, ksfs);
-                if (likely(result == 0)) { /* N.B. statfs can't really fail */
-                        osd->od_osfs_age = cfs_time_current_64();
-                        statfs_pack(&osd->od_statfs, ksfs);
-                }
-        }
+       cfs_spin_lock(&osd->od_osfs_lock);
+       /* cache 1 second */
+       if (cfs_time_before_64(osd->od_osfs_age, cfs_time_shift_64(-1))) {
+               result = sb->s_op->statfs(sb->s_root, ksfs);
+               if (likely(result == 0)) { /* N.B. statfs can't really fail */
+                       osd->od_osfs_age = cfs_time_current_64();
+                       statfs_pack(&osd->od_statfs, ksfs);
+               }
+       }
 
         if (likely(result == 0))
                 *sfs = osd->od_statfs;
@@ -1368,15 +1393,15 @@ int osd_object_auth(const struct lu_env *env, struct dt_object *dt,
 }
 
 static struct timespec *osd_inode_time(const struct lu_env *env,
-                                       struct inode *inode, __u64 seconds)
+                                      struct inode *inode, __u64 seconds)
 {
-        struct osd_thread_info *oti = osd_oti_get(env);
-        struct timespec        *t   = &oti->oti_time;
+       struct osd_thread_info  *oti = osd_oti_get(env);
+       struct timespec         *t   = &oti->oti_time;
 
-        t->tv_sec  = seconds;
-        t->tv_nsec = 0;
-        *t = timespec_trunc(*t, get_sb_time_gran(inode->i_sb));
-        return t;
+       t->tv_sec = seconds;
+       t->tv_nsec = 0;
+       *t = timespec_trunc(*t, inode->i_sb->s_time_gran);
+       return t;
 }
 
 
@@ -1398,8 +1423,8 @@ static void osd_inode_getattr(const struct lu_env *env,
         attr->la_flags      = LDISKFS_I(inode)->i_flags;
         attr->la_nlink      = inode->i_nlink;
         attr->la_rdev       = inode->i_rdev;
-        attr->la_blksize    = ll_inode_blksize(inode);
-        attr->la_blkbits    = inode->i_blkbits;
+       attr->la_blksize    = 1 << inode->i_blkbits;
+       attr->la_blkbits    = inode->i_blkbits;
 }
 
 static int osd_attr_get(const struct lu_env *env,
@@ -1549,8 +1574,8 @@ static int osd_attr_set(const struct lu_env *env,
         OSD_EXEC_OP(handle, attr_set);
 
         inode = obj->oo_inode;
-       if (LDISKFS_HAS_RO_COMPAT_FEATURE(inode->i_sb,
-                                         LDISKFS_FEATURE_RO_COMPAT_QUOTA)) {
+       if (!osd_dt_dev(handle->th_dev)->od_is_md) {
+               /* OFD support */
                rc = osd_quota_transfer(inode, attr);
                if (rc)
                        return rc;
@@ -1569,9 +1594,9 @@ static int osd_attr_set(const struct lu_env *env,
                                iattr.ia_valid |= ATTR_GID;
                        iattr.ia_uid = attr->la_uid;
                        iattr.ia_gid = attr->la_gid;
-                       osd_push_ctxt(env, save);
+                       osd_push_ctxt(env, save, 1);
                        rc = ll_vfs_dq_transfer(inode, &iattr) ? -EDQUOT : 0;
-                       osd_pop_ctxt(save);
+                       osd_pop_ctxt(save, 1);
                        if (rc != 0)
                                return rc;
                }
@@ -1624,14 +1649,14 @@ static int osd_mkfile(struct osd_thread_info *info, struct osd_object *obj,
                 parent = hint->dah_parent;
 
 #ifdef HAVE_QUOTA_SUPPORT
-        osd_push_ctxt(info->oti_env, save);
+       osd_push_ctxt(info->oti_env, save, osd_dt_dev(th->th_dev)->od_is_md);
 #endif
         inode = ldiskfs_create_inode(oth->ot_handle,
                                      parent ? osd_dt_obj(parent)->oo_inode :
                                               osd_sb(osd)->s_root->d_inode,
                                      mode);
 #ifdef HAVE_QUOTA_SUPPORT
-        osd_pop_ctxt(save);
+       osd_pop_ctxt(save, osd_dt_dev(th->th_dev)->od_is_md);
 #endif
         if (!IS_ERR(inode)) {
                 /* Do not update file c/mtime in ldiskfs.
@@ -1834,8 +1859,8 @@ static void osd_attr_init(struct osd_thread_info *info, struct osd_object *obj,
         if ((valid & LA_MTIME) && (attr->la_mtime == LTIME_S(inode->i_mtime)))
                 attr->la_valid &= ~LA_MTIME;
 
-       if (LDISKFS_HAS_RO_COMPAT_FEATURE(inode->i_sb,
-                                         LDISKFS_FEATURE_RO_COMPAT_QUOTA)) {
+       if (!osd_obj2dev(obj)->od_is_md) {
+               /* OFD support */
                result = osd_quota_transfer(inode, attr);
                if (result)
                        return;
@@ -1906,10 +1931,13 @@ static int __osd_oi_insert(const struct lu_env *env, struct osd_object *obj,
         struct osd_thread_info *info = osd_oti_get(env);
         struct osd_inode_id    *id   = &info->oti_id;
         struct osd_device      *osd  = osd_obj2dev(obj);
-        struct md_ucred        *uc   = md_ucred(env);
 
         LASSERT(obj->oo_inode != NULL);
-        LASSERT(uc != NULL);
+
+       if (osd->od_is_md) {
+               struct md_ucred *uc = md_ucred(env);
+               LASSERT(uc != NULL);
+       }
 
        osd_id_gen(id, obj->oo_inode->i_ino, obj->oo_inode->i_generation);
        return osd_oi_insert(info, osd, fid, id, th);
@@ -2368,22 +2396,20 @@ static int osd_declare_xattr_set(const struct lu_env *env,
                                  const struct lu_buf *buf, const char *name,
                                  int fl, struct thandle *handle)
 {
-        struct osd_thandle *oh;
+       struct osd_thandle *oh;
 
-        LASSERT(handle != NULL);
-
-        if (strcmp(name, XATTR_NAME_VERSION) == 0) {
-                /* no credits for version */
-                return 0;
-        }
+       LASSERT(handle != NULL);
 
-        oh = container_of0(handle, struct osd_thandle, ot_super);
-        LASSERT(oh->ot_handle == NULL);
+       oh = container_of0(handle, struct osd_thandle, ot_super);
+       LASSERT(oh->ot_handle == NULL);
 
-        OSD_DECLARE_OP(oh, xattr_set);
-        oh->ot_credits += osd_dto_credits_noquota[DTO_XATTR_SET];
+       OSD_DECLARE_OP(oh, xattr_set);
+       if (strcmp(name, XATTR_NAME_VERSION) == 0)
+               oh->ot_credits += osd_dto_credits_noquota[DTO_ATTR_SET_BASE];
+       else
+               oh->ot_credits += osd_dto_credits_noquota[DTO_XATTR_SET];
 
-        return 0;
+       return 0;
 }
 
 /*
@@ -2586,23 +2612,23 @@ static struct obd_capa *osd_capa_get(const struct lu_env *env,
 
 static int osd_object_sync(const struct lu_env *env, struct dt_object *dt)
 {
-        struct osd_object      *obj    = osd_dt_obj(dt);
-        struct inode           *inode  = obj->oo_inode;
-        struct osd_thread_info *info   = osd_oti_get(env);
-        struct dentry          *dentry = &info->oti_obj_dentry;
-        struct file            *file   = &info->oti_file;
-        int                     rc;
+       struct osd_object       *obj    = osd_dt_obj(dt);
+       struct inode            *inode  = obj->oo_inode;
+       struct osd_thread_info  *info   = osd_oti_get(env);
+       struct dentry           *dentry = &info->oti_obj_dentry;
+       struct file             *file   = &info->oti_file;
+       int                     rc;
 
-        ENTRY;
+       ENTRY;
 
-        dentry->d_inode = inode;
-        file->f_dentry = dentry;
-        file->f_mapping = inode->i_mapping;
-        file->f_op = inode->i_fop;
-        LOCK_INODE_MUTEX(inode);
-        rc = file->f_op->fsync(file, dentry, 0);
-        UNLOCK_INODE_MUTEX(inode);
-        RETURN(rc);
+       dentry->d_inode = inode;
+       file->f_dentry = dentry;
+       file->f_mapping = inode->i_mapping;
+       file->f_op = inode->i_fop;
+       mutex_lock(&inode->i_mutex);
+       rc = file->f_op->fsync(file, dentry, 0);
+       mutex_unlock(&inode->i_mutex);
+       RETURN(rc);
 }
 
 static int osd_data_get(const struct lu_env *env, struct dt_object *dt,
@@ -2661,17 +2687,6 @@ static int osd_iam_container_init(const struct lu_env *env,
                 return result;
 
         result = iam_container_setup(bag);
-        if (result != 0)
-                goto out;
-
-        if (osd_obj2dev(obj)->od_iop_mode) {
-                u32 ptr = bag->ic_descr->id_ops->id_root_ptr(bag);
-
-                bag->ic_root_bh = ldiskfs_bread(NULL, obj->oo_inode,
-                                                ptr, 0, &result);
-        }
-
- out:
         if (result == 0)
                 obj->oo_dt.do_index_ops = &osd_index_iam_ops;
         else
@@ -2756,6 +2771,15 @@ static int osd_index_try(const struct lu_env *env, struct dt_object *dt,
         return result;
 }
 
+static int osd_otable_it_attr_get(const struct lu_env *env,
+                                struct dt_object *dt,
+                                struct lu_attr *attr,
+                                struct lustre_capa *capa)
+{
+       attr->la_valid = 0;
+       return 0;
+}
+
 static const struct dt_object_operations osd_obj_ops = {
         .do_read_lock         = osd_object_read_lock,
         .do_write_lock        = osd_object_write_lock,
@@ -2820,6 +2844,11 @@ static const struct dt_object_operations osd_obj_ea_ops = {
         .do_data_get          = osd_data_get,
 };
 
+static const struct dt_object_operations osd_obj_otable_it_ops = {
+       .do_attr_get    = osd_otable_it_attr_get,
+       .do_index_try   = osd_index_try,
+};
+
 static int osd_index_declare_iam_delete(const struct lu_env *env,
                                         struct dt_object *dt,
                                         const struct dt_key *key,
@@ -3323,8 +3352,10 @@ again:
                CDEBUG(D_LFSCK, "Trigger OI scrub by RPC for "DFID"\n",
                       PFID(fid));
                rc = osd_scrub_start(dev);
-               CDEBUG(D_LFSCK, "Trigger OI scrub by RPC for "DFID", rc = %d\n",
-                      PFID(fid), rc);
+               LCONSOLE_ERROR("%.16s: trigger OI scrub by RPC for "DFID
+                              ", rc = %d [2]\n",
+                              LDISKFS_SB(osd_sb(dev))->s_es->s_volume_name,
+                              PFID(fid), rc);
                if (rc == 0)
                        goto again;
        }
@@ -3382,9 +3413,10 @@ static int osd_ea_lookup_rec(const struct lu_env *env, struct osd_object *obj,
                        rc = osd_ea_fid_get(env, obj, ino, fid, &oic->oic_lid);
                else
                        osd_id_gen(&oic->oic_lid, ino, OSD_OII_NOGEN);
-
-               if (rc != 0 || !fid_is_norm(fid))
+               if (rc != 0 || !fid_is_norm(fid)) {
+                       fid_zero(&oic->oic_fid);
                        GOTO(out, rc);
+               }
 
                oic->oic_fid = *fid;
                if ((scrub->os_pos_current <= ino) &&
@@ -3832,9 +3864,9 @@ static struct dt_it *osd_it_ea_init(const struct lu_env *env,
         it->oie_file.f_pos      = 0;
         it->oie_file.f_dentry   = obj_dentry;
         if (attr & LUDA_64BITHASH)
-                it->oie_file.f_flags = O_64BITHASH;
+               it->oie_file.f_mode |= FMODE_64BITHASH;
         else
-                it->oie_file.f_flags = O_32BITHASH;
+               it->oie_file.f_mode |= FMODE_32BITHASH;
         it->oie_file.f_mapping    = obj->oo_inode->i_mapping;
         it->oie_file.f_op         = obj->oo_inode->i_fop;
         it->oie_file.private_data = NULL;
@@ -4019,7 +4051,7 @@ static int osd_it_ea_next(const struct lu_env *env, struct dt_it *di)
                 it->oie_it_dirent++;
                 RETURN(0);
         } else {
-                if (it->oie_file.f_pos == LDISKFS_HTREE_EOF)
+               if (it->oie_file.f_pos == ldiskfs_get_htree_eof(&it->oie_file))
                         rc = +1;
                 else
                         rc = osd_ldiskfs_it_fill(env, di);
@@ -4098,9 +4130,10 @@ static inline int osd_it_ea_rec(const struct lu_env *env,
                           it->oie_dirent->oied_name,
                           it->oie_dirent->oied_namelen,
                           it->oie_dirent->oied_type, attr);
-
-       if (!fid_is_norm(fid))
+       if (!fid_is_norm(fid)) {
+               fid_zero(&oic->oic_fid);
                RETURN(0);
+       }
 
        oic->oic_fid = *fid;
        if ((scrub->os_pos_current <= ino) &&
@@ -4430,6 +4463,7 @@ static int osd_process_config(const struct lu_env *env,
                 err = osd_mount(env, o, cfg);
                 break;
         case LCFG_CLEANUP:
+               lu_dev_del_linkage(d->ld_site, d);
                 err = osd_shutdown(env, o);
                 break;
         default:
@@ -4466,7 +4500,24 @@ static int osd_prepare(const struct lu_env *env, struct lu_device *pdev,
                RETURN(result);
        }
 
-        if (!lu_device_is_md(pdev))
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 3, 55, 0)
+       /* Unfortunately, the current MDD implementation relies on some specific
+        * code to be executed in the OSD layer. Since OFD now also uses the OSD
+        * module, we need a way to skip the metadata-specific code when running
+        * with OFD.
+        * The hack here is to check the type of the parent device which is
+        * either MD (i.e. MDD device) with the current MDT stack or DT (i.e.
+        * OFD device) on an OST. As a reminder, obdfilter does not use the OSD
+        * layer and still relies on lvfs. This hack won't work any more when
+        * LOD is landed since LOD is of DT type.
+        * This code should be removed once the orion MDT changes (LOD/OSP, ...)
+        * have been landed */
+       osd->od_is_md = lu_device_is_md(pdev);
+#else
+#warning "all is_md checks must be removed from osd-ldiskfs"
+#endif
+
+        if (!osd->od_is_md)
                 RETURN(0);
 
         /* 3. setup local objects */