read-only bind mounts cause spurious EROFS
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
I installed the Intrepid kernel (linux-
/dev being read-only bind mounted on /dev/.static/dev somehow causes Linux to return EROFS for only some operations on the root filesystem. (My root filesystem is XFS. Yes, this works, you just can't setup grub on it from linux, so I boot grub from USB or PXE after the initial install of Ubuntu.)
I don't have this problem on my pre-Intrepid desktop at home running 2.6.27-4-generic, with a JFS root filesystem (and /dev read-only bind mounted). And I didn't notice it on my pre-Intrepid laptop with 2.6.27-5-generic (IIRC), with an ext3 rootfs. It's not on, so I can't check it's status right now. So either a server kernel bug, or an XFS bug, I'd guess.
symptoms:
# strace touch /etc/bar # /etc/bar doesn't exist beforehand
close(0) = 0
open("/etc/bar", O_WRONLY|
syscall_280(0, 0, 0, 0, 0x2, 0, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2) = -1 (errno 30)
utimes("/etc/bar", NULL) = -1 EROFS (Read-only file system)
close(0) = 0
touch: setting times of `/etc/bar': Read-only file system
exit_group(1) = ?
/etc/bar now exists.
# strace chmod 644 /etc/mtab
stat("/etc/mtab", {st_mode=
fchmodat(AT_FDCWD, "/etc/mtab", 0644) = -1 EROFS (Read-only file system)
/proc/mounts showed that / was mounted rw, but /dev/.static/dev was mounted ro.
mount /dev /dev/.static/dev -o remount,rw makes metadata ops work again on the root filesystem.
/proc/mounts (after remount)
rootfs / rootfs rw 0 0
/dev/disk/
/dev/disk/
/etc/fstab
# /dev/sda1
UUID=dc2372d6-
It's a 10GB filesystem, so I probably don't need inode64...
Let me know if you have any problem reproducing this, and I can get more details on my server.
Changed in linux: | |
assignee: | nobody → ubuntu-kernel-team |
importance: | Undecided → Medium |
status: | New → Triaged |
I was able to reproduce this on another server. It happens on XFS with relatime, inode64, noikeep. It does not happen on 2.6.27-5 with just relatime. I haven't checked which of inode64 or noikeep is the problem.