Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-8748

set block size for zfs echo object

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.9.0
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      LU-7906 osd: no blocksize on non-OST objects

      diff --git a/lustre/osd-zfs/osd_object.c b/lustre/osd-zfs/osd_object.c
      index fa9ec89..4079eeb 100644
      --- a/lustre/osd-zfs/osd_object.c
      +++ b/lustre/osd-zfs/osd_object.c
      @@ -1390,8 +1390,9 @@ static dmu_buf_t *osd_mkreg(const struct lu_env *env, struct osd_object *obj,
                                  struct lu_attr *la, uint64_t parent,
                                  struct osd_thandle *oh)
       {
      -       dmu_buf_t         *db;
      -       int                rc;
      +       const struct lu_fid *fid = lu_object_fid(&obj->oo_dt.do_lu);
      +       dmu_buf_t           *db;
      +       int                  rc;
              struct osd_device *osd = osd_obj2dev(obj);
      
              LASSERT(S_ISREG(la->la_mode));
      @@ -1406,7 +1407,7 @@ static dmu_buf_t *osd_mkreg(const struct lu_env *env, struct osd_object *obj,
               * blocksize is selected based on the file size rather than the
               * making broad assumptions based on the osd type.
               */
      -       if (!lu_device_is_md(osd2lu_dev(osd))) {
      +       if ((fid_is_idif(fid) || fid_is_norm(fid)) && osd->od_is_ost) {
                      rc = -dmu_object_set_blocksize(osd->od_os, db->db_object,
                                                     osd->od_max_blksz, 0, oh->ot_tx);
                      if (unlikely(rc)) {
      

      Actually, the block size should be set on echo object as well.

      Attachments

        Issue Links

          Activity

            People

              niu Niu Yawei (Inactive)
              niu Niu Yawei (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: