public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Xymoron <oxymoron@waste.org>
To: Andrew Morton <akpm@digeo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.5] Report write errors to applications
Date: Thu, 30 Jan 2003 16:00:12 -0600	[thread overview]
Message-ID: <20030130220011.GC4357@waste.org> (raw)
In-Reply-To: <3E399B93.90B32D12@digeo.com>

On Thu, Jan 30, 2003 at 01:39:31PM -0800, Andrew Morton wrote:
> Oliver Xymoron wrote:
> > 
> > On Wed, Jan 29, 2003 at 01:42:05PM -0800, Andrew Morton wrote:
> > > Oliver Xymoron <oxymoron@waste.org> wrote:
> > > >
> > > > > - fsync_buffers_list() will handle them and will return errors to the fsync()
> > > > > caller.  We only need to handle those buffers which were stripped
> > > > > asynchronously by VM activity.
> > > >
> > > > Are we guaranteed that we'll get a try_to_free_buffers after IO
> > > > completion and before sync? I haven't dug through this path much.
> > >
> > > Think so.  That's the only place where buffers are detached.  Otherwise,
> > > fsync_buffers_list() looks at them all.
> > 
> > The other problem here is that by the time we're in
> > try_to_free_buffers we no longer know that we're looking at a harmless
> > stale page (readahead?) or a write error, which is why Linus had me
> > make the separate end_buffer functions. So I don't think this pans out
> > - thoughts?
> 
> If the buffer has buffer_req and !buffer_uptodate and !buffer_locked
> we know that it was submitted for IO, that the IO has completed, and
> that it failed.

2.5 says this:

void end_buffer_io_sync(struct buffer_head *bh, int uptodate)
{
        if (uptodate) {
                set_buffer_uptodate(bh);
        } else {
                /*
                 * This happens, due to failed READA attempts.
                 * buffer_io_error(bh);
                 */
                clear_buffer_uptodate(bh);
        }
        unlock_buffer(bh);
        put_bh(bh);
}

The comment suggests that we need to distinguish read errors from
write errors and I tend to agree. Bear in mind that we're limited to
doing this per inode, so if we start flagging errors for reads, we can
really confuse writers. Perhaps not fatal, but suboptimal certainly.

On the other hand, I haven't been able to find anywhere in 2.4 that's
setting b_end_io to end_io_write_sync that's not also setting b_page,
so I think my original patch is safe in this regard. I suspect 2.5 is
similar.

-- 
 "Love the dolphins," she advised him. "Write by W.A.S.T.E.." 

  reply	other threads:[~2003-01-30 21:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-29  6:09 [PATCH 2.5] Report write errors to applications Oliver Xymoron
2003-01-29  7:29 ` Andrew Morton
2003-01-29 16:24   ` Oliver Xymoron
2003-01-29 21:42     ` Andrew Morton
2003-01-30 21:12       ` Oliver Xymoron
2003-01-30 21:39         ` Andrew Morton
2003-01-30 22:00           ` Oliver Xymoron [this message]
2003-01-30 22:13             ` Andrew Morton
2003-01-31 18:42               ` Oliver Xymoron

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=20030130220011.GC4357@waste.org \
    --to=oxymoron@waste.org \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox