lkml.org 
[lkml]   [2005]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Subject[RFD] What error should FS return when I/O failure occurs?
    From
    Date
    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


    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-05-16 08:10    [W:0.054 / U:34.232 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site