zfs/module
Brian Behlendorf f3aa3b93df Fix zvol partition creation during module load
Partitions for a zvol device were not appearing in /dev/zvol/<pool>/
at module load time for a couple of reasons.

1) The Linux block layer expects a block device to have a non-zero
   capacity during add_disk().  If the capacity is zero it does not
   attempt to open the device which means we never trigger a partition
   scan.  The device capacity was just being set during the first open.

2) Because we expect to be adding a block device to the zvol_state_list
   during zvol_create_minor() the zvol_state_lock() is held.  This
   can result in a deadlock in add_disk() when it attempts to open
   the block device via zvol_open() which also takes this same lock.
   To avoid this issue special handling has been added to zvol_open()
   and zvol_release() to allow the mutex owner to enter these functions
   without retaking the lock.

3) In __zvol_create_minor() the call to dmu_objset_disown() must occur
   before the call to add_disk().  As mentioned above add_disk() results
   in a call to zvol_open() which will attempt to call dmu_objset_own()
   again on the objset.  If the objset is already open it will fail
   resulting in a failed open.  This in turn means the kernel will be
   unable to read the partition information from the device.
2010-08-04 16:05:25 -07:00
..
avl Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-05-28 15:46:10 -07:00
nvpair Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-05-28 15:46:10 -07:00
unicode Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2009-03-11 14:08:51 -07:00
zcommon Minor device creation/removal (Kernel) 2010-08-02 11:49:08 -07:00
zfs Fix zvol partition creation during module load 2010-08-04 16:05:25 -07:00
.gitignore Add .gitignore files to exclude build products 2010-01-08 11:35:17 -08:00
Makefile.in Add uninstall Makefile targets 2010-07-28 16:47:26 -07:00