From: Peilin Ye <yepeilin.cs@gmail.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Peilin Ye <peilin.ye@bytedance.com>,
Cong Wang <cong.wang@bytedance.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] coredump: Use vmsplice_to_pipe() for pipes in dump_emit_page()
Date: Tue, 29 Nov 2022 19:40:59 -0800 [thread overview]
Message-ID: <20221130034059.GA2246@bytedance> (raw)
In-Reply-To: <Y3hfmYF6b5T35Xqi@ZenIV>
On Sat, Nov 19, 2022 at 04:46:17AM +0000, Al Viro wrote:
> On Mon, Oct 31, 2022 at 02:03:49PM -0700, Peilin Ye wrote:
>
> > + n = vmsplice_to_pipe(file, &iter, 0);
> > + if (n == -EBADF)
> > + n = __kernel_write_iter(cprm->file, &iter, &pos);
>
> Yuck. If anything, I would rather put a flag into coredump_params
> and check it instead; this check for -EBADF is both unidiomatic and
> brittle. Suppose someday somebody looks at vmsplice(2) and
> decides that it would make sense to lift the "is it a pipe" check
> into e.g. vmsplice_type(). There's no obvious reasons not to,
> unless one happens to know that coredump relies upon that check done
> in vmsplice_to_pipe(). It's asking for trouble several years down
> the road.
>
> Make it explicit and independent from details of error checking
> in vmsplice(2).
Thanks for the review! I was a bit hesitant about introducing a new
field to coredump_params for this optimization. Will do it in v3.
Peilin Ye
next prev parent reply other threads:[~2022-11-30 3:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-29 0:51 [PATCH v1] coredump: Use vmsplice_to_pipe() for pipes in dump_emit_page() Peilin Ye
2022-10-29 7:20 ` kernel test robot
2022-10-29 9:12 ` kernel test robot
2022-10-31 21:03 ` [PATCH v2] " Peilin Ye
2022-11-19 0:17 ` [PATCH v2 RESEND] " Peilin Ye
2022-11-19 4:46 ` [PATCH v2] " Al Viro
2022-11-30 3:40 ` Peilin Ye [this message]
2022-11-30 5:37 ` [PATCH v3] " Peilin Ye
2023-01-12 22:43 ` [PATCH v3 RESEND] " Peilin Ye
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221130034059.GA2246@bytedance \
--to=yepeilin.cs@gmail.com \
--cc=cong.wang@bytedance.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peilin.ye@bytedance.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).