lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1589197240-28118-1-git-send-email-wangxiongfeng2@huawei.com>
Date:   Mon, 11 May 2020 19:40:40 +0800
From:   Xiongfeng Wang <wangxiongfeng2@...wei.com>
To:     <hare@...e.de>, <jejb@...ux.ibm.com>, <martin.petersen@...cle.com>
CC:     <linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <wangxiongfeng2@...wei.com>
Subject: [PATCH] scsi: fcoe: add a newline when printing 'fcoe_transport' by sysfs

When I print 'fcoe_transport' by sysfs, it displays as follows. It is
better to add a newline for easy reading.

[root@...k-202 ~]# cat /sys/module/libfcoe/parameters/show
Attached FCoE transports:fcoe [root@...k-202 ~]#

Signed-off-by: Xiongfeng Wang <wangxiongfeng2@...wei.com>
---
 drivers/scsi/fcoe/fcoe_transport.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c
index a20ddc3..1b82753 100644
--- a/drivers/scsi/fcoe/fcoe_transport.c
+++ b/drivers/scsi/fcoe/fcoe_transport.c
@@ -607,7 +607,10 @@ static int fcoe_transport_show(char *buffer, const struct kernel_param *kp)
 	}
 	mutex_unlock(&ft_mutex);
 	if (i == j)
-		i += snprintf(&buffer[i], IFNAMSIZ, "none");
+		i += snprintf(&buffer[i], IFNAMSIZ, "none\n");
+	else if (PAGE_SIZE - i >= 1)
+		i += sprintf(&buffer[i], "\n");
+
 	return i;
 }
 
-- 
1.7.12.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ