Skip to contentSkip to conversation

fix segmentation fault with option bandwidth-log

PATCH Applied Ankit Kumar 2 participants 3 messages Oct 21, 2022 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20221021070023epcas5p4fb87f4bf54dee358f193f66d910dd624@epcas5p4.samsung.com

#1 lore raw

cover fix segmentation fault with option bandwidth-log

The log parameters for aggregate read, write and trim only specify log type. As a result the io_log data structure doesn't have the relevant thread_data. While specifying fio option bandwidth-log this results in segmentation fault.
Add a check and use DEF_LOG_ENTRIES for such case.

This was introduced with the commit 0a852a50

Ankit Kumar (1):
stat: fix segfault with fio option bandwidth-log

 stat.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
2.17.1
#2 lore raw

PATCH 1/1 stat: fix segfault with fio option bandwidth-log

The log_params for aggregate read, write and trim only specify log type. As a result the io_log doesn't have the relevant thread_data structure. With fio option bandwidth-log this results in segmentation fault.
Add a check and use DEF_LOG_ENTRIES for such case.

---
 stat.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
stat.c +4 -1
index 949af5ed..b963973a 100644
@@ -2870,7 +2870,10 @@ static struct io_logs *get_new_log(struct io_log *iolog)
 	 * forever
 	 */
 	if (!iolog->cur_log_max) {
-		new_samples = iolog->td->o.log_entries;
+		if (iolog->td)
+			new_samples = iolog->td->o.log_entries;
+		else
+			new_samples = DEF_LOG_ENTRIES;
 	} else {
 		new_samples = iolog->cur_log_max * 2;
 		if (new_samples > MAX_LOG_ENTRIES)
Signature · 1 line
2.17.1
Applied
#3 lore raw
In reply to Ankit Kumar
Quoted 6 lines · Ankit Kumar

The log parameters for aggregate read, write and trim only specify log type. As a result the io_log data structure doesn't have the relevant thread_data. While specifying fio option bandwidth-log this results in segmentation fault.
Add a check and use DEF_LOG_ENTRIES for such case.

Quoted 8 lines

This was introduced with the commit 0a852a50

Ankit Kumar (1):
stat: fix segfault with fio option bandwidth-log

  stat.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

Applied, thanks. I added a fixes tag and lightly edited the commit message.

Vincent