* [PATCH] iomap: Fix writepage tracepoint pgoff
@ 2020-03-04 14:22 Matthew Wilcox
2020-03-04 15:25 ` Christoph Hellwig
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2020-03-04 14:22 UTC (permalink / raw)
To: linux-xfs; +Cc: linux-fsdevel, Christoph Hellwig, Darrick J. Wong
From: Matthew Wilcox (Oracle) <willy@infradead.org>
page_offset() confusingly returns the number of bytes from the
beginning of the file and not the pgoff, which the tracepoint claims
to be returning. We're already returning the number of bytes from the
beginning of the file in the 'offset' parameter, so correct the pgoff
to be what was apparently intended.
Fixes: 0b1b213fcf3a ("xfs: event tracing support")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
diff --git a/fs/iomap/trace.h b/fs/iomap/trace.h
index d6ba705f938a..ebc89ec5e6c7 100644
--- a/fs/iomap/trace.h
+++ b/fs/iomap/trace.h
@@ -56,7 +56,7 @@ DECLARE_EVENT_CLASS(iomap_page_class,
TP_fast_assign(
__entry->dev = inode->i_sb->s_dev;
__entry->ino = inode->i_ino;
- __entry->pgoff = page_offset(page);
+ __entry->pgoff = page->index;
__entry->size = i_size_read(inode);
__entry->offset = off;
__entry->length = len;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] iomap: Fix writepage tracepoint pgoff
2020-03-04 14:22 [PATCH] iomap: Fix writepage tracepoint pgoff Matthew Wilcox
@ 2020-03-04 15:25 ` Christoph Hellwig
2020-03-04 15:34 ` Matthew Wilcox
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2020-03-04 15:25 UTC (permalink / raw)
To: Matthew Wilcox
Cc: linux-xfs, linux-fsdevel, Christoph Hellwig, Darrick J. Wong
On Wed, Mar 04, 2020 at 06:22:59AM -0800, Matthew Wilcox wrote:
> From: Matthew Wilcox (Oracle) <willy@infradead.org>
>
> page_offset() confusingly returns the number of bytes from the
> beginning of the file and not the pgoff, which the tracepoint claims
> to be returning. We're already returning the number of bytes from the
> beginning of the file in the 'offset' parameter, so correct the pgoff
> to be what was apparently intended.
>
> Fixes: 0b1b213fcf3a ("xfs: event tracing support")
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
I wonder if tracing the byte offset and just changing the name
might be more useful. But I agree that we should fix it one way or
another.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iomap: Fix writepage tracepoint pgoff
2020-03-04 15:25 ` Christoph Hellwig
@ 2020-03-04 15:34 ` Matthew Wilcox
2020-03-04 15:36 ` Christoph Hellwig
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2020-03-04 15:34 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-xfs, linux-fsdevel, Darrick J. Wong
On Wed, Mar 04, 2020 at 07:25:15AM -0800, Christoph Hellwig wrote:
> On Wed, Mar 04, 2020 at 06:22:59AM -0800, Matthew Wilcox wrote:
> > From: Matthew Wilcox (Oracle) <willy@infradead.org>
> >
> > page_offset() confusingly returns the number of bytes from the
> > beginning of the file and not the pgoff, which the tracepoint claims
> > to be returning. We're already returning the number of bytes from the
> > beginning of the file in the 'offset' parameter, so correct the pgoff
> > to be what was apparently intended.
> >
> > Fixes: 0b1b213fcf3a ("xfs: event tracing support")
> > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
>
> I wonder if tracing the byte offset and just changing the name
> might be more useful. But I agree that we should fix it one way or
> another.
I covered that -- "We're already returning the number of bytes from the
beginning of the file in the 'offset' parameter, so correct the pgoff
to be what was apparently intended."
I mean, we could just delete the pgoff instead. Apparently nobody's
using it, or they would surely have noticed.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iomap: Fix writepage tracepoint pgoff
2020-03-04 15:34 ` Matthew Wilcox
@ 2020-03-04 15:36 ` Christoph Hellwig
0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2020-03-04 15:36 UTC (permalink / raw)
To: Matthew Wilcox
Cc: Christoph Hellwig, linux-xfs, linux-fsdevel, Darrick J. Wong
On Wed, Mar 04, 2020 at 07:34:00AM -0800, Matthew Wilcox wrote:
> I covered that -- "We're already returning the number of bytes from the
> beginning of the file in the 'offset' parameter, so correct the pgoff
> to be what was apparently intended."
>
> I mean, we could just delete the pgoff instead. Apparently nobody's
> using it, or they would surely have noticed.
Let's just kill it.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-03-04 15:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-04 14:22 [PATCH] iomap: Fix writepage tracepoint pgoff Matthew Wilcox
2020-03-04 15:25 ` Christoph Hellwig
2020-03-04 15:34 ` Matthew Wilcox
2020-03-04 15:36 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).