Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965154AbcKOPuR (ORCPT ); Tue, 15 Nov 2016 10:50:17 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:40543 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753179AbcKOPuP (ORCPT ); Tue, 15 Nov 2016 10:50:15 -0500 X-ME-Sender: X-Sasl-enc: LH/DUlqscBbR9B8aZUF35nr3Kw8XTjePvG627y+VNn4S 1479225013 From: Nikolaus Rath To: Mike Marshall Cc: Miklos Szeredi , Andrew Gallagher , lkml , linux-fsdevel Subject: Re: commit d7afaec0b564f0609e116f5: fuse: add FUSE_NO_OPEN_SUPPORT flag to INIT References: <87lgwrufuk.fsf@thinkpad.rath.org> <87mvh6likl.fsf@vostro.rath.org> <87mvh6j803.fsf@thinkpad.rath.org> <87d1i2j5af.fsf@thinkpad.rath.org> Date: Tue, 15 Nov 2016 07:50:11 -0800 In-Reply-To: (Mike Marshall's message of "Fri, 11 Nov 2016 12:53:39 -0500") Message-ID: <87d1hwagjw.fsf@thinkpad.rath.org> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uAFFoNxR029108 Content-Length: 1275 Lines: 29 On Nov 11 2016, Mike Marshall wrote: > There was a memorable place in the Orangefs code where > the original programmer did that (pick something appropriate > from errno.h) and put in a comment about how it was a more > reasonable return code... > > When Al Viro saw it, he said it was: > > ... stupid. Expected error value is not EOPNOTSUPP; pardon the bluntness, > but your idea of what would be less misleading doesn't matter - what matters > is what the _callers_ of link(2), mknod(2), etc. are expecting. Which is to > say, what does the userland code expect to get. It's outright promised in > POSIX, actually. I still have to see an application that, upon receiving an error from e.g. link(2), has special handlers for each of the 24 possible 24 error codes. All code that I have seen (and written) check for a few specific errors, and punts everything else to the user via strerror(). In this case, returning more specific error codes gives the user better information and doesn't violate any expectations of the application. Best, -Nikolaus -- GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F »Time flies like an arrow, fruit flies like a Banana.«