From patchwork Mon Dec 5 09:13:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye.xingchen@zte.com.cn X-Patchwork-Id: 29618 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2149856wrr; Mon, 5 Dec 2022 01:35:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf6TfnfTi3BTxgbv2Mz9pZHq2YKTIzysRQbh4LPGDcQhKdKgpUGoth/wyD6tsdNZdF6ipvtI X-Received: by 2002:a17:906:14d0:b0:7c0:a356:b41b with SMTP id y16-20020a17090614d000b007c0a356b41bmr18246396ejc.158.1670232958980; Mon, 05 Dec 2022 01:35:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670232958; cv=none; d=google.com; s=arc-20160816; b=AJjPk8v2kVALe3YrU3z4bL+IXYSUCFv/1dCrhWrbEQHCHonRgO5qlXcP793INRT0+C uw8pyQnASPlwHGp2xGAj72RzvOv+IThdVMjTqmLZ/cscxQ4n83JVB+LA1mzM9qdWEk91 u1vK4ivcA1sGeFUXnThZ6f3tvomhf6DfdWC2YH/7/hgXgi8XCfRevT2JGe6W1gwcrXha VCef1cFxAsVPxFt1V3Ou9gDppnvyDcNK8Ekrp7L04sbj6EpVIsFVHtUL2IoOyMz3OEs6 9vyD22vIvRSPOCVnVojoU0d1Pv0zCflDuBKOXmrqoJuqPe7J9p4w34CTA+/USdNHz2iR 1Fng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=ZISSvA1zwPkGzF+isCHL7yle1RIcWppOsPGTFiewznU=; b=qn80WbrHixA3XA6cIThSoAFfZphF/Kb1iWiucVy3u8DchMXYd/RhEdK19UM3zIffTn QdgCijdyI5BCoTS8n3m+XisjBMfYJwS2MFJYW74U7CjK2auQa93FCViAw8ugmkoYb/Mh xVGg9T5rYnIg0xdrOjkJFfs+zSqkShUvi6o34VVbOcMlxKfdo3184N9/QE5cwDjCOv1Z JnMpFnxpInp6hAhab9elCVG3+tYzgWbzQ0Wc7Ndws3nHqVCIO0CAwQVE938VQ9DO9qsC LNPTiF7QIQDbrk1A25v/RI7EUpAaAOSSd52cEr+EAB/MFbqoZ1XK8uzNWnNO/2rC2ct0 NFtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw19-20020a170907a0d300b00781dbee4273si8905589ejc.514.2022.12.05.01.35.34; Mon, 05 Dec 2022 01:35:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230372AbiLEJOf (ORCPT + 99 others); Mon, 5 Dec 2022 04:14:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230367AbiLEJNy (ORCPT ); Mon, 5 Dec 2022 04:13:54 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83B79C1A; Mon, 5 Dec 2022 01:13:51 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4NQdC16lNRz4y0vH; Mon, 5 Dec 2022 17:13:49 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2B59DgsV013217; Mon, 5 Dec 2022 17:13:43 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Mon, 5 Dec 2022 17:13:45 +0800 (CST) Date: Mon, 5 Dec 2022 17:13:45 +0800 (CST) X-Zmail-TransId: 2af9638db64962714073 X-Mailer: Zmail v1.0 Message-ID: <202212051713453189387@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , Subject: =?utf-8?q?=5BPATCH_linux-next=5D_NFS=3A_use_sysfs=5Femit=28=29_to_i?= =?utf-8?q?nstead_of_scnprintf=28=29?= X-MAIL: mse-fl2.zte.com.cn 2B59DgsV013217 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.13.novalocal with ID 638DB64D.000 by FangMail milter! X-FangMail-Envelope: 1670231629/4NQdC16lNRz4y0vH/638DB64D.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 638DB64D.000/4NQdC16lNRz4y0vH X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751366195152710960?= X-GMAIL-MSGID: =?utf-8?q?1751366195152710960?= From: ye xingchen Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: ye xingchen --- fs/nfs/namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index 88a23af2bd5c..b0ef7e7ddb30 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c @@ -354,7 +354,7 @@ static int param_get_nfs_timeout(char *buffer, const struct kernel_param *kp) num = (num + (HZ - 1)) / HZ; } else num = -1; - return scnprintf(buffer, PAGE_SIZE, "%li\n", num); + return sysfs_emit(buffer, "%li\n", num); } static const struct kernel_param_ops param_ops_nfs_timeout = {