All of lore.kernel.org
 help / color / mirror / Atom feed
* erofs: file-backed mount logs "read error -5" when the reader is killed
@ 2026-12-04  0:47 Kel Modderman
  2026-12-04  6:11 ` Gao Xiang
  0 siblings, 1 reply; 3+ messages in thread
From: Kel Modderman @ 2026-12-04  0:47 UTC (permalink / raw)
  To: linux-erofs; +Cc: xiang, chao

[-- Attachment #1: Type: text/plain, Size: 2304 bytes --]

Hi,

On file-backed erofs mounts I see occasional lines like

erofs (device 0:36): read error -5 @ 0 of nid 3909409

That's on the live images of a Debian derivative (aptosid) with a custom
kernel: 7.3.0 plus upstream stable updates, and no erofs patches of its
own:

https://www.google.com/url?q=https://github.com/fullstory/linux-aptosid/tree/master/debian/patches&source=gmail&ust=1796431652282000&sa=E

The root is mounted straight from the image file on an iso9660 cdrom.

In my nightly install tests the four I checked were all
/usr/bin/systemd-tty-ask-password-agent, while apt ran in the live
session, so it looked like a short-lived process being killed while it
paged in.

I can reproduce it with a second file-backed mount and a loop mount of
the same image (zstd, level 3): drop caches, start the agent with its
loader and libraries taken from the mount, SIGTERM it after 0 to 3.9 ms,
300 times each. The file-backed mount logged 80 read errors (one of them
the agent at index 0), the loop mount none. fsck.erofs is clean on the
images.

From the source, a fatal signal makes filemap_read() on the backing file
return a short count (or -EINTR), and erofs_fileio_ki_complete() turns
any short read into -EIO. z_erofs_read_folio() already skips logging
-EINTR, but by then it is -EIO, so it gets logged. The reader that logs
it is being killed anyway, but the message reads like a real I/O error.
The code looks the same in linux-next 20261030.

Is this worth quieting?

Reproducer (run as a user with sudo, IMG is the erofs image file):

#!/bin/bash
IMG=$1
sudo mkdir -p /mnt/fb /mnt/lp
sudo mount -t erofs -o ro "$IMG" /mnt/fb
sudo mount -t erofs -o ro,loop "$IMG" /mnt/lp
fb=$(mountpoint -d /mnt/fb)
lp=$(basename "$(findmnt -no SOURCE /mnt/lp)")
echo "file-backed: $fb, loop: $lp"
sudo dmesg -C
for i in $(seq 1 300); do
for m in fb lp; do
sync
echo 3 | sudo tee /proc/sys/vm/drop_caches >/dev/null
L=/mnt/$m/usr/lib/x86_64-linux-gnu
$L/ld-linux-x86-64.so.2 --library-path $L:$L/systemd \
/mnt/$m/usr/bin/systemd-tty-ask-password-agent \
--watch >/dev/null 2>&1 &
p=$!
sleep 0.00$((RANDOM % 4))$((RANDOM % 10))
kill -TERM $p; wait $p
done
done
echo "file-backed: $(sudo dmesg | grep -c "device $fb): read error")"
echo "loop: $(sudo dmesg | grep -c "device $lp): read error")"

Cheers,
Kel

[-- Attachment #2: Type: text/html, Size: 2963 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-04  6:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  0:47 erofs: file-backed mount logs "read error -5" when the reader is killed Kel Modderman
2026-12-04  6:11 ` Gao Xiang
2026-12-04  6:44   ` Kel Modderman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.