linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [RFD] What error should FS return when I/O failure occurs?
@ 2005-05-17  6:00 Hua Zhong (hzhong)
  2005-05-17 17:20 ` fs
  0 siblings, 1 reply; 30+ messages in thread
From: Hua Zhong (hzhong) @ 2005-05-17  6:00 UTC (permalink / raw)
  To: fs; +Cc: linux-fsdevel, linux-kernel, Kenichi Okuyama

The thing is the EIO almost always happens at background so there is no
way to return it to the user space. If you want to see EIO, do fsync
explicitly.

> > Which version of kernel you are using?
> My test environment is based on 2.6.11 kernel
> > It was probably the case in kernel before 2.4.20. The old ext3 had a
> > problem that it ignored IO error at journal commit time. I 
> submitted a
> > patch to fix that around the time of 2.4.20. 2.6 should be fine too,
> > unless someone else broke it again.
> > 
> > Hua
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread
* RE: [RFD] What error should FS return when I/O failure occurs?
@ 2005-05-17  5:36 Hua Zhong (hzhong)
  2005-05-17 16:55 ` fs
  0 siblings, 1 reply; 30+ messages in thread
From: Hua Zhong (hzhong) @ 2005-05-17  5:36 UTC (permalink / raw)
  To: fs, coywolf; +Cc: linux-fsdevel, linux-kernel, Kenichi Okuyama

> What you said is based on the FS implementor's perspective.
> But from user's perspective, they open a file with O_RDWR, get a
> success, then write returns EROFS?
> Besides, EXT3 ALWAYS return EROFS for the 1st and 2nd case, even
> you specify errors=continue, things are still the same.

Which version of kernel you are using?

It was probably the case in kernel before 2.4.20. The old ext3 had a
problem that it ignored IO error at journal commit time. I submitted a
patch to fix that around the time of 2.4.20. 2.6 should be fine too,
unless someone else broke it again.

Hua

^ permalink raw reply	[flat|nested] 30+ messages in thread
* [RFD] What error should FS return when I/O failure occurs?
@ 2005-05-16 17:14 fs
  2005-05-16  6:35 ` Valdis.Kletnieks
                   ` (2 more replies)
  0 siblings, 3 replies; 30+ messages in thread
From: fs @ 2005-05-16 17:14 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, Kenichi Okuyama

Hi, ML subscribers,
    
    I'm taking part in the project DOUBT[1], and my sub-project
focuses on the consistency and coherency of FS[2].
    There is something I'm still confused - What error should FS
return when I/O failure occurs? It seems there are no relevant 
documents or standards on this issue.
    
    I'll just show some examples to make things clear:
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.
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.

I know each FS has its own implementation, but from users'
perspective, they don't care what FS they're using. So, when 
handling errors from syscall, they can't do the following(p-code):
  ret = sys_write(fd, buf, size);
  if(ret < 0){
     /* the following is I/O failure related. */
     if((IsEXT3() && errno == EROFS) || 
        ((IsXFS() || IsReiserFS()) && errno == EIO)){
        /* do some things about I/O failure */
        ....
     }else{
        ....
     }
   } 
When I/O failure occurs, there should be some standards which 
define the ONLY error that should be returned from VFS, right?
What they should do is (p-code):
  ret = sys_write(fd, buf, size);
  if(ret < 0){
     if(errno == EIO){
        ...
     }else
        ...
  } 
   

Ref
[1]http://developer.osdl.jp/projects/doubt/
[2]http://developer.osdl.jp/projects/doubt/fs-consistency-and-coherency/index.html

regards,
----
Qu Fuping



^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2005-05-19 15:44 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <05May16.114248edt.32448@gpu.utcc.utoronto.ca>
2005-05-17 15:43 ` [RFD] What error should FS return when I/O failure occurs? 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
2005-05-17  6:00 Hua Zhong (hzhong)
2005-05-17 17:20 ` fs
  -- 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-16 17:14 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
2005-05-17 16:06       ` fs
2005-05-16 17:36 ` Hans Reiser
2005-05-16 18:04 ` Bryan Henderson

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).