From: Jan Kara <jack@suse.cz>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-fsdevel@vger.kernel.org, Chris Mason <mason@suse.com>
Subject: Re: [PATCH] Fix ext2 error reporting on fsync
Date: Thu, 12 Jan 2006 11:20:36 +0100 [thread overview]
Message-ID: <20060112102036.GC8920@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <20060111202459.66f37754.akpm@osdl.org>
> Jan Kara <jack@suse.cz> wrote:
> >
<snip>
> > + */
> > + if (test_and_clear_bit(AS_EIO, &sb->s_bdev->bd_inode->i_mapping->flags)) {
> > + ext2_error(sb, "ext2_sync_file", "metadata io error");
> > + if (!ret)
> > + ret = -EIO;
> > + }
> > if (!(inode->i_state & I_DIRTY))
> > return ret;
> > if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
> >
>
> This is desperation stuff, isn't it?
>
> It would be better to stick a BH_WriteError into buffer_head.b_state, set
> that in the I/O completion handler, check it in fsync_buffers_list()?
It actually depends on the desired behaviour of fsync() in case of
IO errors. Consider the following scenario:
* process writes some data
- async writing starts in background and gets an IO error on some
metadata buffer
* process calls fsync()
- all the remaining buffers are written without problems
If I understand your solution correctly, it need not report any error
in this case as buffer with IO error could be already removed from
mapping->private_list by try_to_free_buffers(). But it would be nice to
report to the user that we were not able to write all the data...
Honza
--
Jan Kara <jack@suse.cz>
SuSE CR Labs
next prev parent reply other threads:[~2006-01-12 10:20 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-11 17:43 [PATCH] Fix ext2 error reporting on fsync Jan Kara
2006-01-12 4:24 ` Andrew Morton
2006-01-12 10:20 ` Jan Kara [this message]
2006-01-12 11:52 ` Andrew Morton
2006-01-12 13:58 ` Chris Mason
2006-01-12 14:21 ` Jan Kara
2006-01-12 15:36 ` Chris Mason
2006-01-12 16:32 ` Jan Kara
2006-01-12 14:26 ` Jan Kara
2006-01-12 20:47 ` Andrew Morton
2006-01-13 2:08 ` Chris Mason
2006-01-13 2:16 ` Andrew Morton
2006-01-18 22:46 ` Jan Kara
2006-01-18 23:06 ` Andrew Morton
2006-01-19 12:21 ` Jan Kara
2006-01-19 21:16 ` Andrew Morton
2006-01-20 13:41 ` Jan Kara
2006-01-20 21:24 ` Andrew Morton
2006-01-20 21:31 ` Andrew Morton
2006-01-20 21:33 ` Andrew Morton
2006-01-22 22:55 ` Jan Kara
2006-01-23 0:06 ` Andrew Morton
2006-01-22 22:32 ` Jan Kara
2006-01-22 23:31 ` Jan Kara
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=20060112102036.GC8920@atrey.karlin.mff.cuni.cz \
--to=jack@suse.cz \
--cc=akpm@osdl.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mason@suse.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).