All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
To: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] cifs: cifs_flush should wait for writeback to complete before proceeding
Date: Wed, 29 Sep 2010 07:48:20 -0400	[thread overview]
Message-ID: <20100929074820.4c6c260c@corrin.poochiereds.net> (raw)
In-Reply-To: <20100925081644.777952fe-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>

On Sat, 25 Sep 2010 08:16:44 -0400
Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:

> On Sat, 25 Sep 2010 00:23:30 -0400
> Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> wrote:
> 
> > On Fri, Sep 24, 2010 at 02:11:37PM -0400, Jeff Layton wrote:
> > > On Fri, 24 Sep 2010 12:58:55 -0500
> > > Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > > 
> > > > We need to see the performance impact.  As you say cifs_writepages is
> > > > synchronous so we should be ok without it.  Any test results
> > > > before/after?
> > > > 
> > > 
> > > No, I haven't tested this for performance. It is a correctness issue
> > > though. We absolutely can't put the last reference to the last open
> > > filehandle without flushing all of the data first.
> > > 
> > > My expectation here though is that this may help performance in some
> > > cases since this patch also has it skip the flush on files open
> > > read-only.
> > 
> > ->flush is called on every close call, ->release on the last close for a
> > given file pointer.  Maybe you want a filemap_flush in ->flush and
> > filemap_write_and_wait in ->release?
> > 
> 
> Hmm...there is one problem with this scheme. __fput ignores the error
> return from ->release. Only the errors from ->flush will be returned to
> userspace. So if we only filemap_fdatawait in the ->release op, then we
> have the potential to miss returning writeback-related errors on a
> close call.
> 
> On a side note, why does f_op->release return an int? Are there places
> in the kernel besides __fput that call it? If not, maybe we should
> consider changing it to a void function to make this more clear.
> 

Now that I've had a chance to look over this code, I'm seeing some
other problems with it. I think the patch that fixes this problem is
going to have to be made part of a patchset to overhaul how open files
are managed in cifs. That's work that's long overdue, but it'll probably
take me some time to sort it all out.

Stay tuned...

-- 
Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>

  parent reply	other threads:[~2010-09-29 11:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-24 12:59 [PATCH] cifs: cifs_flush should wait for writeback to complete before proceeding Jeff Layton
     [not found] ` <1285333153-9113-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-09-24 17:58   ` Steve French
     [not found]     ` <AANLkTimdoOPyAmhWw0kTtnZan6+gudJZn=vgqTNpEL+A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-24 18:11       ` Jeff Layton
     [not found]         ` <20100924141137.4cb03197-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-09-24 18:43           ` Steve French
     [not found]             ` <AANLkTinunozFdg9S+pBrNLpcgZKoAzVg2a4QXBOBi--u-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-24 19:08               ` Jeff Layton
     [not found]                 ` <20100924150826.1819f930-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-09-24 19:24                   ` Steve French
     [not found]                     ` <AANLkTikX=cLcVK3FOFyiBeaYBQOSARHE1bnaKQcvXhX+-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-24 19:32                       ` Jeff Layton
     [not found]                         ` <20100924153206.48c202f4-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-09-24 19:36                           ` Steve French
     [not found]                             ` <AANLkTinECWNE9B56fYhp7iahp3QN8S_f0BHV9XS4SBhX-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-24 19:45                               ` Jeff Layton
2010-09-25  4:23           ` Christoph Hellwig
     [not found]             ` <20100925042330.GA11930-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2010-09-25  5:31               ` Steve French
2010-09-25 11:33               ` Jeff Layton
2010-09-25 12:16               ` Jeff Layton
     [not found]                 ` <20100925081644.777952fe-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2010-09-29 11:48                   ` Jeff Layton [this message]
2010-10-04 17:05                   ` Christoph Hellwig
     [not found]                     ` <20101004170534.GA25799-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2010-10-04 17:20                       ` Jeff Layton
     [not found]                         ` <20101004132057.5f76b550-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-10-04 17:22                           ` Jeff Layton

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=20100929074820.4c6c260c@corrin.poochiereds.net \
    --to=jlayton-eunubhrolfbytjvyw6ydsg@public.gmane.org \
    --cc=hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.