linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: "Steve French" <smfrench@gmail.com>
Cc: linux-cifs-client@lists.samba.org,
	"Guenter Kukkukk" <linux@kukkukk.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: set last write time = fsync ?
Date: Fri, 14 Mar 2008 19:19:08 -0400	[thread overview]
Message-ID: <20080314191908.32572398@tleilax.poochiereds.net> (raw)
In-Reply-To: <524f69650803141438t4deba0adk15a9b4e3d25f24fb@mail.gmail.com>

On Fri, 14 Mar 2008 16:38:27 -0500
"Steve French" <smfrench@gmail.com> wrote:

> On Fri, Mar 14, 2008 at 3:35 PM, Jeff Layton <jlayton@redhat.com> wrote:
> > On Fri, 14 Mar 2008 14:19:06 -0500
> >
> > "Steve French" <smfrench@gmail.com> wrote:
> >
> >  > On Fri, Mar 14, 2008 at 11:55 AM, Jeff Layton <jlayton@redhat.com> wrote:
> >  > > On Fri, 14 Mar 2008 11:16:41 -0500
> >  > >
> >  > > "Steve French" <smfrench@gmail.com> wrote:
> >  > >
> >  > >
> >  > > > I don't worry about flushing atime (anyone crazy enough to do that
> >  > >  > would pay a huge performance penalty).
> >  > >  > Access is usually checked on open right ... so once a file is open
> >  > >  > even if the file becomes read-only, the writes, even cached writes
> >  > >  > continue.
> >  > >  >
> >  > >
> >  > >  Ahh, you're correct. I've been doing a lot of NFS work lately and was
> >  > >  thinking stateless... :-)
> >  > >
> >  > >  That patch should be OK then, though I think if someone is purposefully
> >  > >  setting the atime we should take care not to clobber it. We're not
> >  > >  going to be going through this codepath on every atime update, are we?
> >  > >  Just on utimes() type calls, correct? If so, doing a flush on atime
> >  > >  updates might be reasonable as well...
> >  > >
> >  > > Jeff Layton <jlayton@redhat.com>
> >  > >
> >  >
> >  > I don't think we need to flush before setting (just) atime.
> >  > If the problem with timestamps is delayed writes getting written out
> >  > on close ... won't close update the atime anyway?
> >  >
> >  >
> >  Consider that an app like tar might do something like this:
> >
> >  open()
> >  write()
> >  write()
> >  write()
> >  close()
> >  utimes()
> >
> >  The app would likely set the mtime too, but I'm not sure we should make
> >  that assumption. The question is -- should we allow that utimes() call
> >  to be clobbered by writes lingering around after the close() returns?
> 
> There can't be writes lingering around after the close ... filp_close does
> a flush before calling fput.
> 
> 

Right, but we don't do filemap_fdatawait() on flush so I suppose we're
not guaranteed to actually have all the writes out on the wire before
the close occurs.

IIRC, the current writepages implementation in cifs I think does
effectively wait until all the writes have completed before returning,
so a filemap_fdatawait wouldn't really do make any difference.

Anyway, after looking back over the original problem, I think I'm
convinced that your original patch is OK.

ACK

Thanks,
-- 
Jeff Layton <jlayton@redhat.com>

  reply	other threads:[~2008-03-14 23:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <524f69650803122054t7b0f8285kd564271f8340378e@mail.gmail.com>
     [not found] ` <20080313071046.1a9350a9@tleilax.poochiereds.net>
2008-03-14  2:32   ` set last write time = fsync ? Steve French
2008-03-14 10:40     ` Jeff Layton
2008-03-14 16:16       ` Steve French
2008-03-14 16:55         ` Jeff Layton
2008-03-14 19:19           ` Steve French
2008-03-14 20:35             ` Jeff Layton
2008-03-14 21:38               ` Steve French
2008-03-14 23:19                 ` Jeff Layton [this message]
2008-03-15 14:51         ` simo
2008-03-15 15:35           ` [linux-cifs-client] " Steve French

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=20080314191908.32572398@tleilax.poochiereds.net \
    --to=jlayton@redhat.com \
    --cc=linux-cifs-client@lists.samba.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux@kukkukk.com \
    --cc=smfrench@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).