mirror of
https://github.com/torvalds/linux.git
synced 2025-11-30 23:16:01 +07:00
gen_init_cpio: Ignore fsync() returning EINVAL on pipes
The reproducer:
echo | ./usr/gen_init_cpio /dev/stdin > /dev/null
fsync() on a pipe fd returns -EINVAL, which makes gen_init_cpio fail.
Ignore -EINVAL from fsync().
Fixes: ae18b94099 ("gen_init_cpio: support -o <output_file> parameter")
Cc: David Disseldorp <ddiss@suse.de>
Cc: Nicolas Schier <nsc@kernel.org>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Link: https://patch.msgid.link/20251007-gen_init_cpio-pipe-v2-1-b098ab94b58a@arista.com
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
This commit is contained in:
committed by
Nathan Chancellor
parent
7ded7d37e5
commit
38492c5743
@@ -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;
|
||||
}
|
||||
|
||||
static int cpio_mkslink(const char *name, const char *target,
|
||||
|
||||
Reference in New Issue
Block a user