Updates on ZFS.

Pawel Jakub Dawidek pjd at FreeBSD.org
Tue Aug 10 20:04:10 UTC 2010


Hi.

For the past weeks I was working on getting recent ZFS to work. This is
what I accomplished:

1. Fixed (implemented) onexit functionality that is now used by zfs
   send/recv. This is based on device cloning in OpenSolaris, but I
   manage to avoid using device cloning on FreeBSD and ended up using
   cdevpriv, which is much less problematic.
   This was the main reason ZFS in my tree didn't compile for quite a
   while - I needed to find a way and time to implement it properly.

2. I manage to get ZVOLs to work again. Commit log for this change
   should explain everything:

   OpenSolaris switched to lazy creation of /dev/ entires for ZVOLs.
   It creates /dev/ entries on VOP_LOOKUP() or VOP_READDIR().

   This of course can't work this way on FreeBSD with GEOM, so we need
   to create ZVOL providers where appropriate. I found the following
   cases:
   1. Pool first open (pool is loaded based on zpool/cache configuration
      and is then opened for a first time on eg. zfs mount).
   2. Pool import. It's not the same as 1.
   3. ZVOL creation: zfs create -V<size> <zvol>.
   4. Creation of ZVOL snapshot, this includes recursive snapshot
      creation.

   To make it work I had to fix LOR between the zfsdev_state_lock, the
   GEOM topology lock and the spa_namespace_lock. They are now always
   obtained in the following order:
   1. zfsdev_state_lock
   2. g_topology_lock
   3. spa_namespace_lock
   Also, we can't use taskqueue to scan for VDEVs as this introduces
   deadlock (because there is no way to honour the order above).

   This also allows to simplify vdev_geom.c quite a bit as it is no
   longer a problem to taste ZVOL or ZVOL-based provider.

   Update /etc/rc.d/zvol as there are no longer volinit and volfini
   subcommands to zfs(8).

3. I integrated all the recent changes (including zfs diff and readonly
   pools functionality). We are at v28 now and in sync with today's
   OpenSolaris.

4. I fixed a handful of bugs.

All in all, it compiles and at least basic functionality should work.

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/zfs-devel/attachments/20100810/377451c2/attachment.pgp


More information about the zfs-devel mailing list