Recent changes (master)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following changes since commit ff547caad147b437f654881717fedc750c0c9b17:

  fio: Add advise THP option to mmap engine (2019-04-18 10:46:19 -0600)

are available in the Git repository at:

  git://git.kernel.dk/fio.git master

for you to fetch changes up to 7f125e7f3879d23e79bc2ef5eed678ddab3b5c70:

  zbd: Fix zone report handling (2019-04-19 09:11:34 -0600)

----------------------------------------------------------------
Damien Le Moal (1):
      zbd: Fix zone report handling

 zbd.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

---

Diff of recent changes:

diff --git a/zbd.c b/zbd.c
index 2da742b7..1c46b452 100644
--- a/zbd.c
+++ b/zbd.c
@@ -186,11 +186,14 @@ static bool zbd_verify_bs(void)
  * size of @buf.
  *
  * Returns 0 upon success and a negative error code upon failure.
+ * If the zone report is empty, always assume an error (device problem) and
+ * return -EIO.
  */
 static int read_zone_info(int fd, uint64_t start_sector,
 			  void *buf, unsigned int bufsz)
 {
 	struct blk_zone_report *hdr = buf;
+	int ret;
 
 	if (bufsz < sizeof(*hdr))
 		return -EINVAL;
@@ -199,7 +202,12 @@ static int read_zone_info(int fd, uint64_t start_sector,
 
 	hdr->nr_zones = (bufsz - sizeof(*hdr)) / sizeof(struct blk_zone);
 	hdr->sector = start_sector;
-	return ioctl(fd, BLKREPORTZONE, hdr) >= 0 ? 0 : -errno;
+	ret = ioctl(fd, BLKREPORTZONE, hdr);
+	if (ret)
+		return -errno;
+	if (!hdr->nr_zones)
+		return -EIO;
+	return 0;
 }
 
 /*



[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux