All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] f2fs: fix the assign logic of iocb
@ 2022-10-19 16:17 ` Mukesh Ojha
  0 siblings, 0 replies; 12+ messages in thread
From: Mukesh Ojha @ 2022-10-19 16:17 UTC (permalink / raw)
  To: jaegeuk, chao, mhiramat; +Cc: linux-f2fs-devel, linux-kernel, quic_mojha

commit 18ae8d12991b ("f2fs: show more DIO information in tracepoint")
introduces iocb field in 'f2fs_direct_IO_enter' trace event
And it only assigns the pointer and later it accesses its field
in trace print log.

Fix it by correcting data type and memcpy the content of iocb.

Fixes: 18ae8d12991b ("f2fs: show more DIO information in tracepoint")
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
---
 include/trace/events/f2fs.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index c6b3724..7727ec9 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -940,7 +940,7 @@ TRACE_EVENT(f2fs_direct_IO_enter,
 	TP_STRUCT__entry(
 		__field(dev_t,	dev)
 		__field(ino_t,	ino)
-		__field(struct kiocb *,	iocb)
+		__field_struct(struct kiocb,	iocb)
 		__field(unsigned long,	len)
 		__field(int,	rw)
 	),
@@ -948,17 +948,17 @@ TRACE_EVENT(f2fs_direct_IO_enter,
 	TP_fast_assign(
 		__entry->dev	= inode->i_sb->s_dev;
 		__entry->ino	= inode->i_ino;
-		__entry->iocb	= iocb;
+		 memcpy(&__entry->iocb, iocb, sizeof(*iocb));
 		__entry->len	= len;
 		__entry->rw	= rw;
 	),
 
 	TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu ki_flags = %x ki_ioprio = %x rw = %d",
 		show_dev_ino(__entry),
-		__entry->iocb->ki_pos,
+		__entry->iocb.ki_pos,
 		__entry->len,
-		__entry->iocb->ki_flags,
-		__entry->iocb->ki_ioprio,
+		__entry->iocb.ki_flags,
+		__entry->iocb.ki_ioprio,
 		__entry->rw)
 );
 
-- 
2.7.4


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

end of thread, other threads:[~2022-10-24  5:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19 16:17 [PATCH] f2fs: fix the assign logic of iocb Mukesh Ojha
2022-10-19 16:17 ` [f2fs-dev] " Mukesh Ojha
2022-10-20  9:01 ` Chao Yu
2022-10-20  9:01   ` [f2fs-dev] " Chao Yu
2022-10-20  9:27   ` Mukesh Ojha
2022-10-20  9:27     ` [f2fs-dev] " Mukesh Ojha
2022-10-20 10:26     ` Chao Yu
2022-10-20 10:26       ` [f2fs-dev] " Chao Yu
2022-10-21  5:00 ` Pavan Kondeti
2022-10-21  5:00   ` [f2fs-dev] " Pavan Kondeti
2022-10-24  5:07   ` Masami Hiramatsu
2022-10-24  5:07     ` [f2fs-dev] " Masami Hiramatsu

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.