Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Feb 2011 22:00:58 +1100 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Doug Barton <dougb@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans <brde@optusnet.com.au>
Subject:   Re: svn commit: r217871 - head/sbin/mount
Message-ID:  <20110211203239.I966@besplex.bde.org>
In-Reply-To: <4D54CE80.3060305@FreeBSD.org>
References:  <201101260506.p0Q56Bhf064034@svn.freebsd.org> <20110126173411.P972@besplex.bde.org> <4D408463.4000001@FreeBSD.org> <20110127153956.J1436@besplex.bde.org> <4D41D52D.2080906@FreeBSD.org> <20110128194615.G1167@besplex.bde.org> <4D54CE80.3060305@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 10 Feb 2011, Doug Barton wrote:

> On 01/28/2011 01:06, Bruce Evans wrote:
>> The solaris server behaviour can't happen, except accidentally due to
>> races :-).  Since the FreeBSD client doesn't support the noatime flag
>> except to ignore it, it can't tell any server about it.
>
> I don't mean to be a pest, but I'm confused as to why I observed what I 
> observed if this is the case. I tested it a couple of times each way, so I'm 
> confident that I saw a difference with and without noatime when mounting a 
> solaris server.

I see no evidence of this.  You at least need to run a simple test like
the following:

%%%
#include <sys/stat.h>

#include <assert.h>
#include <fcntl.h>
#include <inttypes.h>
#include <stdio.h>
#include <unistd.h>

int
main(void)
{
 	struct stat sb;
 	time_t now, then;
 	int fd;
 	char buf[1];

 	fd = open("foo", O_RDWR | O_CREAT | O_TRUNC, 0666);
 	assert(fd >= 0);
 	assert(write(fd, "", 1) == 1);
 	assert(fsync(fd) == 0);
 	assert(fstat(fd, &sb) == 0);
 	then = sb.st_atime;
 	for (;;) {
 		assert(lseek(fd, (off_t)0, SEEK_SET) == 0);
 		sleep(1);	/* increase if fs resolution is low or buggy */
 		assert(read(fd, buf, 1) == 1);
 		assert(fstat(fd, &sb) == 0);
 		now = sb.st_atime;
 		printf("now = %jd; then = %jd\n",
 		    (intmax_t)now, (intmax_t)then);
#if 0
 		assert(now >= then + 1);
#else
 		if (!(now >= then + 1))
 			printf("assert(now >= then + 1) would fail\n");
#endif
 		fflush(stdout);
 		then = now;
 	}
}
%%%

and, if this works, report the surprising nfs RPCs that make it work.
It didn't work with FreeBSD clients and servers of course.  There were
only GetAttr RPCs for the fstat()s, and no Read RPCs at all.

Bruce



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