Illumos 3557, 3558, 3559, 3560

3557 dumpvp_size is not updated correctly when a dump zvol's size is changed
3558 setting the volsize on a dump device does not return back ENOSPC
3559 setting a volsize larger than the space available sometimes succeeds
3560 dumpadm should be able to remove a dump device
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Approved by: Albert Lee <trisk@nexenta.com>

References:
  https://www.illumos.org/issues/3559
  https://github.com/illumos/illumos-gate/commit/c61ea56

Porting notes:
- Internal zvol.c changes not applied due to implementation differences.
  The external interface and behavior was already consistent with the
  latest upstream code.
- Retired 2.6.28 HAVE_CHECK_DISK_SIZE_CHANGE configure check.  All
  supported kernels (2.6.32 and newer) provide this interface.

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4217
This commit is contained in:
George Wilson
2016-01-13 14:37:39 -08:00
committed by Brian Behlendorf
parent 21f604d460
commit 59d4c71cca
5 changed files with 27 additions and 36 deletions
-10
View File
@@ -238,19 +238,9 @@ zvol_size_changed(zvol_state_t *zv, uint64_t volsize)
bdev = bdget_disk(zv->zv_disk, 0);
if (bdev == NULL)
return;
/*
* 2.6.28 API change
* Added check_disk_size_change() helper function.
*/
#ifdef HAVE_CHECK_DISK_SIZE_CHANGE
set_capacity(zv->zv_disk, volsize >> 9);
zv->zv_volsize = volsize;
check_disk_size_change(zv->zv_disk, bdev);
#else
zv->zv_volsize = volsize;
zv->zv_changed = 1;
(void) check_disk_change(bdev);
#endif /* HAVE_CHECK_DISK_SIZE_CHANGE */
bdput(bdev);
}