All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] backend: respect return value of init_io_u_buffers
@ 2022-12-01  2:44 Shin'ichiro Kawasaki
  2022-12-01  2:58 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Shin'ichiro Kawasaki @ 2022-12-01  2:44 UTC (permalink / raw)
  To: fio, Jens Axboe, Vincent Fu

When workloads require large buffer for I/O, fio fails to allocate I/O
buffer but does not report meaningful error message. It just accesses
to null pointer and fail with signal 11. This symptom is observed with
the command line below:

$ fio --name=job --filename=/tmp/fio --rw=write --bs=1g --size=1g \
      --iodepth=128 --ioengine=libaio

The I/O buffer allocation is done in function init_io_u_buffers. The
allocation failure is not reported because return value of the function
is ignored. Check the return value and report to the higher layer.

Fixes: 71e6e5a2fd5c ("iolog replay: Realloc io_u buffers to adapt to operation size.")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 backend.c  | 3 ++-
 blktrace.c | 3 ++-
 iolog.c    | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/backend.c b/backend.c
index ba954a6b..928e524a 100644
--- a/backend.c
+++ b/backend.c
@@ -1301,7 +1301,8 @@ static int init_io_u(struct thread_data *td)
 		}
 	}
 
-	init_io_u_buffers(td);
+	if (init_io_u_buffers(td))
+		return 1;
 
 	if (init_file_completion_logging(td, max_units))
 		return 1;
diff --git a/blktrace.c b/blktrace.c
index 00e5f9a9..d5c8aee7 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -545,7 +545,8 @@ bool read_blktrace(struct thread_data* td)
 			td->o.max_bs[DDIR_TRIM] = max(td->o.max_bs[DDIR_TRIM], rw_bs[DDIR_TRIM]);
 			io_u_quiesce(td);
 			free_io_mem(td);
-			init_io_u_buffers(td);
+			if (init_io_u_buffers(td))
+				return false;
 		}
 		return true;
 	}
diff --git a/iolog.c b/iolog.c
index aa9c3bb1..62f2f524 100644
--- a/iolog.c
+++ b/iolog.c
@@ -620,7 +620,8 @@ static bool read_iolog(struct thread_data *td)
 		{
 			io_u_quiesce(td);
 			free_io_mem(td);
-			init_io_u_buffers(td);
+			if (init_io_u_buffers(td))
+				return false;
 		}
 		return true;
 	}
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] backend: respect return value of init_io_u_buffers
  2022-12-01  2:44 [PATCH] backend: respect return value of init_io_u_buffers Shin'ichiro Kawasaki
@ 2022-12-01  2:58 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2022-12-01  2:58 UTC (permalink / raw)
  To: Shin'ichiro Kawasaki, fio, Vincent Fu

On Thu, 01 Dec 2022 11:44:25 +0900, Shin'ichiro Kawasaki wrote:
> When workloads require large buffer for I/O, fio fails to allocate I/O
> buffer but does not report meaningful error message. It just accesses
> to null pointer and fail with signal 11. This symptom is observed with
> the command line below:
> 
> $ fio --name=job --filename=/tmp/fio --rw=write --bs=1g --size=1g \
>       --iodepth=128 --ioengine=libaio
> 
> [...]

Applied, thanks!

[1/1] backend: respect return value of init_io_u_buffers
      commit: 6d8fe6e847bb43cf7db5eee4cf58fd490f12be47

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-01  2:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01  2:44 [PATCH] backend: respect return value of init_io_u_buffers Shin'ichiro Kawasaki
2022-12-01  2:58 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.