From: Manish Katiyar Subject: Re: [PATCH]: Return better error code from vfs_unlink if operation is not defined. Date: Fri, 16 Jan 2009 11:28:15 +0530 Message-ID: References: <20090116055108.GE31013@parisc-linux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, Al Viro To: Matthew Wilcox Return-path: Received: from ti-out-0910.google.com ([209.85.142.191]:42697 "EHLO ti-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764253AbZAPF6S (ORCPT ); Fri, 16 Jan 2009 00:58:18 -0500 Received: by ti-out-0910.google.com with SMTP id b6so815876tic.23 for ; Thu, 15 Jan 2009 21:58:16 -0800 (PST) In-Reply-To: <20090116055108.GE31013@parisc-linux.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Jan 16, 2009 at 11:21 AM, Matthew Wilcox wrote: > On Fri, Jan 16, 2009 at 11:13:04AM +0530, Manish Katiyar wrote: >> If the unlink function is not defined by filesystem, then I think it >> is better to return operation not supported rather than saying >> permission denied, which can come from lot other places and keep user >> guessing what went wrong. I came across this while testing one of my >> small modules. > > -EOPNOTSUPP is not a valid return value from unlink(). Why ? I mean are there any issues if we return this ? Does it break anything ? > It's also > documented in the manpage: > > EPERM (Linux only) > The file system does not allow unlinking of files. English is not my first language, but still I think the above statement only means that filesystem didn't allow to unlink (whether it was actually due to permission issues or the function was not implemented is not known). > > In general, you should never use -EOPNOTSUPP. It's only for use by > networking STREAMS. Hmm.... OK, but I would like to know the reasons behind it Thanks Matthew for your comments. Thanks - Manish > > -- > Matthew Wilcox Intel Open Source Technology Centre > "Bill, look, we understand that you're interested in selling us this > operating system, but compare it to ours. We can't possibly take such > a retrograde step." >