Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp365219ybh; Mon, 20 Jul 2020 19:26:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/vCp9MGPqv1O/Aa7rizVYE2uIqGmIzZytjP0i1X+ET86PRccBpUwoqRd2yEE/51Ky9+YJ X-Received: by 2002:a17:906:35d2:: with SMTP id p18mr24333173ejb.393.1595298403289; Mon, 20 Jul 2020 19:26:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595298403; cv=none; d=google.com; s=arc-20160816; b=bBiRjrIfJR/dSHWJlzPQQhHVNE5XuyvnZ34B3Mc73PYD8ZkB94kuLUoLVWApqop3zr TGSYZchpbWfCU2nvVuSjFWKJrpv3oGp/PMjlKWruYUq9AOymYZjr10u4GZeMZcwtdmUa tcDEDLK3qaIHN23+p/bCfSxST1UnX9aKxjNlkiLAD6j1JHgFg+J6B4OMK8FW/Kdw5yag eedKR/X2w9w1KNTKOey4Cn1uAf2rQcK/eZvIKNYIEphmuQc0i/nysEO19GPMe4r90Zq2 P2uD5dUlL+Z2y7qPkl1DGmlf3CXY5XYA6uyS8GzNaxH9s3r+aQrzR7lYdJvkLlWOparJ ZNyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=RcwXWAlWlXQY/+G3g1dvl9lkfFvmEBbUgYGByiJu9nU=; b=IfdvMzyEOAdO41zV0k+rW92kCqMxvH6I6mFKWralo1vEJulSMzrCBRNUiGTagVrvVq ybEXjOH/a+hgpsHlykJUWnyhWbqzPaRcrayrRecczCeRjkTVYXHLmvPoKd79zDXkxAce 9tvLgs8zggOG468tTKpgduWnXTrSYtB4qfP+cFrs6Jg13fMEN5wC96TmpIy0sN75/PsS UYCn/tUrRDDViDLvN3dBxuyi9N+roNP0DTy5BbGceddKewq2oCUPlfAEACOKRl4seniq Ku+YYZA4GRaTCulWsaWzPyiT03PsQxta0uNp50BsVZ1UtJQGuxLMEgjYf064aelQ2VEr YntQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si11171969edr.171.2020.07.20.19.26.19; Mon, 20 Jul 2020 19:26:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727818AbgGUC0I (ORCPT + 99 others); Mon, 20 Jul 2020 22:26:08 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:51494 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725862AbgGUC0I (ORCPT ); Mon, 20 Jul 2020 22:26:08 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R951e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01419;MF=chge@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0U3MKo5._1595298289; Received: from chge-ali-mac.local(mailfrom:chge@linux.alibaba.com fp:SMTPD_---0U3MKo5._1595298289) by smtp.aliyun-inc.com(127.0.0.1); Tue, 21 Jul 2020 10:26:05 +0800 Subject: Re: [Ocfs2-devel] [PATCH] dlmfs: add a newline when printing 'capabilities' by sysfs To: Xiongfeng Wang , mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com Cc: linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com References: <20200720082433.164311-1-wangxiongfeng2@huawei.com> From: Changwei Ge Message-ID: <5ee49484-1a8f-d4ed-c4b3-0d1d0cef4f52@linux.alibaba.com> Date: Tue, 21 Jul 2020 10:24:49 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20200720082433.164311-1-wangxiongfeng2@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I am afraid that doing so might introduce a compatible risk into exited systems which reply ocfs2/dlmfs. We can't guarantee that no system management tools is using the information reported from this file. Basically, ocfs2-tools works of top of it. But after a quick glance at the source, I didn't see side effect if this path applied. Better you can do some test if this patch breaks ocfs2-tools. Still my suggestion is that we don't try to touch this file as what I explained above. Thanks, Changwei On 7/20/20 4:24 PM, Xiongfeng Wang wrote: > When I cat module parameter 'capabilities' by sysfs, it displays as > follows. It's better to add a newline for easy reading. > > root@syzkaller:~# cat /sys/module/ocfs2_dlmfs/parameters/capabilities > bast stackglueroot@syzkaller:~# > > Signed-off-by: Xiongfeng Wang > --- > fs/ocfs2/dlmfs/dlmfs.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c > index ea868c6f9800..1f9c864ec09b 100644 > --- a/fs/ocfs2/dlmfs/dlmfs.c > +++ b/fs/ocfs2/dlmfs/dlmfs.c > @@ -82,8 +82,13 @@ static int param_set_dlmfs_capabilities(const char *val, > static int param_get_dlmfs_capabilities(char *buffer, > const struct kernel_param *kp) > { > - return strlcpy(buffer, DLMFS_CAPABILITIES, > + int cnt; > + > + cnt = strlcpy(buffer, DLMFS_CAPABILITIES, > strlen(DLMFS_CAPABILITIES) + 1); > + cnt += sprintf(buffer + cnt, "\n"); > + > + return cnt; > } > module_param_call(capabilities, param_set_dlmfs_capabilities, > param_get_dlmfs_capabilities, NULL, 0444); >