From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Timo Sirainen <tss@iki.fi>
Cc: nfs@lists.sourceforge.net
Subject: Re: [NFS] Cache flushing
Date: Sat, 17 Nov 2007 15:41:02 -0500 [thread overview]
Message-ID: <1195332062.6999.20.camel@localhost.localdomain> (raw)
In-Reply-To: <600549E3-82CF-44EB-8394-E57A3BB41118@iki.fi>
On Sat, 2007-11-17 at 22:12 +0200, Timo Sirainen wrote:
> On 17.11.2007, at 21.46, Trond Myklebust wrote:
> > Why is this needed?
>
> Do you mean why is flushing attribute cache needed, or why is this
> particular way to flush it needed?
>
> I need to be able to find out if a file has changed, so I need to get
> its attribute cache flushed. fchown()ing to -1, -1 would work safely
> in all situations because it's guaranteed not to change the file in
> any way.
Why can't you simply close(), and then re-open() the file? That is _the_
standard way to force an attribute cache revalidation on all NFS
versions. The close-to-open caching model, which is implemented on most
NFS clients guarantees this.
> Also O_DIRECT is a bit too much for my use case. I do want the file
> to be cached for the most part, but there are times occationally when
> parts of it can be overwritten, and I need to make sure that in those
> situations the newest data is read.
>
> If you want a wider description of what I'm trying to do: I'm
> developing Dovecot IMAP server. A lot of people store mails on NFS
> and want to have multiple IMAP servers be able to access the mails.
> Dovecot uses somewhat complex index files to speed up accessing the
> mailboxes, and it's mainly for these index files that I need this
> explicit control over caching. If two servers are accessing the same
> mailbox at the same time, the index files get easily corrupted if I
> can't control the caching.
So how are you ensuring that both servers don't try writing to the same
locations? You must have some form of synchronisation scheme for this to
work.
Trond
-------------------------------------------------------------------------
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/
_______________________________________________
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
next prev parent reply other threads:[~2007-11-17 20:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-17 0:11 Cache flushing Timo Sirainen
2007-11-17 19:46 ` [NFS] " Trond Myklebust
[not found] ` <1195328785.6999.5.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-11-17 20:12 ` Timo Sirainen
2007-11-17 20:41 ` Trond Myklebust [this message]
[not found] ` <1195332062.6999.20.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-11-17 22:11 ` Timo Sirainen
2007-11-17 23:52 ` Trond Myklebust
[not found] ` <1195343531.7084.11.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-11-18 0:26 ` Timo Sirainen
2007-11-18 0:46 ` Trond Myklebust
[not found] ` <1195346790.8908.0.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-11-18 2:03 ` Timo Sirainen
2007-11-20 2:14 ` Timo Sirainen
2007-11-20 23:47 ` Trond Myklebust
[not found] ` <1195602454.7234.100.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2007-11-21 13:14 ` Timo Sirainen
2007-11-21 13:56 ` Trond Myklebust
[not found] ` <1195653389.8374.4.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2007-11-21 20:36 ` Timo Sirainen
2007-11-21 20:39 ` Trond Myklebust
[not found] ` <1195677569.8374.18.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2007-11-21 20:56 ` Timo Sirainen
2007-11-21 21:15 ` Trond Myklebust
[not found] ` <1195679737.8374.34.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2007-11-22 0:52 ` Timo Sirainen
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=1195332062.6999.20.camel@localhost.localdomain \
--to=trond.myklebust@fys.uio.no \
--cc=nfs@lists.sourceforge.net \
--cc=tss@iki.fi \
/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