From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Woodhouse Subject: Re: [PATCH] remove TCGETS Date: Wed, 29 Oct 2003 00:46:42 +0000 Sender: intermezzo-devel-admin@lists.sourceforge.net Message-ID: <1067388401.17740.7.camel@imladris.demon.co.uk> References: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Bryan Henderson , Matthew Wilcox , Peter Braam , intermezzo-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Return-path: To: Linus Torvalds In-Reply-To: Errors-To: intermezzo-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: List-Id: linux-fsdevel.vger.kernel.org On Tue, 2003-10-28 at 13:07 -0800, Linus Torvalds wrote: > I don't know you you _require_ an executive decision, but the simple fact > is that the regular Linux ioctl() handler always returns ENOTTY if it > doesn't match a ioctl number. See fs/ioctl.c. I don't require an executive decision to fix my own code -- the patch went into my CVS tree this morning and is attached. But if I'm going to hunt down bogus -EINVAL returns and convert them to -ENOTTY, an executive decision makes my life easier because it stops people bitching at me for it :) > In short, the way I think this should be handled is: > - if you don't recognize the ioctl, you should return ENOTTY > - if you recognize the ioctl, but some parameter to the ioctl is wrong, > you should return EINVAL. Absolutely. > This is consistent with file_ioctl(), and also consistent with traditional > uses of ENOTTY. It also just happens to make LTP pass, but I will leave to > you to make up your own mind on whether that is because LTP is a good > test, or whether it's just a small unimportant detail. Life is full of small unimportant details. Being consistent about them is a quality of implementation issue. Index: fs/jffs2/ioctl.c =================================================================== RCS file: /home/cvs/mtd/fs/jffs2/ioctl.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -p -r1.7 -r1.8 --- fs/jffs2/ioctl.c 4 Oct 2003 08:33:06 -0000 1.7 +++ fs/jffs2/ioctl.c 28 Oct 2003 16:16:28 -0000 1.8 @@ -1,13 +1,13 @@ /* * JFFS2 -- Journalling Flash File System, Version 2. * - * Copyright (C) 2001 Red Hat, Inc. + * Copyright (C) 2001-2003 Red Hat, Inc. * * Created by David Woodhouse * * For licensing information, see the file 'LICENCE' in this directory. * - * $Id: ioctl.c,v 1.7 2003/10/04 08:33:06 dwmw2 Exp $ + * $Id: ioctl.c,v 1.8 2003/10/28 16:16:28 dwmw2 Exp $ * */ @@ -18,6 +18,6 @@ int jffs2_ioctl(struct inode *inode, str { /* Later, this will provide for lsattr.jffs2 and chattr.jffs2, which will include compression support etc. */ - return -EINVAL; + return -ENOTTY; } -- dwmw2 ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/