Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752686AbbESD5P (ORCPT ); Mon, 18 May 2015 23:57:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39547 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751724AbbESD5M (ORCPT ); Mon, 18 May 2015 23:57:12 -0400 Date: Tue, 19 May 2015 12:00:23 +0800 From: Minfei Huang To: Petr Mladek Cc: Josh Poimboeuf , Minfei Huang , mbenes@suse.cz, sjenning@redhat.com, jkosina@suse.cz, vojtech@suse.cz, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] livepatch: Prevent to apply the patch once coming module notifier fails Message-ID: <20150519040023.GA21559@dhcp-128-1.nay.redhat.com> References: <1431439484-44530-1-git-send-email-mnfhuang@gmail.com> <20150513141415.GB28284@treble.redhat.com> <20150518120806.GC2632@pathway.suse.cz> <20150518130057.GA25260@dhcp-128-1.nay.redhat.com> <20150518153549.GF2632@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150518153549.GF2632@pathway.suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3389 Lines: 92 On 05/18/15 at 05:35pm, Petr Mladek wrote: > On Mon 2015-05-18 21:00:57, Minfei Huang wrote: > > On 05/18/15 at 02:08pm, Petr Mladek wrote: > > > On Wed 2015-05-13 09:14:15, Josh Poimboeuf wrote: ...[snip]... > > > > The patch isn't necessarily dead, since it might also include previously > > > > enabled changes for vmlinux or other modules. It can actually be a > > > > dangerous condition if there's a mismatch between old code in the module > > > > and new code elsewhere. How about something like: > > > > > > > > "patch '%s' is in an inconsistent state!\n" > > > > > > It must not be dangerous, otherwise the patch could not get applied > > > immediately. > > > > But kernel is in dangerous situation that the patch may corrupt it > > later. So it is appropriate to notify the user. > > How exactly could the patch corrupt the system? Could you please give > an example? > Please review the commit log where I show the step by step in thread. > > > > > > I would omit this message completely. It would just duplicate the > > > warning printed by klp_module_notify_coming(). > > > > > > > This error message aims to tell this fact that this patch is in an > > inconsistent state. If someone do not notify this error, it is fine, > > because the inconsistent patch does not have change to be applied to the > > kernel. > > But there is already printed a warning from > klp_module_notify_coming(). I wonder why we need one more here. > Since the error messages are different for the different called function in klp_module_notify_coming. It only shows that there is something wrong to call the function. It is prefer that livepatch can notify the user how the patch is, if klp_module_notify_coming fails. > > > > > > > Also, there's no need to split up the string literal into two lines. > > > > It's ok for a line to have more than 80 columns in that case. > > > > > > I suggest to run ./scripts/chechpatch.pl before you send any patch. > > > It would catch the indentation problems, split of the string, ... > > > > I have used the script checkpatch.pl to verify the patch. And it passed > > for the checking. About the indentation problems, it may be caused by > > the sepcified vimrc file. > > I get the following warning on your patch: > > --- cut --- > $> ./scripts/checkpatch.pl /prace/klp-module-notify-error-v3-iter1.patch > WARNING: quoted string split across lines > #181: FILE: kernel/livepatch/core.c:965: > + pr_warn("patch '%s' is dead, remove it " > + "or re-install the module '%s'\n", > > total: 0 errors, 1 warnings, 62 lines checked > > /prace/klp-module-notify-error-v3-iter1.patch has style problems, please review. > > If any of these errors are false positives, please report > them to the maintainer, see CHECKPATCH in MAINTAINERS. > --- cut --- Yes. The error message is too long, then it across the lines. > > BTW: I do not see the problems with indentation. Someone likes to use 4 blanks to instead of a tab. So the code may show differently between them. Thanks Minfei > > Best Regards, > Petr -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/