[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGrbwDSU+tidGxPUmKpANUTeCE+vEib5uQGG4DQSR9k-RK-WUg@mail.gmail.com>
Date: Tue, 7 Oct 2025 04:09:08 +0100
From: Dmitry Safonov <dima@...sta.com>
To: David Disseldorp <ddiss@...e.de>
Cc: Dmitry Safonov via B4 Relay <devnull+dima.arista.com@...nel.org>,
Nathan Chancellor <nathan@...nel.org>, Nicolas Schier <nicolas.schier@...ux.dev>,
linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
Nicolas Schier <nsc@...nel.org>
Subject: Re: [PATCH RFC] gen_init_cpio: Do fsync() only on regular files
On Tue, Oct 7, 2025 at 2:17 AM David Disseldorp <ddiss@...e.de> wrote:
[..]
> The code change looks fine, but the commit message is a bit verbose IMO.
> Please drop the first and last paragraphs. The reproducer could also be
> simplified to e.g.
> echo | usr/gen_init_cpio /dev/stdin > /dev/null
hehe, OK, let me simplify that in v2.
>
> With that:
> Reviewed-by: David Disseldorp <ddiss@...e.de>
>
> > Fixes: ae18b94099b0 ("gen_init_cpio: support -o <output_file> parameter")
> > Cc: David Disseldorp <ddiss@...e.de>
> > Cc: Nicolas Schier <nsc@...nel.org>
> > Signed-off-by: Dmitry Safonov <dima@...sta.com>
> > ---
[..]
>
> Another option would be to catch the EINVAL error, e.g.
>
> --- a/usr/gen_init_cpio.c
> +++ b/usr/gen_init_cpio.c
> @@ -112,7 +112,10 @@ static int cpio_trailer(void)
> push_pad(padlen(offset, 512)) < 0)
> return -1;
>
> - return fsync(outfd);
> + if (fsync(outfd) < 0 && errno != EINVAL)
> + return -1;
> +
> + return 0;
> }
>
> It may be a little portable than isfdtype(), but I don't feel strongly
> either way.
Yeah, maybe worth avoiding breking compilation on some weird set ups,
going to use your version for v2.
Thanks,
Dmitry
Powered by blists - more mailing lists