linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] pipe: change pipe_write() to never add a zero-sized buffer
@ 2025-02-09 15:07 Oleg Nesterov
  2025-02-09 15:07 ` [PATCH 1/2] " Oleg Nesterov
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Oleg Nesterov @ 2025-02-09 15:07 UTC (permalink / raw)
  To: Christian Brauner, Jeff Layton, Linus Torvalds
  Cc: David Howells, Gautham R. Shenoy, K Prateek Nayak, Mateusz Guzik,
	Neeraj Upadhyay, Oliver Sang, Swapnil Sapkal, WangYuli,
	linux-fsdevel, linux-kernel

Please review.

pipe_write() can insert the empty buffer and this looks very confusing
to me. Because it looks obviously unnecessary and complicates the code.

In fact this logic doesn't even look strictly correct. For example,
eat_empty_buffer() simply updates pipe->tail but (unlike pipe_read) it
doesn't wake the writers.

But is pipe_write() is the only possible source of buf->len == 0 ?
I am not 100% sure, fs/splice.c is very nontrivial, but it seems that
this code at least tries to not add a zero-sized buf into pipe->bufs.

Oleg.
---

 fs/pipe.c                 | 47 ++++++++++-------------------------------------
 fs/splice.c               | 14 ++++++--------
 include/linux/pipe_fs_i.h |  6 ++++++
 3 files changed, 22 insertions(+), 45 deletions(-)


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

end of thread, other threads:[~2025-02-11  3:59 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-09 15:07 [PATCH 0/2] pipe: change pipe_write() to never add a zero-sized buffer Oleg Nesterov
2025-02-09 15:07 ` [PATCH 1/2] " Oleg Nesterov
2025-02-09 17:26   ` Linus Torvalds
2025-02-09 18:02     ` Oleg Nesterov
2025-02-09 18:17       ` Linus Torvalds
2025-02-09 18:44         ` Oleg Nesterov
2025-02-09 18:52           ` Linus Torvalds
2025-02-09 19:15             ` Oleg Nesterov
2025-02-09 23:39               ` K Prateek Nayak
2025-02-10 17:22                 ` Oleg Nesterov
2025-02-10 17:37                   ` Linus Torvalds
2025-02-10 18:36                     ` Oleg Nesterov
2025-02-11  3:59                   ` K Prateek Nayak
2025-02-09 15:08 ` [PATCH 2/2] splice: add some pipe_buf_assert_len() checks Oleg Nesterov
2025-02-10 11:40 ` [PATCH v2 1/1] pipe: change pipe_write() to never add a zero-sized buffer Oleg Nesterov
2025-02-10 12:52 ` [PATCH 0/2] " Christian Brauner

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).