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:
parent
0dad9b2f9a
commit
f76a6daca5
|
@ -225,6 +225,7 @@ zvol_check_volsize(uint64_t volsize, uint64_t blocksize)
|
||||||
static int
|
static int
|
||||||
zvol_update_volsize(zvol_state_t *zv, uint64_t volsize)
|
zvol_update_volsize(zvol_state_t *zv, uint64_t volsize)
|
||||||
{
|
{
|
||||||
|
struct block_device *bdev;
|
||||||
dmu_tx_t *tx;
|
dmu_tx_t *tx;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
|
@ -252,9 +253,16 @@ zvol_update_volsize(zvol_state_t *zv, uint64_t volsize)
|
||||||
|
|
||||||
zv->zv_volsize = volsize;
|
zv->zv_volsize = volsize;
|
||||||
zv->zv_changed = 1;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue