From: Daniel Vetter Subject: Re: ENOENT as an ioctl return code Date: Tue, 3 Dec 2013 21:41:40 +0100 Message-ID: <20131203204140.GQ27344@phenom.ffwll.local> References: <529E3A84.5030404@shipmail.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f180.google.com (mail-ea0-f180.google.com [209.85.215.180]) by gabe.freedesktop.org (Postfix) with ESMTP id A6A37FB793 for ; Tue, 3 Dec 2013 12:40:55 -0800 (PST) Received: by mail-ea0-f180.google.com with SMTP id f15so10104109eak.25 for ; Tue, 03 Dec 2013 12:40:54 -0800 (PST) Content-Disposition: inline In-Reply-To: <529E3A84.5030404@shipmail.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org To: Thomas Hellstrom Cc: "dri-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org On Tue, Dec 03, 2013 at 09:09:40PM +0100, Thomas Hellstrom wrote: > Hi, > > By concidence I ran across this lkml message > > http://marc.info/?l=linux-kernel&m=135628421403144&w=2 > > with an important part in the middle: (this is not a drm commit) > > To make matters worse, commit f0ed2ce840b3 is clearly total and utter > CRAP even if it didn't break applications. ENOENT is not a valid error > return from an ioctl. Never has been, never will be. ENOENT means "No > such file and directory", and is for path operations. ioctl's are done > on files that have already been opened, there's no way in hell that > ENOENT would ever be valid. > > Perhaps we should rethink the use of ENOENT when not finding mode objects? Yeah, it's somewhat abuse, otoh if we'd do a dma-buf export telling userspace that "no such file exists" is a pretty precise answer. In a way we _do_ duplicate file objects ... And having this special error code for lookup failures is occasionally rather useful imo. So honestly I'd prefer we keep on doing our practice. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch