From 8f1eb1049b86344f7e5ccb91a293ba815f362376 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 11 Dec 2009 12:01:16 -0800 Subject: [PATCH 1/3] Use MAXOFFSET_T instead of SPEC_MAXOFFSET_T for 32-bit arch. --- module/zfs/zvol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c index cc95bf2fc2..9c8d1c2203 100644 --- a/module/zfs/zvol.c +++ b/module/zfs/zvol.c @@ -213,7 +213,7 @@ zvol_check_volsize(uint64_t volsize, uint64_t blocksize) return (EINVAL); #ifdef _ILP32 - if (volsize - 1 > SPEC_MAXOFFSET_T) + if (volsize - 1 > MAXOFFSET_T) return (EOVERFLOW); #endif return (0); From 0dad9b2f9a5d5859708ec21145191f418965f7e9 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 11 Dec 2009 12:02:05 -0800 Subject: [PATCH 2/3] Adding missed * in debug ASSERT. --- module/zfs/dmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index dfa075571b..8840d65dcb 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -680,7 +680,7 @@ dmu_req_copy(void *arg_buf, int size, int *offset, struct request *req) rq_for_each_segment(bv, req, iter) { /* Fully consumed the passed arg_buf */ - ASSERT3S(offset, <=, size); + ASSERT3S(*offset, <=, size); if (size == *offset) break; From f76a6daca58c0765b0c1b8cea44e45a15dc36750 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 11 Dec 2009 12:02:45 -0800 Subject: [PATCH 3/3] 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. --- module/zfs/zvol.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c index 9c8d1c2203..af64f59349 100644 --- a/module/zfs/zvol.c +++ b/module/zfs/zvol.c @@ -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); } /*