Linux NFS development
 help / color / mirror / Atom feed
From: Timo Sirainen <tss@iki.fi>
To: nfs@lists.sourceforge.net
Subject: [NFS] NFSv4 close-to-open attr cache flushing broken in 2.6.23
Date: Fri, 23 Nov 2007 10:30:51 +0200	[thread overview]
Message-ID: <1195806651.5532.12.camel@hurina> (raw)


[-- 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

                 reply	other threads:[~2007-11-23  8:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1195806651.5532.12.camel@hurina \
    --to=tss@iki.fi \
    --cc=nfs@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox