diff options
author | mav <mav@FreeBSD.org> | 2014-04-01 12:07:15 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-04-01 12:07:15 +0000 |
commit | e28755359aef63078f347e74e5c4a18661c5fcd1 (patch) | |
tree | b58c5840f50e174c84a66e6294a97c8789e41a04 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c | |
parent | 962d0a5759e87d05b2be1281988542f95486294b (diff) | |
download | FreeBSD-src-e28755359aef63078f347e74e5c4a18661c5fcd1.zip FreeBSD-src-e28755359aef63078f347e74e5c4a18661c5fcd1.tar.gz |
MFC r263118:
Report ZVOL block size as GEOM stripesize.
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c index 64c97c9..5e50f3f 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c @@ -925,12 +925,16 @@ zvol_open(struct g_provider *pp, int flag, int count) return (SET_ERROR(ENXIO)); } - if (zv->zv_total_opens == 0) + if (zv->zv_total_opens == 0) { err = zvol_first_open(zv); - if (err) { - if (locked) - mutex_exit(&spa_namespace_lock); - return (err); + if (err) { + if (locked) + mutex_exit(&spa_namespace_lock); + return (err); + } + pp->mediasize = zv->zv_volsize; + pp->stripeoffset = 0; + pp->stripesize = zv->zv_volblocksize; } if ((flag & FWRITE) && (zv->zv_flags & ZVOL_RDONLY)) { err = SET_ERROR(EROFS); |