]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix possible VDEV stats array overflow
authorTony Hutter <hutter2@llnl.gov>
Tue, 2 Aug 2016 00:32:18 +0000 (17:32 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 2 Aug 2016 15:45:24 +0000 (08:45 -0700)
Fix a possible VDEV statistics array overflow when ZIOs with
ZIO_PRIORITY_NOW complete.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #4883
Closes #4917

module/zfs/vdev.c

index 302458b73b2dec8c3636e7eb65d3d2b647069c91..0178bfdec9d73f711afad5605749bcafa335c156 100644 (file)
@@ -2982,7 +2982,8 @@ vdev_stat_update(zio_t *zio, uint64_t psize)
                 * The bytes/ops/histograms are recorded at the leaf level and
                 * aggregated into the higher level vdevs in vdev_get_stats().
                 */
-               if (vd->vdev_ops->vdev_op_leaf) {
+               if (vd->vdev_ops->vdev_op_leaf &&
+                   (zio->io_priority < ZIO_PRIORITY_NUM_QUEUEABLE)) {
 
                        vs->vs_ops[type]++;
                        vs->vs_bytes[type] += psize;