mount:nfsmount failed: Bad file descriptor

xiao.liang at cn.alps.com xiao.liang at cn.alps.com
Tue Aug 28 11:11:01 UTC 2007


Hi,
        thank you very much for you response! The busybox is 1.3.1. I will 
try 1.6.1 tomorrow. But i use ethereal to catch logs on the server side 
and found that the server can receive the TCP packets from client and 
response. But when it receive the mount service based on RPC, RPC version 
is 2. Mount service program version is 1. But  it just does not reponse. 
So, i think this must be sth wrong, i will catch a successful nfs/mount 
log tomorrow.Thanks again!




Denys Vlasenko <vda.linux at googlemail.com> 
08/28/2007 06:56 PM

宛先
xiao.liang at cn.alps.com
cc
busybox at busybox.net
"hinko.kocevar at cetrtapot.si" <hinko.kocevar at cetrtapot.si>
件名
Re: mount:nfsmount failed: Bad file descriptor






On Tuesday 28 August 2007 04:33, xiao.liang at cn.alps.com wrote:
> When use strace the log is look like this:
>
> root# cat mount.log
> execve("/bin/mount", ["mount", "-t", "nfs", "192.168.1.6:/opt/Qtopia_2",
> "/opt/Qtopia_2"], [/* 10 vars */]) = 0
> uname({sys="Linux", node="imx21", ...}) = 0
> brk(0)                                  = 0xabeec
> old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 
-1,
> 0) = 0x40015000
> open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or
> directory)
> open("/etc/ld.so.cache", O_RDONLY)      = -1 ENOENT (No such file or
> directory)
> open("/lib/v5EJl/fast-mult/half/libcrypt.so.1", O_RDONLY) = -1 ENOENT 
(No
> such file or directory)
> stat64("/lib/v5EJl/fast-mult/half", 0xbffff2bc) = -1 ENOENT (No such 
file
> or directory)
> open("/lib/v5EJl/fast-mult/libcrypt.so.1", O_RDONLY) = -1 ENOENT (No 
such
> file or directory)
...
> sendto(3, "]\234\333\177\0\0\0\0\0\0\0\2\0\1\206\245\0\0\0\1\0\0\0"...,
> 88, 0, {sa_family=AF_INET, sin_port=htons(635), sin_addr=inet_addr8
> poll([{fd=3, events=POLLIN}], 1, 3000)  = 0
> ioctl(3, 0x8912, 0xbfffcecc)            = 0
> ioctl(3, 0x8913, 0xbfffced4)            = 0
> sendto(3, "]\234\333\177\0\0\0\0\0\0\0\2\0\1\206\245\0\0\0\1\0\0\0"...,
> 88, 0, {sa_family=AF_INET, sin_port=htons(635), sin_addr=inet_addr8
> poll([{fd=3, events=POLLIN}], 1, 3000)  = 0
> ioctl(3, 0x8912, 0xbfffcecc)            = 0
> ioctl(3, 0x8913, 0xbfffced4)            = 0
> write(2, "mount: RPC: Timed out\n", 22) = 22
> close(3)                                = 0
> close(3)                                = -1 EBADF (Bad file descriptor)
> write(2, "mount: ", 7)                  = 7
> write(2, "nfsmount failed", 15)         = 15
> write(2, ": Bad file descriptor\n", 22) = 22
> write(2, "mount: ", 7)                  = 7
> write(2, "Mounting 192.168.1.6:/opt/Qtopia"..., 58) = 58
> write(2, ": Bad file descriptor\n", 22) = 22
> _exit(1)                                = ?


Thank you for this wonderfully linewrapped listing.
It was a real joy fixing it up ;)

Ok, Im serious again. Is this 1.6.1?
if it is not, please try 1.6.1.
If it is, please try adding "msock = -1" in mount.c:

                        /* Connection refused */
                        if (!daemonized && prevt == 0) /* print just once 
*/
                                error_msg_rpc(clnt_sperror(mclient, " "));
                        auth_destroy(mclient->cl_auth);
                        clnt_destroy(mclient);
                        mclient = 0;
                        close(msock);
+                       msock = -1;

and here:

        /* clean up */

        auth_destroy(mclient->cl_auth);
        clnt_destroy(mclient);
        close(msock);
+       msock = -1;

This may fix extra close() and prevent bogus error message about
"Bad file descriptor". In reality you are seeing timeout:


time(NULL)                              = 197
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
getpid()                                = 60
bind(3, {sa_family=AF_INET, sin_port=htons(660), 
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
connect(3, {sa_family=AF_INET, sin_port=htons(111), 
sin_addr=inet_addr("192.168.1.6")}, 16) = -1 ETIMEDOUT (Connection timed 
out)
close(3)                                = 0
brk(0)                                  = 0xad000
brk(0xb1000)                            = 0xb1000
gettimeofday({386, 767720}, NULL)       = 0

See? Connection to portmapper failed after almost 200 seconds of trying.
And then attempts to use default port and reach mount directly time out 
too
(poll() waits for 3 seconds and returns 0 -> no reply received):

socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(661), 
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
ioctl(3, FIONBIO, [1])                  = 0
setsockopt(3, SOL_IP, IP_RECVERR, [1], 4) = 0
uname({sys="Linux", node="imx21", ...}) = 0
geteuid32()                             = 0
getegid32()                             = 0
getgroups32(0x20, 0xbffff0bc)           = 0
gettimeofday({386, 811220}, NULL)       = 0
sendto(3, "]\234\333\177\0\0\0\0\0\0\0\2\0\1\206\245\0\0\0\1\0\0\0"..., 
88, 0, 
{sa_family=AF_INET, sin_port=htons(635), sin_addr=inet_addr8
poll([{fd=3, events=POLLIN}], 1, 3000)  = 0
ioctl(3, 0x8912, 0xbfffcecc)            = 0
ioctl(3, 0x8913, 0xbfffced4)            = 0
sendto(3, "]\234\333\177\0\0\0\0\0\0\0\2\0\1\206\245\0\0\0\1\0\0\0"..., 
88, 0, 
{sa_family=AF_INET, sin_port=htons(635), sin_addr=inet_addr8
poll([{fd=3, events=POLLIN}], 1, 3000)  = 0
ioctl(3, 0x8912, 0xbfffcecc)            = 0
ioctl(3, 0x8913, 0xbfffced4)            = 0
sendto(3, "]\234\333\177\0\0\0\0\0\0\0\2\0\1\206\245\0\0\0\1\0\0\0"..., 
88, 0, 
{sa_family=AF_INET, sin_port=htons(635), sin_addr=inet_addr8
poll([{fd=3, events=POLLIN}], 1, 3000)  = 0
ioctl(3, 0x8912, 0xbfffcecc)            = 0
ioctl(3, 0x8913, 0xbfffced4)            = 0
sendto(3, "]\234\333\177\0\0\0\0\0\0\0\2\0\1\206\245\0\0\0\1\0\0\0"..., 
88, 0, 
{sa_family=AF_INET, sin_port=htons(635), sin_addr=inet_addr8
poll([{fd=3, events=POLLIN}], 1, 3000)  = 0
ioctl(3, 0x8912, 0xbfffcecc)            = 0
ioctl(3, 0x8913, 0xbfffced4)            = 0
sendto(3, "]\234\333\177\0\0\0\0\0\0\0\2\0\1\206\245\0\0\0\1\0\0\0"..., 
88, 0, 
{sa_family=AF_INET, sin_port=htons(635), sin_addr=inet_addr8
poll([{fd=3, events=POLLIN}], 1, 3000)  = 0
ioctl(3, 0x8912, 0xbfffcecc)            = 0
ioctl(3, 0x8913, 0xbfffced4)            = 0
sendto(3, "]\234\333\177\0\0\0\0\0\0\0\2\0\1\206\245\0\0\0\1\0\0\0"..., 
88, 0, 
{sa_family=AF_INET, sin_port=htons(635), sin_addr=inet_addr8
poll([{fd=3, events=POLLIN}], 1, 3000)  = 0
ioctl(3, 0x8912, 0xbfffcecc)            = 0
ioctl(3, 0x8913, 0xbfffced4)            = 0
sendto(3, "]\234\333\177\0\0\0\0\0\0\0\2\0\1\206\245\0\0\0\1\0\0\0"..., 
88, 0, 
{sa_family=AF_INET, sin_port=htons(635), sin_addr=inet_addr8
poll([{fd=3, events=POLLIN}], 1, 3000)  = 0
ioctl(3, 0x8912, 0xbfffcecc)            = 0
ioctl(3, 0x8913, 0xbfffced4)            = 0
write(2, "mount: RPC: Timed out\n", 22) = 22
close(3)                                = 0
close(3)                                = -1 EBADF (Bad file descriptor)
write(2, "mount: ", 7)                  = 7
write(2, "nfsmount failed", 15)         = 15
write(2, ": Bad file descriptor\n", 22) = 22


Apart from bogus close() screwing up error code, I dont see
any problem on client side. It simply cannot reach the server.
--
vda

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20070828/5a1e6e4b/attachment-0002.htm 


More information about the busybox mailing list