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 X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8DC0C43381 for ; Fri, 15 Feb 2019 21:44:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7459B21B18 for ; Fri, 15 Feb 2019 21:44:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391972AbfBOVov (ORCPT ); Fri, 15 Feb 2019 16:44:51 -0500 Received: from mx2.suse.de ([195.135.220.15]:42538 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387436AbfBOVou (ORCPT ); Fri, 15 Feb 2019 16:44:50 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4DB23AEE5; Fri, 15 Feb 2019 21:44:49 +0000 (UTC) Date: Fri, 15 Feb 2019 22:44:47 +0100 From: Petr Vorel To: Willem de Bruijn Cc: Alexey Kodanev , Network Development , David Miller Subject: Re: [PATCH net] sock: return uapi errno in sock_setsockopt() for SO_ZEROCOPY Message-ID: <20190215214447.GA16335@x230> Reply-To: Petr Vorel References: <1550249574-26772-1-git-send-email-alexey.kodanev@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, > On Fri, Feb 15, 2019 at 11:51 AM Alexey Kodanev > wrote: > > For unsupported protocols, setsockopt() with SO_ZEROCOPY > > option sets errno to ENOTSUPP(524). But this number is > > not defined anywhere in the include/uapi/ headers. > > To make sure userspace sees the known number, replace > > ENOTSUPP(524) with EOPNOTSUPP(95). > > Fixes: 76851d1212c1 ("sock: add SOCK_ZEROCOPY sockopt") > > Signed-off-by: Alexey Kodanev > > Reported-by: Petr Vorel > This code has been there since 4.14. I think it's too late to change > system call behavior. BTW It reminds me commit 0fb44559ffd6 ("af_unix: move unix_mknod() out of bindlock"), which while fixing a problem also for certain usage changed changed from -EINVAL to -EADDRINUSE. Proposed fix to restore old behavior [1] was not accepted, 0fb44559ffd6 was merged to some stable kernels so the behavior also differs. As there is no way to move these NFSv3 related definitions to uapi to make it visible for userspace, I'd be for changing errno. Kind regards, Petr [1] https://marc.info/?l=linux-kernel&m=149880810113888&w=2