You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mwhudson@orcrist:~/tmp/lp-2037417$ cat repro2.sh
#!/bin/bashset -eux
mkdir -p lower work upper mountpoint
mount -o ro,lowerdir=lower,upperdir=upper,workdir=work -t overlay overlay mountpoint
mount -o remount,rw mountpoint
mwhudson@orcrist:~/tmp/lp-2037417$ sudo bash repro2.sh
+ mkdir -p lower work upper mountpoint
+ mount -o ro,lowerdir=lower,upperdir=upper,workdir=work -t overlay overlay mountpoint
+ mount -o remount,rw mountpoint
mount: /home/mwhudson/tmp/lp-2037417/mountpoint: mount point not mounted or bad option.
dmesg(1) may have more information after failed mount system call.
The failure seems to be this syscall:
mwhudson@orcrist:~/tmp/lp-2037417$ sudo strace -e fsconfig mount -o remount,rw mountpoint
fsconfig(4, FSCONFIG_SET_STRING, "lowerdir", "lower", 0) = -1 EINVAL (Invalid argument)
mount: /home/mwhudson/tmp/lp-2037417/mountpoint: mount point not mounted or bad option.
dmesg(1) may have more information after failed mount system call.
+++ exited with 32 +++
I think it would be reasonable for mount -o remount,lowerdir=/something/new to error rather than silently do nothing but it's definitely surprising to me that remount,rw or remount,ro would fail.
(It's probably not strictly necessary to call those in the boot process that's currently failing but it's definitely breaking something that used to work)
The remount functionality follows the standard way the mount command works with options
from fstab. This means that mount does not read fstab (or mtab) only when both device and
dir are specified.
mount -o remount,rw /dev/foo /dir
After this call all old mount options are replaced and arbitrary stuff from fstab (or
mtab) is ignored, except the loop= option which is internally generated and maintained by
the mount command.
mount -o remount,rw /dir
After this call, mount reads fstab and merges these options with the options from the
command line (-o). If no mountpoint is found in fstab, then it defaults to mount options
from /proc/self/mountinfo.
And note there is also --options-mode <ignore, append, prepend, replace> to work wit options from fstab/mtab.
Activity
t-8ch commentedon Oct 5, 2023
The inability to reconfigure overlayfs seems to be intentional:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/overlayfs/params.c?id=3006adf3be79cde4d14b1800b963b82b6e5572e0#n549
It never did anything but when using the new API it actively throws an error.
mwhudson commentedon Oct 5, 2023
I think it would be reasonable for mount -o remount,lowerdir=/something/new to error rather than silently do nothing but it's definitely surprising to me that remount,rw or remount,ro would fail.
(It's probably not strictly necessary to call those in the boot process that's currently failing but it's definitely breaking something that used to work)
t-8ch commentedon Oct 5, 2023
The best way forward would probably be to make sure to only set filesystem options that are not already set to the same value.
karelzak commentedon Nov 27, 2023
Not sure if I see an error there. man mount:
And note there is also --options-mode <ignore, append, prepend, replace> to work wit options from fstab/mtab.
karelzak commentedon Nov 28, 2023
Please let's continue the discussion on #2576 to keep it all in one place.