Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4869588imu; Tue, 29 Jan 2019 08:52:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN5DKrV7AZk5CH7GaDsPz+cX45A3Gy37QiJ8nrNhgNzaIpNXVhOwxeQ9wtH8VINHIJoh8Esb X-Received: by 2002:a62:c505:: with SMTP id j5mr26831167pfg.149.1548780728410; Tue, 29 Jan 2019 08:52:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548780728; cv=none; d=google.com; s=arc-20160816; b=iorNmzhA8h+UbHkFi9F3ld9YrNEW09QmKote0YFOnhNmXcXG/KtMNPWUOdBpcxyjWt O94edleWRa8o4JYdtYFowZknW+pZfmGsVadS7sNbfaxwTAPrscI6UYDLmMpP1ogAOs4Z Vvi7mkG8Nrkh1D0MFjE5PqnCtKUn/Ne4Du7UR5tkTvbIduiije2YOue2jjU772Hv4W7I a2jW/exKP0BPxxOWYB+lxx7iDZJskO7avkwazY5FAETm6sOjlahJ9PJWXiYDgsAlu6aH LCNJESw+bhPGCueVkn9EChXoJBbOVXz3xLKXdF1NVCpzpEZ6qU+fF0aN0mS+XD4gyHCp Pzbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Y4vPsZ8dytgKP/eO7RHcQpmFfuFNm+rUM3tsfE1R2gw=; b=IQXszxqx+vEoVLF5FmMe/MbVnjP/rRhLWUagJnlPmcSIrhoIMaMNFgsNYV5CUG0EOw Z2RfayoGX48faVfmN7EeiAXPcvqSAEFvRa3iMKdjuhPtRkr6yutQjs6ZyFwfz5zQ0L++ aF6ZQvGse8vsfAt0WVK7QM1+n4Q64RVMFicN78WWO8Vtw/omGJeVRRi/ZiMFSIR5hUCs AkP6dfMc78BseANQenLqK7928DSvDgnOrmWjGhGuQW/QI6lnDiMN01t14bs7PXhH7PCS kqR7nDI6CUdNUK7zGGfGCvyLuyAEyTL2yWQs76aeagdLeGbzZ6QXTuNiqOFWzLst6Jr6 jrGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u91si37946133plb.237.2019.01.29.08.51.53; Tue, 29 Jan 2019 08:52:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728611AbfA2QvB (ORCPT + 99 others); Tue, 29 Jan 2019 11:51:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40418 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728017AbfA2QvA (ORCPT ); Tue, 29 Jan 2019 11:51:00 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BCFE3356EC; Tue, 29 Jan 2019 16:51:00 +0000 (UTC) Received: from treble (ovpn-120-147.rdu2.redhat.com [10.10.120.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3E64617A79; Tue, 29 Jan 2019 16:50:56 +0000 (UTC) Date: Tue, 29 Jan 2019 10:50:54 -0600 From: Josh Poimboeuf To: Joe Lawrence Cc: Alice Ferrazzi , jeyu@kernel.org, jikos@kernel.org, mbenes@suse.cz, pmladek@suse.com, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Alice Ferrazzi Subject: Re: [PATCH] livepatch: core: Return ENOTSUPP instead of ENOSYS Message-ID: <20190129165054.vyi7n6in5v2omkpu@treble> References: <20190126192630.6163-1-alicef@alicef.me> <20190128194943.GA18515@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190128194943.GA18515@redhat.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 29 Jan 2019 16:51:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 28, 2019 at 02:49:43PM -0500, Joe Lawrence wrote: > On Sun, Jan 27, 2019 at 04:26:30AM +0900, Alice Ferrazzi wrote: > > This patch fixes a checkpatch warning: > > WARNING: ENOSYS means 'invalid syscall nr' and nothing else > > > > Signed-off-by: Alice Ferrazzi > > --- > > kernel/livepatch/core.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c > > index 5b77a7314e01..eea6b94fef89 100644 > > --- a/kernel/livepatch/core.c > > +++ b/kernel/livepatch/core.c > > @@ -897,7 +897,7 @@ int klp_register_patch(struct klp_patch *patch) > > > > if (!klp_have_reliable_stack()) { > > pr_err("This architecture doesn't have support for the livepatch consistency model.\n"); > > - return -ENOSYS; > > + return -ENOTSUPP; > > } > > > > return klp_init_patch(patch); > > -- > > 2.19.2 > > > > Hi Alice, > > Patches should be based off the upstream livepatching tree, found here: > > git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching.git > > and in this case, the for-next branch, which holds patches that have > already been queued up for the next release. This one: > > 958ef1e39d24 ("livepatch: Simplify API by removing registration step") > > has moved the code in question from klp_register_patch() to > klp_enable_patch(). > > > As far as the change itself, I don't have strong opinion about it > either way. > > On the one hand, there is the checkpatch warning and -ENOTSUPP reads > more intuitively than -ENOSYS. > > However, the current pattern seems to be more prevelent in the kernel. > I wonder if the checkpatch warning would be better specified for return > values that are actually passed back to userspace. > > Also, klp_register_patch(), now klp_enable_patch(), is exported for > module use, though I don't believe anyone (samples / tests / kpatch / > kgraft?) is inspecting which error value is returned. > > I would defer to whichever convention the maintainers prefer here. Based on the commit description from 91c9afaf97ee ("checkpatch.pl: new instances of ENOSYS are errors"), it sounds like there was a decision at Kernel Summit to limit ENOSYS to mean "bad syscall" and nothing else. So I'm ok with this change, though the patch description should have a little more background on why it's being done -- checkpatch.pl alone isn't a good justification because some checkpatch warnings are best taken with a grain of salt. -- Josh