* linux-next: build warning after merge of Linus' tree
@ 2025-03-05 9:46 Stephen Rothwell
2025-03-05 11:23 ` [PATCH] include/linux/pipe_fs_i: Add htmldoc annotation for "head_tail" member K Prateek Nayak
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2025-03-05 9:46 UTC (permalink / raw)
To: Linus Torvalds
Cc: K Prateek Nayak, Linux Kernel Mailing List,
Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 368 bytes --]
Hi all,
After merging Linus' tree, today's linux-next build (htmldocs)
produced this warning:
include/linux/pipe_fs_i.h:118: warning: Function parameter or struct member 'head_tail' not described in 'pipe_inode_info'
Introduced by commit
3d252160b818 ("fs/pipe: Read pipe->{head,tail} atomically outside pipe->mutex")
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] include/linux/pipe_fs_i: Add htmldoc annotation for "head_tail" member
2025-03-05 9:46 linux-next: build warning after merge of Linus' tree Stephen Rothwell
@ 2025-03-05 11:23 ` K Prateek Nayak
2025-03-05 17:35 ` Linus Torvalds
0 siblings, 1 reply; 5+ messages in thread
From: K Prateek Nayak @ 2025-03-05 11:23 UTC (permalink / raw)
To: Linus Torvalds, Oleg Nesterov, Stephen Rothwell, linux-kernel
Cc: Linux Next Mailing List, Swapnil Sapkal, K Prateek Nayak
Add htmldoc annotation for the newly introduced "head_tail" member
describing it to be a union of the pipe_inode_info's @head and @tail
members.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/lkml/20250305204609.5e64768e@canb.auug.org.au/
Fixes: 3d252160b818 ("fs/pipe: Read pipe->{head,tail} atomically outside pipe->mutex")
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
---
include/linux/pipe_fs_i.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 3cc4f8eab853..44b8c346ae2d 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -65,6 +65,7 @@ union pipe_index {
* @wr_wait: writer wait point in case of full pipe
* @head: The point of buffer production
* @tail: The point of buffer consumption
+ * @head_tail: unsigned long union of @head and @tail
* @note_loss: The next read() should insert a data-lost message
* @max_usage: The maximum number of slots that may be used in the ring
* @ring_size: total number of buffers (should be a power of 2)
base-commit: 48a5eed9ad584315c30ed35204510536235ce402
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] include/linux/pipe_fs_i: Add htmldoc annotation for "head_tail" member
2025-03-05 11:23 ` [PATCH] include/linux/pipe_fs_i: Add htmldoc annotation for "head_tail" member K Prateek Nayak
@ 2025-03-05 17:35 ` Linus Torvalds
2025-03-05 18:08 ` K Prateek Nayak
0 siblings, 1 reply; 5+ messages in thread
From: Linus Torvalds @ 2025-03-05 17:35 UTC (permalink / raw)
To: K Prateek Nayak
Cc: Oleg Nesterov, Stephen Rothwell, linux-kernel,
Linux Next Mailing List, Swapnil Sapkal
On Wed, 5 Mar 2025 at 01:24, K Prateek Nayak <kprateek.nayak@amd.com> wrote:
>
> Add htmldoc annotation for the newly introduced "head_tail" member
> describing it to be a union of the pipe_inode_info's @head and @tail
> members.
Applied.
I also committed the pipe_occupancy() fix for 32-bit, but did so
without testing - it was ObviouslyCorrect(tm), but considering that
everybody missed it in the original patch, "obvious" is all relative.
And it turns out my worry about pipe_discard_from() was unnecessary.
Yes, the code is buggy. But no, it doesn't matter. Why? There are no
callers of that function ;)
That said, I still hope people will take a look at the code and see if
there's anything else I missed.
Oh, and testing. Testing would be good.
Linus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] include/linux/pipe_fs_i: Add htmldoc annotation for "head_tail" member
2025-03-05 17:35 ` Linus Torvalds
@ 2025-03-05 18:08 ` K Prateek Nayak
2025-03-05 18:26 ` Linus Torvalds
0 siblings, 1 reply; 5+ messages in thread
From: K Prateek Nayak @ 2025-03-05 18:08 UTC (permalink / raw)
To: Linus Torvalds
Cc: Oleg Nesterov, Stephen Rothwell, linux-kernel,
Linux Next Mailing List, Swapnil Sapkal
Hello Linus,
On 3/5/2025 11:05 PM, Linus Torvalds wrote:
> On Wed, 5 Mar 2025 at 01:24, K Prateek Nayak <kprateek.nayak@amd.com> wrote:
>>
>> Add htmldoc annotation for the newly introduced "head_tail" member
>> describing it to be a union of the pipe_inode_info's @head and @tail
>> members.
>
> Applied.
Thank you.
>
> I also committed the pipe_occupancy() fix for 32-bit, but did so
> without testing - it was ObviouslyCorrect(tm), but considering that
> everybody missed it in the original patch, "obvious" is all relative.
>
> And it turns out my worry about pipe_discard_from() was unnecessary.
> Yes, the code is buggy. But no, it doesn't matter. Why? There are no
> callers of that function ;)
On the topic of pipe_discard_from(), Al had added that helper in commit
c3497fd009ef ("fix short copy handling in copy_mc_pipe_to_iter()") to
discard unused buffer for copy_mc_to_iter()
Its usage in copy_mc_pipe_to_iter() was later removed in commit
8fad7767edcf ("ITER_PIPE: allocate buffers as we go in copy-to-pipe
primitives) in favor of iov_iter_revert()
pipe_advance() started using it in from commit 2c855de93314 ("ITER_PIPE:
clean pipe_advance() up") however all of that was nuked in commit
3fc40265ae2b ("iov_iter: Kill ITER_PIPE")
generic_file_splice_read() started using it from commit 0d9649341363
("splice: stop abusing iov_iter_advance() to flush a pipe") but
generic_file_splice_read() was later removed in commit c6585011bc1d
("splice: Remove generic_file_splice_read()")
I don't see any in kernel user of this helper currently so can the
wrap-around issue be addressed and the helper be removed later?
>
> That said, I still hope people will take a look at the code and see if
> there's anything else I missed.
>
> Oh, and testing. Testing would be good.
>
> Linus
--
Thanks and Regards,
Prateek
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] include/linux/pipe_fs_i: Add htmldoc annotation for "head_tail" member
2025-03-05 18:08 ` K Prateek Nayak
@ 2025-03-05 18:26 ` Linus Torvalds
0 siblings, 0 replies; 5+ messages in thread
From: Linus Torvalds @ 2025-03-05 18:26 UTC (permalink / raw)
To: K Prateek Nayak
Cc: Oleg Nesterov, Stephen Rothwell, linux-kernel,
Linux Next Mailing List, Swapnil Sapkal
On Wed, 5 Mar 2025 at 08:08, K Prateek Nayak <kprateek.nayak@amd.com> wrote:
>
> > And it turns out my worry about pipe_discard_from() was unnecessary.
> > Yes, the code is buggy. But no, it doesn't matter. Why? There are no
> > callers of that function ;)
>
]> I don't see any in kernel user of this helper currently so can the
> wrap-around issue be addressed and the helper be removed later?
Yes. That's what I did. I still would love to see
- more testing
- explicit limit checking in pipe_resize_ring()
and then I think we could make CONFIG_64BIT use the 16-bit
pipe_index_t too (because not doing so clearly was a mistake: it meant
that people didn't test the 32-bit case, so the wrap-around bugs
weren't as obvious).
Linus
Linus
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-03-05 18:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-05 9:46 linux-next: build warning after merge of Linus' tree Stephen Rothwell
2025-03-05 11:23 ` [PATCH] include/linux/pipe_fs_i: Add htmldoc annotation for "head_tail" member K Prateek Nayak
2025-03-05 17:35 ` Linus Torvalds
2025-03-05 18:08 ` K Prateek Nayak
2025-03-05 18:26 ` Linus Torvalds
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox