[BusyBox 0001589]: mount fail with invalid argument

bugs at busybox.net bugs at busybox.net
Fri Nov 16 09:49:12 UTC 2007


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=1589 
====================================================================== 
Reported By:                thesame
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1589
Category:                   Other
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
====================================================================== 
Date Submitted:             11-13-2007 16:50 PST
Last Modified:              11-16-2007 01:49 PST
====================================================================== 
Summary:                    mount fail with invalid argument
Description: 
Using linux-live-scripts and busybox 1.4.* up to 1.8.0, mount fail with
invalid argument during boot (mount -o loop,ro /usr.lzm /usr) but if
manually used the mount it works. The fs is a squashfs with lmza patches
on a 64-bit Linux, kernel 2.6.23.1. squashfs is present in
/proc/filesystems
====================================================================== 

---------------------------------------------------------------------- 
 thesame - 11-13-07 16:54  
---------------------------------------------------------------------- 
typo: up to 1.8.1* 

---------------------------------------------------------------------- 
 vda - 11-13-07 18:55  
---------------------------------------------------------------------- 
Can you provide strace output of both unsuccessful mount at boot and
successful mount later on? Also give lsmod output at both points. 

---------------------------------------------------------------------- 
 thesame - 11-14-07 04:47  
---------------------------------------------------------------------- 
Sorry for this, I was too tired. The loop mount work great, the problem is
when the cdrom device is mounted using mount in a bash script/function at
boot or manually and only on a 64-bit, the 32-bit version works. From
there is the invalid argument. I'll be back with a strace later. 

---------------------------------------------------------------------- 
 thesame - 11-14-07 06:58  
---------------------------------------------------------------------- 
Here is the strace and lsmod using BusyBox v1.8.1


execve("/sbin/mount", ["mount", "-n", "-o",
"noatime,users,suid,dev,exec,ro", "/dev/hda", "/mnt/hda"], [/* 9 vars */])
= 0
brk(0)                                  = 0x641000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2b2642d26000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = -1 ENOENT (No such file or
directory)
open("/lib/tls/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat("/lib/tls/x86_64", 0x7fff67d9ef40) = -1 ENOENT (No such file or
directory)
open("/lib/tls/libc.so.6", O_RDONLY)    = -1 ENOENT (No such file or
directory)
stat("/lib/tls", 0x7fff67d9ef40)        = -1 ENOENT (No such file or
directory)
open("/lib/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat("/lib/x86_64", 0x7fff67d9ef40)     = -1 ENOENT (No such file or
directory)
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\331"..., 832)
= 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1602784, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2b2642d27000
mmap(NULL, 3465368, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0)
= 0x2b2642f27000
mprotect(0x2b264306d000, 2093056, PROT_NONE) = 0
mmap(0x2b264326c000, 20480, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x145000) = 0x2b264326c000
mmap(0x2b2643271000, 16536, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b2643271000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2b2643276000
arch_prctl(ARCH_SET_FS, 0x2b26432766f0) = 0
mprotect(0x2b264326c000, 12288, PROT_READ) = 0
getuid()                                = 0
brk(0)                                  = 0x641000
brk(0x662000)                           = 0x662000
stat("/dev/hda", {st_mode=S_IFBLK|0660, st_rdev=makedev(3, 0), ...}) = 0
open("/etc/filesystems", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=17, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2b2643277000
read(3, "ext3\next2\nvfat\n*\n", 1024)  = 17
read(3, "", 1024)                       = 0
open("/proc/filesystems", O_RDONLY)     = 4
fstat(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2b2643278000
read(4, "nodev\tsysfs\nnodev\trootfs\nnodev\tb"..., 1024) = 443
read(4, "", 1024)                       = 0
mount("/dev/hda", "/mnt/hda", "ext3", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "ext2", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "vfat", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "reiserfs", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "ext3", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "ext2", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "minix", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "msdos", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "vfat", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "iso9660", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "ntfs", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "udf", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "jfs", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "xfs", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "ocfs2", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "gfs2", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 ENOMEM (Cannot allocate memory)
mount("/dev/hda", "/mnt/hda", "gfs2meta", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 ENOENT (No such file or directory)
mount("/dev/hda", "/mnt/hda", "squashfs", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
mount("/dev/hda", "/mnt/hda", "fuseblk", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)
write(2, "mount: mounting /dev/hda on /mnt"..., 62mount: mounting /dev/hda
on /mnt/hda failed: Invalid argument
) = 62
exit_group(-1)                          = ?
Process 1485 detached

Module                  Size  Used by
yenta_socket 33164 0 - Live 0xffffffff88073000
rsrc_nonstatic 17152 1 yenta_socket, Live 0xffffffff8806d000
pcmcia 49688 0 - Live 0xffffffff8805f000
pcmcia_core 49572 3 yenta_socket,rsrc_nonstatic,pcmcia, Live
0xffffffff88051000
fuse 57008 0 - Live 0xffffffff88042000
aufs 146864 0 - Live 0xffffffff8801d000
squashfs 48528 1 - Live 0xffffffff88010000 (F)
sqlzma 8836 1 squashfs, Live 0xffffffff8800c000
unlzma 8960 1 sqlzma, Live 0xffffffff88008000
loop 24964 2 - Live 0xffffffff88000000

 

---------------------------------------------------------------------- 
 vda - 11-14-07 23:10  
---------------------------------------------------------------------- 
But this is not the output of "mount -o loop,ro /usr.lzm /usr"!

You have shown strace output of
"mount -n -o noatime,users,suid,dev,exec,ro /dev/hda /mnt/hda"
which seems to fail because /dev/hda doesn't contain a filesystem known to
your kernel.

What will be interesting to see is strace of a case where busybox mount
fails, but "standard" (util-linux's?) mount succeeds. Seeing both straces
will be very useful for bug hunting. 

---------------------------------------------------------------------- 
 thesame - 11-15-07 03:05  
---------------------------------------------------------------------- 
I told you in a earlier note, that the problem is mounting a cdrom (see
note 0002915). If I use mount from util-linux everything works great! 

---------------------------------------------------------------------- 
 vda - 11-15-07 09:16  
---------------------------------------------------------------------- 
Understood. Can you show me the strace of util-linux's mount? 

---------------------------------------------------------------------- 
 thesame - 11-15-07 12:55  
---------------------------------------------------------------------- 
execve("/sbin/mount.bin", ["mount.bin", "-n", "-o",
"noatime,users,suid,dev,exec,ro", "/dev/hda", "/mnt/hda"], [/* 9 vars */])
= 0
brk(0)                                  = 0x612000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2ae47067f000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = -1 ENOENT (No such file or
directory)
open("/lib/tls/x86_64/libblkid.so.1", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat("/lib/tls/x86_64", 0x7fff3a4435e0) = -1 ENOENT (No such file or
directory)
open("/lib/tls/libblkid.so.1", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat("/lib/tls", 0x7fff3a4435e0)        = -1 ENOENT (No such file or
directory)
open("/lib/x86_64/libblkid.so.1", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat("/lib/x86_64", 0x7fff3a4435e0)     = -1 ENOENT (No such file or
directory)
open("/lib/libblkid.so.1", O_RDONLY)    = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 at 2\0\0\0"..., 832)
= 832
fstat(3, {st_mode=S_IFREG|0755, st_size=38928, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2ae470680000
mmap(NULL, 2133928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0)
= 0x2ae470880000
mprotect(0x2ae470888000, 2097152, PROT_NONE) = 0
mmap(0x2ae470a88000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x2ae470a88000
close(3)                                = 0
open("/lib/libuuid.so.1", O_RDONLY)     = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\r\0\0\0"..., 832)
= 832
fstat(3, {st_mode=S_IFREG|0755, st_size=10048, ...}) = 0
mmap(NULL, 2105144, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0)
= 0x2ae470a89000
mprotect(0x2ae470a8b000, 2093056, PROT_NONE) = 0
mmap(0x2ae470c8a000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x2ae470c8a000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\331"..., 832)
= 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1602784, ...}) = 0
mmap(NULL, 3465368, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0)
= 0x2ae470c8b000
mprotect(0x2ae470dd1000, 2093056, PROT_NONE) = 0
mmap(0x2ae470fd0000, 20480, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x145000) = 0x2ae470fd0000
mmap(0x2ae470fd5000, 16536, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2ae470fd5000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2ae470fda000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2ae470fdb000
arch_prctl(ARCH_SET_FS, 0x2ae470fdacd0) = 0
mprotect(0x2ae470fd0000, 12288, PROT_READ) = 0
brk(0)                                  = 0x612000
brk(0x633000)                           = 0x633000
umask(022)                              = 022
open("/dev/null", O_RDWR)               = 3
close(3)                                = 0
getuid()                                = 0
geteuid()                               = 0
getgid()                                = 0
getegid()                               = 0
prctl(0x3, 0, 0, 0, 0)                  = 1
open("/etc/blkid.tab", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=207, ...}) = 0
fcntl(3, F_GETFL)                       = 0x8000 (flags
O_RDONLY|O_LARGEFILE)
fstat(3, {st_mode=S_IFREG|0644, st_size=207, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2ae470fdc000
lseek(3, 0, SEEK_CUR)                   = 0
read(3, "<device DEVNO=\"0x0300\" TIME=\"119"..., 1024) = 207
read(3, "", 1024)                       = 0
close(3)                                = 0
munmap(0x2ae470fdc000, 4096)            = 0
getuid()                                = 0
geteuid()                               = 0
stat("/dev/hda", {st_mode=S_IFBLK|0660, st_rdev=makedev(3, 0), ...}) = 0
rt_sigprocmask(SIG_BLOCK, ~[TRAP SEGV RTMIN RT_1], NULL, 8) = 0
gettimeofday({1195167057, 163812}, NULL) = 0
open("/dev/hda", O_RDONLY)              = 3
fstat(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(3, 0), ...}) = 0
lseek(3, 0, SEEK_SET)                   = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
69632) = 69632
gettimeofday({1195167057, 167434}, NULL) = 0
close(3)                                = 0
mount("/dev/hda", "/mnt/hda", "iso9660", MS_MGC_VAL|MS_RDONLY|MS_NOATIME,
"") = 0
readlink("/dev", 0x7fff3a441a60, 4096)  = -1 EINVAL (Invalid argument)
readlink("/dev/hda", 0x7fff3a441a60, 4096) = -1 EINVAL (Invalid argument)
readlink("/mnt", 0x7fff3a441a60, 4096)  = -1 EINVAL (Invalid argument)
readlink("/mnt/hda", 0x7fff3a441a60, 4096) = -1 EINVAL (Invalid argument)
rt_sigprocmask(SIG_UNBLOCK, ~[TRAP SEGV RTMIN RT_1], NULL, 8) = 0
stat("/etc/blkid.tab", {st_mode=S_IFREG|0644, st_size=207, ...}) = 0
access("/etc/blkid.tab", W_OK)          = 0
gettimeofday({1195167057, 172577}, NULL) = 0
getpid()                                = 1442
open("/etc/blkid.tab-htjbY7", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
fcntl(3, F_GETFL)                       = 0x8002 (flags
O_RDWR|O_LARGEFILE)
fstat(3, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2ae470fdc000
lseek(3, 0, SEEK_CUR)                   = 0
fchmod(3, 0644)                         = 0
write(3, "<device DEVNO=\"0x0300\" TIME=\"119"..., 207) = 207
close(3)                                = 0
munmap(0x2ae470fdc000, 4096)            = 0
unlink("/etc/blkid.tab.old")            = 0
link("/etc/blkid.tab", "/etc/blkid.tab.old") = 0
rename("/etc/blkid.tab-htjbY7", "/etc/blkid.tab") = 0
exit_group(0)                           = ?
Process 1442 detached 

---------------------------------------------------------------------- 
 vda - 11-15-07 15:35  
---------------------------------------------------------------------- 
It's very simple:
bbox:
mount("/dev/hda", "/mnt/hda", "iso9660", MS_RDONLY|MS_NOATIME|MS_SILENT,
"users") = -1 EINVAL (Invalid argument)

util-linux:
mount("/dev/hda", "/mnt/hda", "iso9660", MS_MGC_VAL|MS_RDONLY|MS_NOATIME,
"") = 0

I bet it's "users" which scares your kernel away.

Try enabling CONFIG_DESKTOP, in this case mount handles "users" too (by
removing  it from options string. (You may see that in mount.c) 

---------------------------------------------------------------------- 
 thesame - 11-16-07 01:49  
---------------------------------------------------------------------- 
Now is OK, that CONFIG_DESKTOP solved.

Thanks! 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-13-07 16:50  thesame        New Issue                                    
11-13-07 16:50  thesame        Status                   new => assigned     
11-13-07 16:50  thesame        Assigned To               => BusyBox         
11-13-07 16:54  thesame        Note Added: 0002912                          
11-13-07 16:54  thesame        Issue Monitored: thesame                     
11-13-07 16:54  thesame        Issue End Monitor: thesame                    
11-13-07 18:55  vda            Note Added: 0002913                          
11-13-07 18:55  vda            Status                   assigned => feedback
11-14-07 04:47  thesame        Note Added: 0002915                          
11-14-07 06:54  thesame        Note Added: 0002916                          
11-14-07 06:58  thesame        Note Edited: 0002916                         
11-14-07 23:10  vda            Note Added: 0002918                          
11-15-07 03:05  thesame        Note Added: 0002923                          
11-15-07 09:16  vda            Note Added: 0002925                          
11-15-07 12:55  thesame        Note Added: 0002926                          
11-15-07 15:35  vda            Note Added: 0002927                          
11-16-07 01:49  thesame        Note Added: 0002929                          
======================================================================




More information about the busybox-cvs mailing list