From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753825AbdHKVNY (ORCPT ); Fri, 11 Aug 2017 17:13:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54466 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753745AbdHKVNX (ORCPT ); Fri, 11 Aug 2017 17:13:23 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2E9D352159 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jpoimboe@redhat.com Date: Fri, 11 Aug 2017 16:13:22 -0500 From: Josh Poimboeuf To: Miroslav Benes Cc: jeyu@kernel.org, jikos@kernel.org, pmladek@suse.com, lpechacek@suse.cz, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] livepatch: Add force sysfs attribute Message-ID: <20170811211321.uwn4clccx6pjnbxw@treble> References: <20170810104815.14727-1-mbenes@suse.cz> <20170810104815.14727-2-mbenes@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170810104815.14727-2-mbenes@suse.cz> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 11 Aug 2017 21:13:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 10, 2017 at 12:48:13PM +0200, Miroslav Benes wrote: > +static ssize_t force_store(struct kobject *kobj, struct kobj_attribute *attr, > + const char *buf, size_t count) > +{ > + /* > + * klp_mutex lock is not grabbed here intentionally. It is not really > + * needed. The race window is harmless and grabbing the lock would only > + * hold the action back. > + */ > + if (!klp_transition_patch) { > + pr_info("no patching in progress, forced action ineffective\n"); > + return -EINVAL; > + } > + > + return -EINVAL; > +} I think this is really a minor issue, and the -EINVAL is enough. As the comment says, the race window is harmless. So I'd say there's no need to scare the user with a printk. -- Josh