Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1569192ybh; Mon, 20 Jul 2020 01:24:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzD7OGIJfpvIabmycXQnpPQsWQyc4M1D0ytQRea/iyZBJmUIoVzgxJFlPEkwMUhTT0n+Vjl X-Received: by 2002:a17:906:2287:: with SMTP id p7mr20130157eja.537.1595233460621; Mon, 20 Jul 2020 01:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595233460; cv=none; d=google.com; s=arc-20160816; b=Za4XBrGBwwb4FJZP5MBZaencb1CCtHOPiRIRVGD1s9G4NgW5hlhGAgZkQEIvq9Ae24 Azzosm2DnJDgqJO9NCzTDCXmeziawoVxjNSS7JN9nq823v2x6G8TyWcIy6R9ZCyfN60K NYtbq+wS2GFDGCQXanHh5LGVIpVTaIjxcNLQ6MFAs6BS1JChl7DREHDLWTTtqZOYjZTl duIqIP41KOcuxxauzM7u2tOwRlexUz7hhn5+mF5V/a4VC8qpTeFlbgwyCw4PdJSv2GfN H5+zn6FS+NzIv7H/WBnzslMiZWARdjpwmtt6rHkLjeFFVN5d2zS0Rrs3459S22Zc8EQE 5cOg== 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:mime-version :message-id:date:subject:cc:to:from; bh=zCb/cwAbKD/YqMOlYdnflpAKeDZUJoxlnyULGYsjTWo=; b=W/hQFXiZbRmYsLIotLP1/mNVqk69ZjuOeXsa9cU2Mg0YI5oxHAJF38Bg5IfnJ9HFeD q4qU16o9UtykgU6TKNiRzkLgu1sJ27NRO46+E3veMXqGBjxe7K8a1KbSgnaV5tYUqa6d bsh6XAqv4aixIR2YTSlNxej29ry2tWl8ateF26qZHiLAmNfilzV7RH/UVtqcp2jZHtrr Gugv3/1m/Mq0ACeuK8ZtO/IKy/4miBUPxGsXO07QYJ+4vsjH8vdh+c42WMfjVIPSYGjk f8O4K3FTNg83I34t/RUvzl3688scXWkcb4y8s7WwVCdrVAhEpnHiT9kGvhCtaJyT476E uXIA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j13si9765503eds.407.2020.07.20.01.23.58; Mon, 20 Jul 2020 01:24:20 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727858AbgGTIVA (ORCPT + 99 others); Mon, 20 Jul 2020 04:21:00 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7789 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726254AbgGTIVA (ORCPT ); Mon, 20 Jul 2020 04:21:00 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 6CE554F8A41BB1BB5468; Mon, 20 Jul 2020 16:20:58 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Mon, 20 Jul 2020 16:20:47 +0800 From: Xiongfeng Wang To: , , CC: , , Subject: [PATCH] dlmfs: add a newline when printing 'capabilities' by sysfs Date: Mon, 20 Jul 2020 16:24:33 +0800 Message-ID: <20200720082433.164311-1-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.20.1