Linux NFS development
 help / color / mirror / Atom feed
* [NFS] NFSv4 close-to-open attr cache flushing broken in 2.6.23
@ 2007-11-23  8:30 Timo Sirainen
  0 siblings, 0 replies; only message in thread
From: Timo Sirainen @ 2007-11-23  8:30 UTC (permalink / raw)
  To: nfs


[-- Attachment #1.1: Type: text/plain, Size: 937 bytes --]

In v2.6.23 (but not in v2.6.22) a file's attribute cache doesn't get
flushed with close()+open() if the file is open in any process on the
same server. Test program below demonstrates it.

BTW. I thought delegations were supposed to fix most of these caching
issues automatically? I don't see any difference in caching behavior
compared to NFSv3 (Linux 2.6.23 as NFS server).

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

int main(void)
{
	int fd = open("foo", O_RDWR | O_CREAT, 0600);
	int fd2 = open("foo", O_RDWR);
	struct stat st;
	char buf[1024];

	if (fstat(fd2, &st) < 0) perror("fstat()");
	printf("mtime before = %ld\n", st.st_mtime);

	printf("now modify the file on server\n");
	fgets(buf, sizeof(buf), stdin);

	close(fd2);
	fd2 = open("foo", O_RDWR);
	if (fstat(fd2, &st) < 0) perror("fstat()");
	printf("mtime after = %ld\n", st.st_mtime);
	return 0;
}


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #3: Type: text/plain, Size: 362 bytes --]

_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
_______________________________________________
Please note that nfs@lists.sourceforge.net is being discontinued.
Please subscribe to linux-nfs@vger.kernel.org instead.
    http://vger.kernel.org/vger-lists.html#linux-nfs

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-23  8:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-23  8:30 [NFS] NFSv4 close-to-open attr cache flushing broken in 2.6.23 Timo Sirainen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox