Giter Club home page Giter Club logo

Comments (4)

lundman avatar lundman commented on August 23, 2024

When OSX is reading Solaris pool, and attempts to mount, it failure comes from;

zfs_vfs_mount()
  zfs_domount()
    zfs_zget()

    dmu_object_info_from_db(db, &doi);
    if (doi.doi_bonus_type != DMU_OT_ZNODE ||
        doi.doi_bonus_size < sizeof (znode_phys_t)) {

        printf(" zget fail bonus_type %d (ZNODE %d) and size %d ( < %d)\n",
               doi.doi_bonus_type,DMU_OT_ZNODE,
               doi.doi_bonus_size,sizeof (znode_phys_t) );

        dmu_buf_rele(db, NULL);
        ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
        return (EINVAL);
    }

Apr 11 09:02:21 jind0806 kernel[0]: zget fail bonus_type 44 (ZNODE 17) and size 168 ( < 264)

I have verified our headers define DMU_OT_ZNODE, and znode_phys_t correctly, so it would appear that dmu_object_info_from_db is reading the wrong thing.

from zfs.

lundman avatar lundman commented on August 23, 2024

That was copied from MacZFS, and it turns out that it should handle DMU_OT_SA these days, so replaced with calls like

    ZFS_OBJ_HOLD_ENTER(zfsvfs, obj_num);
        err = sa_buf_hold(zfsvfs->z_os, obj_num, NULL, &db);
    dmu_object_info_from_db(db, &doi);

    if (doi.doi_bonus_type != DMU_OT_SA &&
        (doi.doi_bonus_type != DMU_OT_ZNODE ||
         (doi.doi_bonus_type == DMU_OT_ZNODE &&
          doi.doi_bonus_size < sizeof (znode_phys_t)))) {
        ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
        return (EINVAL);
    }

    hdl = dmu_buf_get_user(db);
    zp  = sa_get_userdata(hdl);

with error checking of course. However the sa_buf_hold logic goes wrong. Basically, the call hdl= dmu_buf_get_user(), which just return db->db_user_ptr gives a hdl where hdl->sa_userp; is a truncated pointer.

(gdb) p *hdl
sa_userp = 0x21000000,

and from the looks of it, sa_os looks suspect as well. There are only 4 calls that directly accesses sa_userp in sa.c, and none of them are called.

If a hack is added like:

    result = hdl->sa_userp;
    printf("sa_get_userdata %p -> %p\n", hdl, result);
    if (result < 0xffffffff) result = NULL;

    return (result);

ie, the ptr is not 64bits like it should be, make it be NULL. We can infact import Solaris pool;

Filesystem      Size   Used  Avail Capacity iused   ifree %iused  Mounted on
FROMSOLARIS     91Mi   31Ki   91Mi     1%       7  186087    0%   /FROMSOLARIS

# ls -la /FROMSOLARIS
p--Srwsrwt  26922 2  sys  1365141802 Jan  1  1970 /FROMSOLARIS

So we clearly are misaligned elsewhere too. Our on-disk structures do not fit with official ZFS.

from zfs.

lundman avatar lundman commented on August 23, 2024

OSX structures:

 bpobj 48 bptree_phys 40 bptree_entry_phys 168 ddt_phys 64
 objset_phys 2048 dnode_phys 512, dsl_dataset_phys 320 dsl_deadlist_phys 320
 dsl_dir_phys 256 dsl_scan_phys 192 sa_hdr_phys 8 spa_history_phys 40
 vdev_phys 114688 mzap_ent_phys 64 mzap_phys 128 zap_phys 104
 zap_table_phys 40 zap_leaf_phys 56 znode_phys 264 zfs_acl_phys_v0 88 zfs_acl_phys 88

ZoL structures:

 bpobj 48 bptree_phys 40 bptree_entry_phys 168 ddt_phys 64
 objset_phys 2048 dnode_phys 512, dsl_dataset_phys 320 dsl_deadlist_phys 320
 dsl_dir_phys 256 dsl_scan_phys 192 sa_hdr_phys 8 spa_history_phys 40
 vdev_phys 114688 mzap_ent_phys 64 mzap_phys 128 zap_phys 104
 zap_table_phys 40 zap_leaf_phys 56 znode_phys 264 zfs_acl_phys_v0 88 zfs_acl_phys 88

So, it would appear to be some other issue.

from zfs.

lundman avatar lundman commented on August 23, 2024

Quite a large commit ca7243c goes and adds SA support. The MacZFS code that was merged in as part of the first port only handled pool version=8 and needed to be manually upgraded. There are still many issues with this (files show as directories), umount hangs etc.

from zfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.