From 318cc463c276ce8994b2cd282fccdea348e6862b Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Thu, 3 Feb 2022 01:43:23 +0300 Subject: [PATCH] Fix warnings --- src/fio_cluster.cpp | 2 +- src/fio_sec_osd.cpp | 4 ++-- src/nbd_proxy.cpp | 9 +++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/fio_cluster.cpp b/src/fio_cluster.cpp index a8ca5455..d0509b31 100644 --- a/src/fio_cluster.cpp +++ b/src/fio_cluster.cpp @@ -351,7 +351,7 @@ static enum fio_q_status sec_queue(struct thread_data *td, struct io_u *io) } else { - printf("+++ %s 0x%lx 0x%llx+%llx\n", + printf("+++ %s 0x%lx 0x%llx+%lx\n", io->ddir == DDIR_READ ? "READ" : "WRITE", (uint64_t)io, io->offset, io->xfer_buflen); } diff --git a/src/fio_sec_osd.cpp b/src/fio_sec_osd.cpp index a14e19d4..3bb7fb32 100644 --- a/src/fio_sec_osd.cpp +++ b/src/fio_sec_osd.cpp @@ -355,7 +355,7 @@ static int sec_getevents(struct thread_data *td, unsigned int min, unsigned int { if (reply.hdr.retval != io->xfer_buflen) { - fprintf(stderr, "Short read: retval = %ld instead of %llu\n", reply.hdr.retval, io->xfer_buflen); + fprintf(stderr, "Short read: retval = %ld instead of %lu\n", reply.hdr.retval, io->xfer_buflen); exit(1); } // Support bitmap @@ -380,7 +380,7 @@ static int sec_getevents(struct thread_data *td, unsigned int min, unsigned int { if (reply.hdr.retval != io->xfer_buflen) { - fprintf(stderr, "Short write: retval = %ld instead of %llu\n", reply.hdr.retval, io->xfer_buflen); + fprintf(stderr, "Short write: retval = %ld instead of %lu\n", reply.hdr.retval, io->xfer_buflen); exit(1); } } diff --git a/src/nbd_proxy.cpp b/src/nbd_proxy.cpp index 60876922..cb567ec9 100644 --- a/src/nbd_proxy.cpp +++ b/src/nbd_proxy.cpp @@ -363,7 +363,8 @@ public: setsid(); if (fork()) exit(0); - chdir("/"); + if (chdir("/") != 0) + fprintf(stderr, "Warning: Failed to chdir into /\n"); close(0); close(1); close(2); @@ -525,7 +526,11 @@ protected: { goto end_unmap; } - write(qd_fd, "32768", 5); + r = write(qd_fd, "32768", 5); + if (r != 5) + { + fprintf(stderr, "Warning: Failed to configure max_sectors_kb\n"); + } close(qd_fd); if (!fork()) {