Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757338AbbFQINT (ORCPT ); Wed, 17 Jun 2015 04:13:19 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47426 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753394AbbFQINK (ORCPT ); Wed, 17 Jun 2015 04:13:10 -0400 Date: Wed, 17 Jun 2015 10:13:07 +0200 (CEST) From: Miroslav Benes To: Li Bin cc: Josh Poimboeuf , Seth Jennings , Jiri Kosina , Vojtech Pavlik , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, xiexiuqi@huawei.com Subject: Re: [PATCH] livepatch: add sysfs interface /sys/kernel/livepatch/state In-Reply-To: <1434522671-31951-1-git-send-email-huawei.libin@huawei.com> Message-ID: References: <1434522671-31951-1-git-send-email-huawei.libin@huawei.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) 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 Content-Length: 1846 Lines: 54 On Wed, 17 Jun 2015, Li Bin wrote: > The added sysfs interface /sys/kernel/livepatch/state is read-only, > it shows the patches that have been applied, incluing the stack index > and the state of each patch. > > $ cat /sys/kernel/livepatch/state > Index Patch State > ----------------------------------------------- > 1 klp_test1 enabled > 2 klp_test2 enabled > 3 klp_test3 enabled > ----------------------------------------------- > > $ echo 0 > /sys/kernel/livepatch/klp_test3/enabled > $ cat /sys/kernel/livepatch/state > Index Patch State > ----------------------------------------------- > 1 klp_test1 enabled > 2 klp_test2 enabled > 3 klp_test3 disabled > ----------------------------------------------- > > Signed-off-by: Li Bin > --- Hi, I think we should comply with sysfs policy and keep 'one value per attribute' as mentioned in the Documentation/filesystems/sysfs.txt: " Attributes should be ASCII text files, preferably with only one value per file. It is noted that it may not be efficient to contain only one value per file, so it is socially acceptable to express an array of values of the same type. Mixing types, expressing multiple lines of data, and doing fancy formatting of data is heavily frowned upon. Doing these things may get you publicly humiliated and your code rewritten without notice. " The list of applied patches can be obtained just by 'ls /sys/kernel/livepatch' and their state is in enabled attribute in each respective patch (no, you cannot obtain the order in the stack). Thanks, Miroslav Benes SUSE Labs -- 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/