Subject: kern/12288: Bad address while trying to read a file from an nfs mounted filesystem
To: None <gnats-bugs@gnats.netbsd.org>
From: None <bernd@arresum.inka.de>
List: netbsd-bugs
Date: 02/26/2001 14:56:14
>Number:         12288
>Category:       kern
>Synopsis:       Bad address while trying to read a file from an nfs mounted filesystem
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 26 05:57:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Bernd Ernesti
>Release:        NetBSD-current 26-Feb-2001 11:00 GMT
>Organization:
	
>Environment:
NetBSD 1.5S (OBAN) #30: Mon Feb 26 13:36:36 CET 2001
Architecture: i386
Machine: i386
>Description:
	Reading a file bigger then 3896 bytes, which is nfs exported from
	a linux system and mounted by amd, doesn't work anymore on a
	-current system.
	Writing on that mounted file system does work.

> cat traceroute.c
[..]
 11593 cat      CALL  open(0xbfbfd72c,0,0)
 11593 cat      NAMI  "traceroute.c"
 11593 cat      RET   open 3
 11593 cat      CALL  __fstat13(0x1,0xbfbfd530)
 11593 cat      RET   __fstat13 0
 11593 cat      CALL  break(0x8060000)
 11593 cat      RET   break 0
 11593 cat      CALL  break(0x8070000)
 11593 cat      RET   break 0
 11593 cat      CALL  read(0x3,0x8060000,0x10000)
 11593 cat      RET   read -1 errno 14 Bad address

	It is possible to read a file with 3896 bytes or smaller, but reading
	a bigger one doesn't work:

> dd count=1 if=/dev/zero of=t bs=3897
1+0 records in
1+0 records out
3897 bytes transferred in 1 secs (3897 bytes/sec)
> cat t
cat: t: Bad address
> dd count=1 if=/dev/zero of=t bs=3896
1+0 records in
1+0 records out
3896 bytes transferred in 1 secs (3896 bytes/sec)
> cat t                             
>

	Mounting this file system with mount_nfs and not by amd fixed
	this problem.
	There is also no problem with reading files from a solaris or netbsd
	nfs mounted file system.

>How-To-Repeat:
	Mount a nfs directory from an linux system via amd and try to read
	files bigger then 3896 bytes.

/etc/amd.conf:
[ global ]
dismount_interval =     900
[ /mnt ]
map_name =              /etc/amd/net


/etc/amd/net:
/defaults       type:=host;fs:=${autodir}/${rhost};rhost:=${key}
*               opts:=rw,soft,intr

>Fix:
	unknown
>Release-Note:
>Audit-Trail:
>Unformatted: