From: Coywolf Qi Hunt <coywolf@gmail.com>
To: Kenichi Okuyama <okuyamak@dd.iij4u.or.jp>
Cc: Valdis.Kletnieks@vt.edu, fs@ercist.iscas.ac.cn,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [RFD] What error should FS return when I/O failure occurs?
Date: Tue, 17 May 2005 06:54:28 +0800 [thread overview]
Message-ID: <2cd57c90050516155413b18b41@mail.gmail.com> (raw)
In-Reply-To: <20050517.051113.132843723.okuyamak@dd.iij4u.or.jp>
On 5/17/05, Kenichi Okuyama <okuyamak@dd.iij4u.or.jp> wrote:
> Dear Valdis,
>
> >>>>> "VK" == Valdis Kletnieks <Valdis.Kletnieks@vt.edu> writes:
> >> 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.
> VK> Only the request that actually caused the I/O error (and thus causing the
> VK> system to re-mount the ext3 partition R/O) should get EIO. EROFS is
> VK> the proper error for subsequent requests - because they're being rejected
> VK> because the filesystem is R/O.
>
> I don't see your point.
>
> According to QuFuPing's test, USB cable was UNPLUGGED. That means,
> device is gone, and device driver instantly (well.. within second or
> two) detected that fact. How could ext3 mounted device that does
> not exist, as Read Only?
>
>
> >> 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.
> VK> Remember that the request that actually hits an error could be from a
> VK> process that isn't even in existence anymore, if the page has been sitting
> VK> in the cache for a while and we're finally sending it to disk.
>
> I don't see the reason why cache is still available.
> # I mean why such a implementation is valid.
>
> If storage is known to be lost by device driver, we should not use
> that cache anymore.
>
> Think about what the cached data means.
>
> Cache image is the data image which original data exist in some
> device. Image on memory can be used as cache because consistency is
> managed by device driver.
>
> If device no longer exist within reach of OS, device driver will not
> be able to manage the consistency between cache image and what
> device really have. Hence, if device driver lost control over
> device somehow, CACHE IMAGE SHOULD BECOME INVALID.
>
> So, even for asynchronous IO, or read, or open, or close which only
> may require cached image, IF DEVICE DRIVER HAVE ALREADY DETECTED THE
> HW FAIURE ( please keep in mind that I did not add case which device
> driver did not detcted HW failure yet. I think this is important to
> meet the ASYNC requirement ), system should invalidate the cache
> image related to that storage before hand. That means, even for
> asynchronous IO request, file system should, at least, ask device
> driver if they have ALREADY detectED any HW failure.
> # And that means, device driver should have such interface.
>
> Since device driver have already detected HW failure, whether you
> really will cause IO or not doesn't matter, EIO should be the
> correct return of error for this case.
>
> EXT3 should never succeed in remounting lost device as Read Only.
Two kinds of HW failure,
1. still readable, only write failure.
2. unreadable, unwriteable.
For the first case, if mount option errors=remount-ro is given or implied,
EROFS is appropriate, otherwise EIO. For the second case, always EIO.
The current VFS design does not try to hide the problems from its
underlying fs'.
No need to make it transparent. Userland programs need to consider
both EROFS and EIO.
--
Coywolf Qi Hunt
http://sosdg.org/~coywolf/
next prev parent reply other threads:[~2005-05-16 22:54 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
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 [this message]
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=2cd57c90050516155413b18b41@mail.gmail.com \
--to=coywolf@gmail.com \
--cc=Valdis.Kletnieks@vt.edu \
--cc=coywolf@lovecn.org \
--cc=fs@ercist.iscas.ac.cn \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=okuyamak@dd.iij4u.or.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).