From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752444AbdHNODx (ORCPT ); Mon, 14 Aug 2017 10:03:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:43931 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750876AbdHNODv (ORCPT ); Mon, 14 Aug 2017 10:03:51 -0400 Date: Mon, 14 Aug 2017 16:03:49 +0200 (CEST) From: Miroslav Benes To: Josh Poimboeuf 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 In-Reply-To: <20170811211321.uwn4clccx6pjnbxw@treble> Message-ID: References: <20170810104815.14727-1-mbenes@suse.cz> <20170810104815.14727-2-mbenes@suse.cz> <20170811211321.uwn4clccx6pjnbxw@treble> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 11 Aug 2017, Josh Poimboeuf wrote: > 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. Ok, I'll remove it in v3. Miroslav