From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 532CFC4167B for ; Thu, 2 Nov 2023 19:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344540AbjKBTOa (ORCPT ); Thu, 2 Nov 2023 15:14:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbjKBTO3 (ORCPT ); Thu, 2 Nov 2023 15:14:29 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B561C188; Thu, 2 Nov 2023 12:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1698952460; bh=O7wEcDJtrGJ2yEwB0sEkgTD3GrHwoBv5RI3h12B/TWg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mPDbYyzj2o7kfdQXXedsrUe8Ts0XLpOU4a2ChB6jMnNoFOwzBU97iZ5d7QZ00ekr4 BirHopLx8Qy05TCzR71Ua/aGkDs4JdExXFm45Bsz8W5tT/23QYJSV2X/Br3bfo9uKn 7bmJ/7HLYGg+8BnqSk72TpcADtK5s4dA533fXfgA= Date: Thu, 2 Nov 2023 20:14:19 +0100 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Przemek Kitszel Cc: Johannes Berg , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rfkill: return ENOTTY on invalid ioctl Message-ID: <613039a4-41af-48ff-8113-3b0ee8077bcf@t-8ch.de> References: <20231101-rfkill-ioctl-enosys-v1-1-5bf374fabffe@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On 2023-11-02 09:57:45+0100, Przemek Kitszel wrote: > On 11/1/23 20:41, Thomas Weißschuh wrote: > > For unknown ioctls the correct error is > > ENOTTY "Inappropriate ioctl for device". > > For sure! > > I would like to learn more of why this is not an UAPI breaking change? "break" would mean that some user application worked correctly before but does not do so anymore with this change. This seems highly unlikely and I was not able to find such an application via Debian code search. In general I did *not* mark this change for stable so if some application would indeed break it gets detected before the patch hits a release. > > > > ENOSYS as returned before should only be used to indicate that a syscall > > is not available at all. > > > > Signed-off-by: Thomas Weißschuh > > --- > > net/rfkill/core.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/net/rfkill/core.c b/net/rfkill/core.c > > index 14cc8fe8584b..c3feb4f49d09 100644 > > --- a/net/rfkill/core.c > > +++ b/net/rfkill/core.c > > @@ -1351,11 +1351,11 @@ static long rfkill_fop_ioctl(struct file *file, unsigned int cmd, > > unsigned long arg) > > { > > struct rfkill_data *data = file->private_data; > > - int ret = -ENOSYS; > > + int ret = -ENOTTY; > > u32 size; > > if (_IOC_TYPE(cmd) != RFKILL_IOC_MAGIC) > > - return -ENOSYS; > > + return -ENOTTY; > > mutex_lock(&data->mtx); > > switch (_IOC_NR(cmd)) { > > > > --- > > base-commit: 7d461b291e65938f15f56fe58da2303b07578a76 > > change-id: 20231101-rfkill-ioctl-enosys-00a2bb0a4ab1 > > > > Best regards, >