From mboxrd@z Thu Jan 1 00:00:00 1970 From: fs Subject: [RFD] What error should FS return when I/O failure occurs? Date: Mon, 16 May 2005 13:14:25 -0400 Message-ID: <1116263665.2434.69.camel@CoolQ> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: Received: from ercist.iscas.ac.cn ([159.226.5.94]:38413 "EHLO ercist.iscas.ac.cn") by vger.kernel.org with ESMTP id S261324AbVEPGFo (ORCPT ); Mon, 16 May 2005 02:05:44 -0400 To: linux-kernel , linux-fsdevel , Kenichi Okuyama Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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