mount command fails with 'relatime' kernel option

Denys Vlasenko vda.linux at googlemail.com
Mon Dec 17 08:49:07 PST 2007


On Monday 17 December 2007 01:06, Michele Sanges wrote:
> Hi,
>
> the kernel is compiled with the options:
>
> 	CONFIG_DEFAULT_RELATIME=y
> 	CONFIG_DEFAULT_RELATIME_VAL=1
>
> The problem occurs only when the mount command takes data from the fstab
> file, because the kernel passes the default parameters.
>
> In other words,
>
> 1)	mount-o remount /
>
> fails with the errors:
>
> 	EXT3-fs: unrecognized mount option "relatime" or missing value
> 	mount: mount /dev/root on / failed: Invalid argument
>
> mounting the device read-only, while
>
> 2)	mount -o remount   /dev/root   /
>
> this succeeds, mounting the file system read/write.

First mount command needs to find out how /dev/root
was mounted before, so it parses /proc/mounts:

brk(0x85bb000)                          = 0x85bb000
open("/proc/mounts", O_RDONLY)          = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f4a000
read(3, "rootfs / rootfs rw 0 0\n/dev/root"..., 1024) = 333
read(3, "", 1024)                       = 0

and then reruns the mount with options collected from /proc/mounts
(since you didn't specify any differing options, it doesn't change
anything):

stat64("/dev/root", {st_mode=S_IFBLK|0600, st_rdev=makedev(8, 8), ...}) = 0
mount("/dev/root", "/", 0x80e3624, MS_RDONLY|MS_REMOUNT|MS_SILENT, "relatime,data=ordered"...) = -1 EINVAL (Invalid argument)
write(2, "mount: mounting /dev/root on / f"..., 56) = 56
exit_group(-1)                          = ?

Pity, you did non specify "strace -s 512" option and we don't see full strings.
Can you redo it?


Second mount does not need to consult /proc/mounts, it just goes ahead and
issues mount syscall:

brk(0x9558000)                          = 0x9558000
stat64("/dev/root", {st_mode=S_IFBLK|0600, st_rdev=makedev(8, 8), ...}) = 0
mount("/dev/root", "/", NULL, MS_REMOUNT|MS_SILENT, NULL) = 0
exit_group(0)                           = ?

Therefore mount calls are different.
Without unabridged strace, I can only guess what exactly went wrong.


Can you also check whether busybox's "mount -o remount /" and util-linux's one
differ (I mean, does util-linux one work? If yes, post its strace too please).
--
vda


More information about the busybox mailing list