linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: "Steve French (smfltc)" <smfltc@us.ibm.com>
Cc: Shirish S Pargaonkar <shirishp@us.ibm.com>,
	shaggy@linux.vnet.ibm.com, linux-fsdevel@vger.kernel.org
Subject: Re: flush and EIO errors when writepages fails
Date: Fri, 20 Jun 2008 13:12:25 -0400	[thread overview]
Message-ID: <20080620131225.26d14d31@tleilax.poochiereds.net> (raw)
In-Reply-To: <485BDDB6.1040400@us.ibm.com>

On Fri, 20 Jun 2008 11:41:26 -0500
"Steve French (smfltc)" <smfltc@us.ibm.com> wrote:

> Jeff Layton wrote:
> > On Fri, 20 Jun 2008 11:19:19 -0500
> > "Steve French (smfltc)" <smfltc@us.ibm.com> wrote:
> >
> >   
> >> If flush fails to write all dirty pages (due to an I/O error on the 
> >> server, server disk or networking stack) today the error (EIO) is marked 
> >> in the inode, and returned on close.   I think cifs_flush (which is 
> >> called before close by the vfs) should also (perhaps after sleep a 
> >> second or so then) retry at least once on the filemap_fdatawrite before 
> >> giving up.  (perhaps retry more if mounted hard) Thoughts?
> >>
> >>     
> >
> > A couple of thoughts...
> >
> > Retrying is only likely to be helpful if the server isn't responding. We
> > could consider doing a better job there somehow.
> >
> >   
> The particular problem case that I am thinking of at the moment, and 
> wish is helped by retry, is
> the case in which memory pressure prevents the TCP/IP stack or 
> underlying (perhaps badly
> written) network adapter driver from allowing the SMB write packet from 
> even getting to
> the wire.

I'll buy that...though I'm not sure how often this is really an issue.
I don't think I've seen any cases of memory allocations failing and
preventing CIFS from writing out pages. I'm also not convinced that
we'd see a lot of success from retrying in these situations.

I have seen problems with NFS/RPC hitting deadlocks when trying to do
sleeping allocations in a write. rpciod tries to do a __GFP_WAIT
allocation, and due to memory pressure ends up trying to write out NFS
pages -- deadlock. A lot of these are now fixed in mainline, but we
still have some less traveled codepaths in NFS/RPC that could deadlock
this way.

We're probably being a bit too optimistic with how we do memory
allocations in CIFS in places, so we may be subject to similar
deadlocks. These types of problems concern me more than retrying failed
page writeouts...

> > If you want to be more aggressive about handling errors when writing
> > out pages, then most of the changes will need to be made at the
> > cifs_writepages level, not so much with cifs_flush.
> >   
> flush is our "last chance" effort to write the file data - once flush 
> and close are called the
> file handle is gone so we can no longer write the file data after that 
> point.

Right, but with the current implementation, once filemap_fdatawrite
returns, any pages that that run touched are either written out or
discarded. Retrying the filemap_fdatawrite from cifs_flush won't help.

This could be redesigned, but we're probably better off fleshing out
cifs_writepages to handle this based on some sort of condition (maybe
the WB_SYNC_* flags or something).

-- 
Jeff Layton <jlayton@redhat.com>

  reply	other threads:[~2008-06-20 17:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080620073150.2bc9988e@tupile.poochiereds.net>
     [not found] ` <OFE8C66E61.981E25D1-ON8725746E.0045A92A-8625746E.004718C0@us.ibm.com>
     [not found]   ` <20080620091542.09edb43f@tupile.poochiereds.net>
2008-06-20 16:19     ` flush and EIO errors when writepages fails Steve French (smfltc)
2008-06-20 16:34       ` Jeff Layton
2008-06-20 16:41         ` Steve French (smfltc)
2008-06-20 17:12           ` Jeff Layton [this message]
2008-06-20 22:34 Steve French
2008-06-21  7:05 ` Evgeniy Polyakov
2008-06-21 12:27   ` Jeff Layton
2008-06-21 13:19     ` Evgeniy Polyakov
2008-06-21 14:21       ` Jody French
2008-06-21 14:42         ` Evgeniy Polyakov
2008-06-21 16:15           ` Steve French
2008-06-21 16:28             ` Evgeniy Polyakov
2008-06-21 17:02               ` Steve French
2008-06-21 17:26                 ` Evgeniy Polyakov
2008-06-21 17:37                   ` Evgeniy Polyakov
2008-06-23 15:39         ` Dave Kleikamp
2008-06-23 18:05           ` Dave Kleikamp

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=20080620131225.26d14d31@tleilax.poochiereds.net \
    --to=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=shaggy@linux.vnet.ibm.com \
    --cc=shirishp@us.ibm.com \
    --cc=smfltc@us.ibm.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).