From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Layton Subject: Re: flush and EIO errors when writepages fails Date: Fri, 20 Jun 2008 12:34:51 -0400 Message-ID: <20080620123451.2a038eea@tleilax.poochiereds.net> References: <20080620073150.2bc9988e@tupile.poochiereds.net> <20080620091542.09edb43f@tupile.poochiereds.net> <485BD887.8090608@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Shirish S Pargaonkar , shaggy@linux.vnet.ibm.com, linux-fsdevel@vger.kernel.org To: "Steve French (smfltc)" Return-path: Received: from mx1.redhat.com ([66.187.233.31]:37566 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752150AbYFTQf6 (ORCPT ); Fri, 20 Jun 2008 12:35:58 -0400 In-Reply-To: <485BD887.8090608@us.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, 20 Jun 2008 11:19:19 -0500 "Steve French (smfltc)" 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. ...and... Suppose we have a bunch of dirty pages for an inode. We call cifs_flush, which calls filemap_fdatawrite (which eventually calls cifs_writepages) and attempt to write all of the pages out. They all fail and then get discarded. Then we call filemap_fdatawrite again. Now there are no more dirty pages and this returns success. But, the data was tossed out on the first filemap_fdatawrite call, so the success here really isn't a success... 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. -- Jeff Layton