Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jan 2001 15:55:33 -0600
From:      Marc Culler <culler@math.uic.edu>
To:        freebsd-stable@freebsd.org
Subject:   Bug in NFSv3 client
Message-ID:  <20010103155533.B71238@math.uic.edu>

next in thread | raw e-mail | index | archive | help
Dear FreeBSD folks:

There is a bug in the NFS version 3 client which results in a bad time
stamp when a file is created with the O_EXCL flag.

A test program which produces the bug is at the end of the file.  (It
is actually the same program which was used to illustrate a different
bug in the NFSv3 server in December 1999.)

We are running a FreeBSD NFS server with Solaris, FreeBSD and Linux
clients.  The bad time stamps seem to be created by the FreeBSD
clients, although only the Solaris clients complain about it.  The
others apparently ignore it.

The test program creates two files, one with the O_EXCL flag set and
one without.  Then it prints out the access time, modification time,
and status change time of the two files. PLEASE NOTE THE ACCESS TIMES!

Here are the results:

Test 1 -- Client: FBSD 4.0-stable   Server: FBSD 4.1-stable  Mount: NFSv3
  [culler@neumann nfstest]$ ./fbsdtest
  Access time of testfile1: Fri Aug 26 02:47:15 1966
  Mod time of testfile1: Wed Jan  3 13:19:25 2001
  Change time of testfile1: Wed Jan  3 13:19:25 2001
  Access time of testfile2: Wed Jan  3 13:19:25 2001
  Mod time of testfile2: Wed Jan  3 13:19:25 2001
  Change time of testfile2: Wed Jan  3 13:19:25 2001

Test 2 -- Client: FBSD 4.1-stable  Server: FBSD 4.1-stable  Mount: NFSv3   
  [culler@hopper nfstest]$ ./fbsdtest
  Access time of testfile1: Fri Oct 15 21:37:55 2027
  Mod time of testfile1: Wed Jan  3 14:41:37 2001
  Change time of testfile1: Wed Jan  3 14:41:37 2001
  Access time of testfile2: Wed Jan  3 14:41:37 2001
  Mod time of testfile2: Wed Jan  3 14:41:37 2001
  Change time of testfile2: Wed Jan  3 14:41:37 2001

Test 3 -- Client: FBSD 4.0-stable Server: FBSD 4.1-stable  Mount: NFSv2 
  [culler@seifert culler]$ ~/nfstest/fbsdtest
  Access time of testfile1: Wed Jan  3 13:24:12 2001
  Mod time of testfile1: Wed Jan  3 13:24:12 2001
  Change time of testfile1: Wed Jan  3 13:24:12 2001
  Access time of testfile2: Wed Jan  3 13:24:12 2001
  Mod time of testfile2: Wed Jan  3 13:24:12 2001
  Change time of testfile2: Wed Jan  3 13:24:12 2001

Test 4 -- Client: Solaris 5.8  Server: FBSD 4.1-stable  Mount: NFSv3
  [culler@neumann nfstest]$ ./suntest  
  Access time of testfile1: Wed Jan 03 13:18:30 2001
  Mod time of testfile1: Wed Jan 03 13:18:30 2001
  Change time of testfile1: Wed Jan 03 13:18:30 2001
  Access time of testfile2: Wed Jan 03 13:18:30 2001
  Mod time of testfile2: Wed Jan 03 13:18:30 2001
  Change time of testfile2: Wed Jan 03 13:18:30 2001
	
The somewhat random time values suggest that an unitialized time value
is being sent by the NFSv3 client.

  Marc Culler
  Department of Mathematics
  University of Illinois at Chicago

---------------------- Test Program ------------------------------

#include <fcntl.h>
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>

main()
{
int rv;
struct stat s;
char buf[128];


rv=open("testfile1",O_CREAT|O_RDWR|O_EXCL,0666);
if ( rv < 0 )
  perror("testfile1");
rv=open("testfile2",O_CREAT|O_RDWR,0666);
if ( rv < 0 )
  perror("testfile2");

stat("testfile1", &s);
strftime(buf, 128, "%c", localtime(&(s.st_atime)));
printf("Access time of testfile1: %s\n", buf);
strftime(buf, 128, "%c", localtime(&(s.st_mtime)));
printf("Mod time of testfile1: %s\n", buf);
strftime(buf, 128, "%c", localtime(&(s.st_ctime)));
printf("Change time of testfile1: %s\n", buf);

stat("testfile2", &s);
strftime(buf, 128, "%c", localtime(&(s.st_atime)));
printf("Access time of testfile2: %s\n", buf);
strftime(buf, 128, "%c", localtime(&(s.st_mtime)));
printf("Mod time of testfile2: %s\n", buf);
strftime(buf, 128, "%c", localtime(&(s.st_ctime)));
printf("Change time of testfile2: %s\n", buf);

}


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010103155533.B71238>