[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250209150718.GA17013@redhat.com>
Date: Sun, 9 Feb 2025 16:07:18 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Christian Brauner <brauner@...nel.org>,
Jeff Layton <jlayton@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Cc: David Howells <dhowells@...hat.com>,
"Gautham R. Shenoy" <gautham.shenoy@....com>,
K Prateek Nayak <kprateek.nayak@....com>,
Mateusz Guzik <mjguzik@...il.com>,
Neeraj Upadhyay <Neeraj.Upadhyay@....com>,
Oliver Sang <oliver.sang@...el.com>,
Swapnil Sapkal <swapnil.sapkal@....com>,
WangYuli <wangyuli@...ontech.com>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 0/2] pipe: change pipe_write() to never add a zero-sized
buffer
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(-)
Powered by blists - more mailing lists