Thread View: linux.debian.kernel
4 messages
4 total messages
Started by Marco
Fri, 06 Nov 2026 09:20
Bug#1153147: NFS client: mkdir on existing, uncached dir returns EROFS instead of EEXIST under ro bind mount
Author: Marco
Date: Fri, 06 Nov 2026 09:20
Date: Fri, 06 Nov 2026 09:20
64 lines
4134 bytes
4134 bytes
Package: src:linux Version: 7.2.12-1 Severity: normal Dear Maintainer, on Linux 6.12.48 (Debian 13) and 7.1.6 (Debian 14), calling mkdir() on a directory that already exists on an NFSv4.2 mount, through a read-only bind mount, returns EROFS instead of EEXIST, as long as the directory has not been looked up (e.g. listed via readdir of its parent) by this client yet. Also reproducible on Debian 14 with a custom compiled 7.3.1 kernel. This breaks Flatpak/bubblewrap, which creates mount points with mkdir() and treats EEXIST as success but EROFS as fatal. With the Flatpak tree on NFS, apps fail after each reboot with "bwrap: Can't mkdir parents for ...: Read-only file system" until the tree has been walked once. The issue only occurs on NFS mounts, local file systems work fine with Flatpak/bubblewrap. To reproduce: # vanilla Debian install (stock kernel or 7.3.1, same result) # set it up (root) apt install nfs-kernel-server mkdir -p /mnt/nfstest /etc/exports.d /srv/nfstest echo '/srv/nfstest 127.0.0.1(rw,sync,no_subtree_check,no_root_squash)' > /etc/exports.d/nfstest.exports mount -t tmpfs -o size=16m tmpfs /srv/nfstest mkdir -p /srv/nfstest/reprotest1/sub exportfs -ra mount -t nfs4 -o vers=4.2 127.0.0.1:/srv/nfstest /mnt/nfstest # test (as regular user) # 1st invocation unshare -rm sh -c 'mount --bind "$1" "$1" && mount -o remount,bind,ro "$1" && mkdir "$1/sub"' sh /mnt/nfstest/reprotest1 # → mkdir: cannot create directory ‘/mnt/nfstest/reprotest1/sub’: Read-only file system # walk the file system ls /mnt/nfstest/reprotest1 # → sub # 2nd invocation unshare -rm sh -c 'mount --bind "$1" "$1" && mount -o remount,bind,ro "$1" && mkdir "$1/sub"' sh /mnt/nfstest/reprotest1 # → mkdir: cannot create directory ‘/mnt/nfstest/reprotest1/sub’: File exists strace of the original failure (bwrap): mkdirat(7, "app", 0700) = -1 EEXIST (File exists) mkdirat(8, "share", 0700) = -1 EROFS (Read-only file system) (but "share" exists) I believe this behaviour is not intended. Reported upstream: https://lore.kernel.org/linux-nfs/45cc029f-6e56-4c10-ae9e-33fba627a7d3@app.fastmail.com/T/#t Regards Marco
Bug#1153147: NFS client: mkdir on existing, uncached dir returns EROFS instead of EEXIST under ro bind mount
Author: Bastian Blank
Date: Fri, 06 Nov 2026 09:40
Date: Fri, 06 Nov 2026 09:40
13 lines
2240 bytes
2240 bytes
On Fri, Nov 06, 2026 at 10:05:16AM +0100, Marco wrote: > I believe this behaviour is not intended. Reported upstream: I would say this is incorrect use of mkdir. Both errors are correct and there is no order of errors defined. Use stat if you want to know if something exists. Bastian -- Insults are effective only where emotion is present. -- Spock, "Who Mourns for Adonais?" stardate 3468.1
Bug#1153147: NFS client: mkdir on existing, uncached dir returns EROFS instead of EEXIST under ro bind mount
Author: Marco
Date: Fri, 06 Nov 2026 10:10
Date: Fri, 06 Nov 2026 10:10
22 lines
2786 bytes
2786 bytes
On Fri, 6 Nov 2026 10:28:34 +0100 Bastian Blank <waldi@debian.org> wrote: > I would say this is incorrect use of mkdir. So should I file this bug against bubblewrap or flatpak then? > Both errors are correct True. > and there is no order of errors defined. Yet, the behaviour is inconsistent. A simple “ls” in between the invocations changes the error type. This feels wrong. > Use stat if you want to know if something exists. Seems reasonable. Marco
Bug#1153147: NFS client: mkdir on existing, uncached dir returns EROFS instead of EEXIST under ro bind mount
Author: Marco
Date: Mon, 23 Nov 2026 10:50
Date: Mon, 23 Nov 2026 10:50
5 lines
2269 bytes
2269 bytes
Reported against bubblewrap: https://github.com/containers/bubblewrap/issues/827 Fix in progress (not merged, yet).
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads