Skip to content

Commit

Permalink
Fix possible VDEV stats array overflow
Browse files Browse the repository at this point in the history
Fix a possible VDEV statistics array overflow when ZIOs with
ZIO_PRIORITY_NOW complete.

Signed-off-by: Tony Hutter <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Issue openzfs#4883
Closes openzfs#4917
  • Loading branch information
tonyhutter authored and behlendorf committed Aug 2, 2016
1 parent e24e62a commit 4eb0db4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/zfs/vdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4eb0db4

Please sign in to comment.