From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753924AbbIGRGc (ORCPT ); Mon, 7 Sep 2015 13:06:32 -0400 Received: from mail-la0-f53.google.com ([209.85.215.53]:35323 "EHLO mail-la0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751283AbbIGRG1 (ORCPT ); Mon, 7 Sep 2015 13:06:27 -0400 From: ulfalizer.lkml@gmail.com To: corbet@lwn.net Cc: gregkh@linuxfoundation.org, shane.seymour@hp.com, ulfalizer@gmail.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] sysfs.txt: mention that store method buffers are null-terminated Date: Mon, 7 Sep 2015 19:06:14 +0200 Message-Id: <1441645574-6043-1-git-send-email-ulfalizer.lkml@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ulf Magnusson Without knowing this, the use of sysfs_streq() becomes puzzling. The termination happens in kernfs_fop_write(). Signed-off-by: Ulf Magnusson --- Documentation/filesystems/sysfs.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt index 9494afb..575e997 100644 --- a/Documentation/filesystems/sysfs.txt +++ b/Documentation/filesystems/sysfs.txt @@ -198,6 +198,9 @@ implementations: entire file, modify the values it wishes to change, then write the entire buffer back. + A terminating null is added after the data on stores. This makes + functions like sysfs_streq() safe to use. + Attribute method implementations should operate on an identical buffer when reading and writing values. -- 2.1.4