From owner-freebsd-stable Wed Jan 3 13:57:30 2001 From owner-freebsd-stable@FreeBSD.ORG Wed Jan 3 13:57:26 2001 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from math.uic.edu (seifert.math.uic.edu [131.193.178.249]) by hub.freebsd.org (Postfix) with SMTP id 4BC5E37B400 for ; Wed, 3 Jan 2001 13:57:26 -0800 (PST) Received: (qmail 71273 invoked by uid 30007); 3 Jan 2001 21:55:33 -0000 Date: Wed, 3 Jan 2001 15:55:33 -0600 From: Marc Culler To: freebsd-stable@freebsd.org Subject: Bug in NFSv3 client Message-ID: <20010103155533.B71238@math.uic.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 #include #include #include 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