From 2b89d86fff8423e5507263d6c923dafed9837057 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 12 Aug 2010 21:19:01 -0700 Subject: [PATCH] Initialize resid variable Properly initialize the variable resid for the error case where vn_rdwr() returns an error with setting *resid. In practice this is harmless because the contents of resid don't matter when vn_rdwr() returns an error. But the code does check the result which means we may or may not end up having the check zio->io_error. This makes gcc unhappy and having a completely deterministic code path here is a good thing. Closes #51 --- module/zfs/vdev_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/vdev_file.c b/module/zfs/vdev_file.c index 8c22aa5316a1..f31389a6df0a 100644 --- a/module/zfs/vdev_file.c +++ b/module/zfs/vdev_file.c @@ -143,7 +143,7 @@ vdev_file_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; vdev_file_t *vf = vd->vdev_tsd; - ssize_t resid; + ssize_t resid = 0; if (zio->io_type == ZIO_TYPE_IOCTL) { /* XXPOLICY */