From 7a7e1014371c2830d761e17f965f29fdd0edebde Mon Sep 17 00:00:00 2001 From: Michael D Labriola Date: Fri, 18 Dec 2020 12:36:19 -0500 Subject: [PATCH] Linux 5.10 compat: also zvol_revalidate_disk() Commit 59b68723 added a configure check for 5.10, which removed revalidate_disk(), and conditionally replaced it's usage with a call to the new revalidate_disk_size() function. However, the old function also invoked the device's registered callback, in our case zvol_revalidate_disk(). This commit adds a call to zvol_revalidate_disk() in zvol_update_volsize() to make sure the code path stays the same. Reviewed-by: Brian Behlendorf Signed-off-by: Michael D Labriola Closes #11358 --- module/os/linux/zfs/zvol_os.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/os/linux/zfs/zvol_os.c b/module/os/linux/zfs/zvol_os.c index 62fe6cd7f..3b1d3e4f8 100644 --- a/module/os/linux/zfs/zvol_os.c +++ b/module/os/linux/zfs/zvol_os.c @@ -644,11 +644,12 @@ zvol_revalidate_disk(struct gendisk *disk) static int zvol_update_volsize(zvol_state_t *zv, uint64_t volsize) { + struct gendisk *disk = zv->zv_zso->zvo_disk; #ifdef HAVE_REVALIDATE_DISK_SIZE - revalidate_disk_size(zv->zv_zso->zvo_disk, false); + revalidate_disk_size(disk, zvol_revalidate_disk(disk) == 0); #else - revalidate_disk(zv->zv_zso->zvo_disk); + revalidate_disk(disk); #endif return (0); }