mirror_zfs/module/zfs
Ned Bass 3a7381e531 Use stored whole_disk property when opening a vdev
This commit fixes a bug in vdev_disk_open() in which the whole_disk property
was getting set to 0 for disk devices, even when it was stored as a 1 when the
zpool was created.  The whole_disk property lets us detect when the partition
suffix should be stripped from the device name in CLI output.  It is also used
to determine how writeback cache should be set for a device.

When an existing zpool is imported its configuration is read from the vdev
label by user space in zpool_read_label().  The whole_disk property is saved in
the nvlist which gets passed into the kernel, where it in turn gets saved in
the vdev struct in vdev_alloc().  Therefore, this value is available in
vdev_disk_open() and should not be overridden by checking the provided device
path, since that path will likely point to a partition and the check will
return the wrong result.

We also add an ASSERT that the whole_disk property is set.  We are not aware of
any cases where vdev_disk_open() should be called with a config that doesn't
have this property set.  The ASSERT is there so that when debugging is enabled
we can identify any legitimate cases that we are missing.  If we never hit the
ASSERT, we can at some point remove it along with the conditional whole_disk
check.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-10-04 13:53:18 -07:00
..
arc.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
bplist.c Fix gcc missing parenthesis warnings 2010-08-31 08:38:35 -07:00
bpobj.c Update to onnv_147 2010-08-26 14:24:34 -07:00
dbuf.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
ddt_zap.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
ddt.c Add linux kernel memory support 2010-08-31 13:41:57 -07:00
dmu_diff.c Update to onnv_147 2010-08-26 14:24:34 -07:00
dmu_object.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
dmu_objset.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
dmu_send.c Add linux kernel memory support 2010-08-31 13:41:57 -07:00
dmu_traverse.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
dmu_tx.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
dmu_zfetch.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
dmu.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
dnode_sync.c Fix dbuf eviction assertion 2010-08-31 08:38:45 -07:00
dnode.c Quiet down very frequent large allocation warning in ZFS. 2010-09-17 16:24:15 -07:00
dsl_dataset.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
dsl_deadlist.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
dsl_deleg.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
dsl_dir.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
dsl_pool.c Fix gcc missing parenthesis warnings 2010-08-31 08:38:35 -07:00
dsl_prop.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
dsl_scan.c Add linux events 2010-08-31 13:41:36 -07:00
dsl_synctask.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
fm.c Add linux events 2010-08-31 13:41:36 -07:00
gzip.c Fix zmod.h usage in userspace 2010-08-31 08:38:46 -07:00
lzjb.c Fix stack lzjb 2010-08-31 08:38:49 -07:00
Makefile.in Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
metaslab.c Fix metaslab 2010-08-31 08:38:45 -07:00
refcount.c Fix gcc uninitialized variable warnings 2010-08-31 08:38:43 -07:00
rrwlock.c Add linux kernel disk support 2010-08-31 13:41:57 -07:00
sa.c Add linux user disk support 2010-08-31 13:42:00 -07:00
sha256.c Add linux sha2 support 2010-08-31 13:41:59 -07:00
spa_boot.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
spa_config.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
spa_errlog.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
spa_history.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
spa_misc.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
spa.c Add linux spa thread support 2010-08-31 13:41:59 -07:00
space_map.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
txg.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
uberblock.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
unique.c Fix gcc ident pragma warnings 2010-08-27 15:34:02 -07:00
vdev_cache.c Fix stack vdev_cache_read() 2010-08-31 08:38:49 -07:00
vdev_disk.c Use stored whole_disk property when opening a vdev 2010-10-04 13:53:18 -07:00
vdev_file.c Fix gcc uninitialized variable warnings 2010-08-31 08:38:43 -07:00
vdev_label.c Fix gcc uninitialized variable warnings 2010-08-31 08:38:43 -07:00
vdev_mirror.c Fix gcc c90 compliance warnings 2010-08-27 15:28:32 -07:00
vdev_missing.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
vdev_queue.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
vdev_raidz.c Fix variables named current 2010-08-31 08:38:44 -07:00
vdev_root.c Fix gcc c90 compliance warnings 2010-08-27 15:28:32 -07:00
vdev.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
zap_leaf.c Fix gcc uninitialized variable warnings 2010-08-31 08:38:43 -07:00
zap_micro.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
zap.c Fix rw_init() usage 2010-08-31 08:38:46 -07:00
zfs_acl.c Add linux kernel disk support 2010-08-31 13:41:57 -07:00
zfs_byteswap.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
zfs_ctldir.c Add linux kernel disk support 2010-08-31 13:41:57 -07:00
zfs_debug.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
zfs_dir.c Add linux kernel disk support 2010-08-31 13:41:57 -07:00
zfs_fm.c Add linux events 2010-08-31 13:41:36 -07:00
zfs_fuid.c Add linux kernel disk support 2010-08-31 13:41:57 -07:00
zfs_ioctl.c Fix zfsdev_compat_ioctl() case 2010-09-01 16:00:15 -07:00
zfs_log.c Add linux kernel disk support 2010-08-31 13:41:57 -07:00
zfs_onexit.c Add linux kernel device support 2010-08-31 13:41:50 -07:00
zfs_replay.c Add linux kernel disk support 2010-08-31 13:41:57 -07:00
zfs_rlock.c Fix gcc uninitialized variable warnings 2010-08-31 08:38:43 -07:00
zfs_sa.c Add linux user disk support 2010-08-31 13:42:00 -07:00
zfs_vfsops.c Register the space accounting callback even when we don't have the ZPL. 2010-10-04 11:34:39 -07:00
zfs_vnops.c Add linux kernel disk support 2010-08-31 13:41:57 -07:00
zfs_znode.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
zil.c Add linux kernel memory support 2010-08-31 13:41:57 -07:00
zio_checksum.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
zio_compress.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
zio_inject.c Update to onnv_147 2010-08-26 14:24:34 -07:00
zio.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
zle.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
zrlock.c Export ZFS symbols needed by Lustre. 2010-09-17 16:24:15 -07:00
zvol.c Add linux kernel disk support 2010-08-31 13:41:57 -07:00