From: fs <fs@ercist.iscas.ac.cn>
To: Valdis.Kletnieks@vt.edu
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Kenichi Okuyama <okuyama@intellilink.co.jp>
Subject: Re: [RFD] What error should FS return when I/O failure occurs?
Date: Mon, 16 May 2005 14:04:04 -0400 [thread overview]
Message-ID: <1116266644.2434.86.camel@CoolQ> (raw)
In-Reply-To: <200505160635.j4G6ZUcX023810@turing-police.cc.vt.edu>
On Mon, 2005-05-16 at 02:35, Valdis.Kletnieks@vt.edu wrote:
> On Mon, 16 May 2005 13:14:25 EDT, fs said:
>
> > 1. For EXT3 partition , we mount it as RW, but when I/O occurs, the
> > I/O related functions return EROFS(ReadOnly?), while other FSes
> > return EIO.
>
> Only the request that actually caused the I/O error (and thus causing the
> system to re-mount the ext3 partition R/O) should get EIO. EROFS is
> the proper error for subsequent requests - because they're being rejected
> because the filesystem is R/O. EIO would be incorrect, because the I/O
> wasn't even tried, much less errored - and there's a good chance that
> subsequent I/O requests *wouldn't* pull an error. Manwhile, subsequent
> requests don't even *know* whether the filesystem was remounted R/O due to
> an error, or if some root user said 'mount -o remount,ro'.
The point is(from the user's perspective, not FS developer's):
If you open a file with O_RDWR, and sys_open returns success,
next, call sys_write, but returns EROFS? The two return values are
paradox/self-contradictory.
> > 2. Assume a program doing the following: open - write(async) - close
> > When user-mode app calls sys_write, for EXT2/JFS, no error
> > returns, for EXT3, EROFS returns, for XFS/ReiserFS, EIO returns.
>
> Remember that the request that actually hits an error could be from a
> process that isn't even in existence anymore, if the page has been sitting
> in the cache for a while and we're finally sending it to disk. If you don't
> believe me, try this on a machine with lots (1G or 2G or so) memory:
>
> 1) cd /usr/src/linux
> 2) tar cf - . | cat > /dev/null # just to prime the disk cache
> 3) make # wait a few minutes for it to complete.
> 4) Now that the 'make' is done, type 'sync' and watch the disk lights blink.
>
> Notice you're syncing the disk blocks written by the various sub-processes
> of 'make', all of which are done and long gone. Who do you report the EIO
> to, on what write() request?
>
> (For even more fun - what happens if it's kjournald pushing the blocks out,
> not the 'sync' command? ;)
Thanks for your example, but it seems you misunderstand my point.
I just use async write as an example, which shows different FS
returns different error. Here is another example:
stat(2) - open(2) - read(2) -close(2)
When I/O failure occurs between stat(2) and open(2),
EXT2/JFS/XFS/ReiserFS returns EIO, but EXT3 returns ENOENT
The purpose of this RFD, is to get the community to understand,
all I/O related syscalls should return VFS error, not FS error.
User mode app should not care about the FS they are using.
So, the community should define the ONLY VFS error first.
regards,
---
Qu Fuping
next prev parent reply other threads:[~2005-05-16 6:55 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-16 17:14 [RFD] What error should FS return when I/O failure occurs? fs
2005-05-16 6:35 ` Valdis.Kletnieks
2005-05-16 18:04 ` fs [this message]
2005-05-16 17:58 ` Valdis.Kletnieks
2005-05-17 16:47 ` fs
[not found] ` <200505171057.10540.vda@ilport.com.ua>
2005-05-17 19:41 ` fs
2005-05-16 20:11 ` Kenichi Okuyama
2005-05-16 20:35 ` Valdis.Kletnieks
2005-05-16 21:39 ` Kenichi Okuyama
2005-05-16 22:04 ` Brad Boyer
2005-05-16 22:30 ` Elladan
2005-05-17 6:17 ` Denis Vlasenko
2005-05-17 18:10 ` Bryan Henderson
2005-05-18 6:54 ` Denis Vlasenko
2005-05-17 21:26 ` Kenichi Okuyama
2005-05-19 15:44 ` Elladan
2005-05-16 22:57 ` Coywolf Qi Hunt
2005-05-16 22:54 ` Coywolf Qi Hunt
2005-05-17 16:06 ` fs
2005-05-16 17:36 ` Hans Reiser
2005-05-16 18:04 ` Bryan Henderson
-- strict thread matches above, loose matches on Subject: below --
2005-05-17 5:36 Hua Zhong (hzhong)
2005-05-17 16:55 ` fs
2005-05-17 6:00 Hua Zhong (hzhong)
2005-05-17 17:20 ` fs
[not found] <05May16.114248edt.32448@gpu.utcc.utoronto.ca>
2005-05-17 15:43 ` fs
2005-05-17 18:26 ` Bryan Henderson
2005-05-18 17:10 ` fs
2005-05-18 7:57 ` Valdis.Kletnieks
2005-05-18 19:06 ` Bryan Henderson
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=1116266644.2434.86.camel@CoolQ \
--to=fs@ercist.iscas.ac.cn \
--cc=Valdis.Kletnieks@vt.edu \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=okuyama@intellilink.co.jp \
/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).