Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

vfs_fsadd() returns EINVAL



I am porting a file system driver to 64-bit 10.6.  When I try to load the kernel extension, it fails with the following error:

#sudo kextutil -s fsd/symdir fsd/fsd.kext
Notice: Using running kernel architecture x86_64 to generate symbols.
(kernel) Kext com.company.kext.fsd start failed (result 0x5).
(kernel) Kext com.company.kext.fsd failed to load (0xdc008017).
(kernel) Failed to load kext com.company.kext.fsd (error 0xdc008017).
Failed to load fsd/fsd.kext - (libkern/kext) kext (kmod) start/stop routine failed.

From /var/log/kernel.log:
Nov  4 13:38:09 Xserve1 kernel[0]: fsd_module_start: returned failure, error 22
Nov  4 13:38:09 Xserve1 kernel[0]: Kext com.company.kext.fsd start failed (result 0x5).

I have added all checks that I found in vfs_fsadd() in opensource, and I do not trip them.

Here are the relevant portions:
/*
 * vfs operations.
 */
struct vfsops fsd_vfsops = {
        fsd_mount,
        fsd_vfsstart,
        fsd_unmount,
        fsd_root,
        NULL,           /* quotactl */
        fsd_vfs_getattr,
        fsd_sync,
        fsd_vget,
        NULL,
        NULL,
        fsd_init,
        NULL /*sysctl */
};

struct vnodeopv_desc * fsd_vnodeop_opv_desc_list[] =
{
        &fsd_vnodeop_opv_desc,
        NULL
};

struct vfs_fsentry fsd_fsentry = {
        &fsd_vfsops,
        1,
        fsd_vnodeop_opv_desc_list,
        0,
        FSD_FS_NAME,
        VFS_TBLTHREADSAFE | VFS_TBLFSNODELOCK | VFS_TBLNOTYPENUM | VFS_TBL64BITREADY,
        { NULL, NULL }
 };

static kern_return_t
fsd_module_start(struct kmod_info *ki, void *data)
{
        int desccount;
        errno_t error = 0;
        struct vfs_fsentry *vfe = &fsd_fsentry;

        desccount = vfe->vfe_vopcnt;
        IOLog("%s: %d, %p, %p, %d\n", __FUNCTION__, desccount,
              vfe->vfe_vfsops, vfe->vfe_opvdescs, vfe->vfe_flags);
        if ((desccount <=0) || ((desccount > 8)) ||
            (vfe->vfe_vfsops == (struct vfsops *)NULL) ||
            (vfe->vfe_opvdescs == (struct vnodeopv_desc **)NULL)) {
            IOLog("%s: returning failure, %d\n", __FUNCTION__, __LINE__);
            return KMOD_RETURN_FAILURE;
        }

        if ((vfe->vfe_flags &  (VFS_TBLTHREADSAFE | VFS_TBLFSNODELOCK)) == 0) {
            IOLog("%s: returning failure, %d\n", __FUNCTION__, __LINE__);
            return KMOD_RETURN_FAILURE;
        }

        error = vfs_fsadd(vfe, &fsd_vfsconf);
        IOLog("%s: returned %s, %d, %d\n", __FUNCTION__,
              error ? "failure" : "success", __LINE__, error);
        return error ? KMOD_RETURN_FAILURE : KMOD_RETURN_SUCCESS;
}

Any help is greatly appreciated.  Thanks!
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-kernel/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.