linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Kenichi Okuyama <okuyamak@dd.iij4u.or.jp>
Cc: reiser@namesys.com, adilger@clusterfs.com, fs@ercist.iscas.ac.cn,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	zhiming@admin.iscas.ac.cn, qufuping@ercist.iscas.ac.cn,
	madsys@ercist.iscas.ac.cn, xuh@nttdata.com.cn,
	koichi@intellilink.co.jp, kuroiwaj@intellilink.co.jp,
	matsui_v@valinux.co.jp, kikuchi_v@valinux.co.jp,
	fernando@intellilink.co.jp, kskmori@intellilink.co.jp,
	takenakak@intellilink.co.jp, yamaguchi@intellilink.co.jp,
	ext2-devel@lists.sourceforge.net, shaggy@austin.ibm.com,
	xfs-masters@oss.sgi.com, Reiserfs-Dev@namesys.com
Subject: Re: [Ext2-devel] Re: [RFD] FS behavior (I/O failure) in kernel summit
Date: Wed, 15 Jun 2005 16:37:50 -0400	[thread overview]
Message-ID: <20050615203750.GC7722@thunk.org> (raw)
In-Reply-To: <20050616.044045.26507987.okuyamak@dd.iij4u.or.jp>

On Thu, Jun 16, 2005 at 04:40:45AM +0900, Kenichi Okuyama wrote:
> Ted> And while the write()
> Ted> which causes an I/O error that remounts the filesystem read/only can
> Ted> (and probably does) return EIO
> 
> No. they return EROFS from beginning.
> 

No, trust me, the *first* read/write to a device which is returning
errors is returning EIO.  But it might not be the application which
you are testing.  It might be an attempt to update the inode last
access time that fails, so it might not even be returned to user space
at all.    

But once the filesystem is remounted read-only the reason why EROFS is
being returned is not because of an I/O error, but because the
filesystem is now read-only.  It makes perfect sense, if you think
like a computer....

> The point is pretty easy ( I think ).
> 
> Q1.  Why does file system succeed in re-mounting as r/o, when device
>      is totally lost?

That's because right now there is no way for block devices to inform
the filesystem that device is totally gone.

> But in case of Mr. Qu's test, device is lost. USB cabel is
> unplugged. They are unreachable. How could such device be *MOUNTED*?
> # In other word, why can't I mount device which does not exist,
> # while I can re-mount them?

Because remounting a filesystem means toggling the in-core data
structures that writes are no longer being tolerated.  It doesn't
require reading from the device, which a fresh mount requires.

> 1) devices and file systems are still under control of kernel.
> 2) devices or file systems are not under control of kernel anymore.
> 
> I do agree that, for devices, it is device driver's responsibility
> to identify which type of error have arised. But when file system
> recieved type 2 error, he should not change it to type 1 error
> ( unless fs could really guarantee that ).
> 
> And, therefore, for type 2, I belive they can be standardize, and I
> think we should.

The problem is the filesystem right now can't tell the difference
between type 1 and type 2 errors.  All we know is that an attempt to
read or write from a block as failed.  We don't know why it failed.   

I agree that *if* the filesystem could be told that a block device has
disappeared, then we should do the equivalent of umount -l on the
filesystem, and revoke all open file descriptors, much like the BSD
revoke(2) system call.  

But this isn't matter of "standardizing" error returns, but rather a
feature/enhancement request.

						- Ted

  reply	other threads:[~2005-06-15 20:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-13 19:53 [RFD] FS behavior (I/O failure) in kernel summit fs
2005-06-13 17:59 ` Hans Reiser
2005-06-13 20:13   ` [Ext2-devel] " Andreas Dilger
2005-06-13 23:56     ` Hans Reiser
2005-06-14  2:46       ` Kenichi Okuyama
2005-06-15 14:01         ` [Ext2-devel] " Theodore Ts'o
2005-06-15 19:40           ` Kenichi Okuyama
2005-06-15 20:37             ` Theodore Ts'o [this message]
2005-06-15 20:38           ` Hans Reiser
2005-06-15 22:53             ` Theodore Ts'o
2005-06-16 19:08               ` [Ext2-devel] " Hans Reiser
2005-06-16 11:52             ` Helge Hafting
2005-06-16 19:52               ` Hans Reiser
2005-06-16 21:27             ` Pavel Machek
2005-06-16 11:38           ` Matthew Wilcox
2005-06-14 12:51       ` Erik Mouw
2005-06-14 13:48         ` Denis Vlasenko
2005-06-14 17:16         ` Kenichi Okuyama
2005-06-14 20:17           ` Szakacsits Szabolcs
2005-06-14  3:46     ` Valdis.Kletnieks
2005-06-14 17:41     ` [Ext2-devel] " fs
2005-06-13 21:51   ` Jeff Mahoney
2005-06-14  0:03     ` Hans Reiser
2005-06-15 17:39       ` Jeff Mahoney
2005-06-16  2:18         ` Dave Chinner
2005-06-16 15:21           ` Jeff Mahoney
2005-06-16 18:52         ` Hans Reiser
2005-06-14 13:22 ` Dave Kleikamp

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=20050615203750.GC7722@thunk.org \
    --to=tytso@mit.edu \
    --cc=Reiserfs-Dev@namesys.com \
    --cc=adilger@clusterfs.com \
    --cc=ext2-devel@lists.sourceforge.net \
    --cc=fernando@intellilink.co.jp \
    --cc=fs@ercist.iscas.ac.cn \
    --cc=kikuchi_v@valinux.co.jp \
    --cc=koichi@intellilink.co.jp \
    --cc=kskmori@intellilink.co.jp \
    --cc=kuroiwaj@intellilink.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madsys@ercist.iscas.ac.cn \
    --cc=matsui_v@valinux.co.jp \
    --cc=okuyamak@dd.iij4u.or.jp \
    --cc=qufuping@ercist.iscas.ac.cn \
    --cc=reiser@namesys.com \
    --cc=shaggy@austin.ibm.com \
    --cc=takenakak@intellilink.co.jp \
    --cc=xfs-masters@oss.sgi.com \
    --cc=xuh@nttdata.com.cn \
    --cc=yamaguchi@intellilink.co.jp \
    --cc=zhiming@admin.iscas.ac.cn \
    /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).