From pine@decpc5.math.okayama-u.ac.jp  Mon Jun 23 04:08:37 1997
Received: from decpc5.math.okayama-u.ac.jp (decpc5.math.okayama-u.ac.jp [150.46.179.59])
          by hub.freebsd.org (8.8.5/8.8.5) with SMTP id EAA27965
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 23 Jun 1997 04:04:51 -0700 (PDT)
Received: (from pine@localhost) by decpc5.math.okayama-u.ac.jp (8.6.12/8.6.12) id UAA17960; Mon, 23 Jun 1997 20:14:52 +0900
Message-Id: <199706231114.UAA17960@decpc5.math.okayama-u.ac.jp>
Date: Mon, 23 Jun 1997 20:14:52 +0900
From: pine@math.okayama-u.ac.jp
Reply-To: pine@math.okayama-u.ac.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: Problem about mmap() over NFS
X-Send-Pr-Version: 3.2

>Number:         3938
>Category:       kern
>Synopsis:       Problem about mmap() over NFS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    peter
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 23 04:10:00 PDT 1997
>Closed-Date:    Sun Dec 12 21:16:44 PST 1999
>Last-Modified:  Sun Dec 12 21:17:13 PST 1999
>Originator:     Hiroaki Komatsu
>Release:        FreeBSD 2.1-STABLE i386
>Organization:
Okayama University
>Environment:

        NFS server: SPARC station 20 running SunOS 4.1.3
        NFS client: FreeBSD 2.2.2-RELEASE
                    FreeBSD 2.2.1-RELEASE
                    FreeBSD 2.1.0-RELEASE

>Description:

        An ftp command `get foo' between different NFS clients for
        a remote file `foo' of NFS causes ftpd to be frozen.

>How-To-Repeat:

        I think that the following program causes the same trouble,
        when an argument is a remote file of NFS, say `foo'.  While
        the program is sleeping 10 seconds, if another machine
        executes `echo >foo' then write() call can not return.

        ------------------------------------------------------------
        #include <stdio.h>
        #include <sys/mman.h>

        main(int argc, char *argv[])
        {
          FILE *fin;
          char *buf;

          if (argc != 2 || (fin = fopen(argv[1], "r")) == NULL) {
            fprintf(stderr, "Usage: %s file\n", argv[0]);
            exit(1);
          }

          fprintf(stderr, "sleep 10 seconds ...\n");
          sleep(10);

          buf = mmap(0, 1, PROT_READ, MAP_SHARED, fileno(fin), 0);
          if ((int)buf == -1) {
            fprintf(stderr, "? mmap\n");
            exit(1);
          }

          write(1, buf, 1);
        }

>Fix:
	
	
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->peter 
Responsible-Changed-By: peter 
Responsible-Changed-When: Sun Apr 26 01:11:05 PDT 1998 
Responsible-Changed-Why:  
I'll look into this.. 

From: Jeroen Ruigrok/Asmodai <asmodai@wxs.nl>
To: FreeBSD Gnats <freebsd-gnats-submit@freebsd.org>,
	Matthew Dillon <dillon@apollo.backplane.com>, bugs@freebsd.org,
	peter@freebsd.org, pine@math.okayama-u.ac.jp
Cc:  
Subject: Re: kern/3938: Problem about mmap() over NFS
Date: Sat, 19 Jun 1999 20:39:01 +0200

 Matthew,
 
 due to your involvement with the NFS in CURRENT, can you comment on this
 PR and whether it is still a problem given your tremendous number of
 fixes/clean-ups wrt that code?
 
 Thanks,
 
 -- 
 Jeroen Ruigrok van der Werven                asmodai(at)wxs.nl
         The *BSD Programmer's Documentation Project 
 Network/Security Specialist      <http://home.wxs.nl/~asmodai>
 *BSD: We are back and will not accept no...
 
State-Changed-From-To: open->closed 
State-Changed-By: dillon 
State-Changed-When: Sun Dec 12 21:16:44 PST 1999 
State-Changed-Why:  
This problem is believed to be fixed in 3.x and 4.x. 
>Unformatted:
