From: Michael Tokarev Subject: Re: unlink(nonexistent): EROFS or ENOENT? Date: Sun, 29 May 2011 20:14:50 +0400 Message-ID: <4DE270FA.6060702@msgid.tls.msk.ru> References: <4DE26F97.9050607@msgid.tls.msk.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE To: Linux-kernel , linux-fsdevel Return-path: In-Reply-To: <4DE26F97.9050607@msgid.tls.msk.ru> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 29.05.2011 20:08, Michael Tokarev =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > Hello. >=20 > Just noticed that at least on ext4, unlinking a > non-existing file from a read-only filesystem > results in EROFS instead of ENOENT. I'd expect > it return ENOENT - it is more logical, at least > in my opinion. http://pubs.opengroup.org/onlinepubs/009695399/functions/unlink.html this case is quite clear: [EROFS] The directory entry to be unlinked is part of a read-only file system Ie, the entry is a _part_ of a file system, so it should be _existing_ entry to start with. > For one, (readonly) NFS mount returns ENOENT in > this case. >=20 > Thanks! /mjt