alblue/mac-zfs — pull request #8 by BjoKaSH (2012-09-17 21:02:46+00:00)
Title: Proposed fix for KP on mount in maczfs_78: conditionallly atache vnode ...

... in zfs_zget_internal().

This patch changes zfs_zget_internal() such that it follows its interface
definition also in case of a pre-allocated znode.

As detailed in my mail from just now (2012-09-17 23:00 CEST), I think this is the right fix for the KP on mount.

In short:

The current implementation of zfs_zget_internal() violates its interface contract:

If called on an object with a prerecorded znode, then it ignores the value of "skipvnode", which it is not allowed to do.

Conclusion:

I think the right fix is to check in line 1011 of zfs_znode.c if vp is valid, and if not and skipvnode is false, then attach a vnode, else return the znode w/o trying to lock the vnode which we are not supposed to have.