[LU-8748] set block size for zfs echo object Created: 24/Oct/16  Updated: 06/Mar/17  Resolved: 29/Oct/16

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.9.0

Type: Bug Priority: Minor
Reporter: Niu Yawei (Inactive) Assignee: Niu Yawei (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by LU-8766 The obdfilter-survey make the kernel ... Resolved
Related
is related to LU-8772 obdfilter-survey on ZFS: kernel: PAN... Resolved
is related to LU-8766 The obdfilter-survey make the kernel ... Resolved
Severity: 3
Rank (Obsolete): 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.



 Comments   
Comment by Gerrit Updater [ 24/Oct/16 ]

Niu Yawei (yawei.niu@intel.com) uploaded a new patch: http://review.whamcloud.com/23323
Subject: LU-8748 osd-zfs: set block size of echo object
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: eaf9d24050595a91706e51b929c9fbb3d55a2520

Comment by Gerrit Updater [ 28/Oct/16 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/23323/
Subject: LU-8748 osd-zfs: set block size of echo object
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 64191ab6bb01d909453fc318e038f80d8ef548d9

Comment by Peter Jones [ 29/Oct/16 ]

Landed for 2.9

Generated at Sat Feb 10 02:20:13 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.