lkml.org 
[lkml]   [2022]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] coredump: Use vmsplice_to_pipe() for pipes in dump_emit_page()
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

\
 
 \ /
  Last update: 2022-11-30 04:42    [W:0.097 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site