Use check_disk_change() instead of revalidate_disk().

For 2.6.27 kernels are earlier revalidate_disk() was not available.
However, check_disk_change() has been available for far longer and
will properly inform the kernel of the volume change for both older
and newer kernels.
This commit is contained in:
Brian Behlendorf 2009-12-11 12:02:45 -08:00
parent 0dad9b2f9a
commit f76a6daca5
1 changed files with 10 additions and 2 deletions

View File

@ -225,6 +225,7 @@ zvol_check_volsize(uint64_t volsize, uint64_t blocksize)
static int
zvol_update_volsize(zvol_state_t *zv, uint64_t volsize)
{
struct block_device *bdev;
dmu_tx_t *tx;
int error;
@ -252,9 +253,16 @@ zvol_update_volsize(zvol_state_t *zv, uint64_t volsize)
zv->zv_volsize = volsize;
zv->zv_changed = 1;
error = revalidate_disk(zv->zv_disk);
return (error);
bdev = bdget_disk(zv->zv_disk, 0);
if (!bdev)
return EIO;
error = check_disk_change(bdev);
ASSERT3U(error, !=, 0);
bdput(bdev);
return (0);
}
/*