Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4462977imw; Tue, 19 Jul 2022 07:06:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ss08TZ5zIjjRoeV1xnMU72Prbi3wbH5xAWPMh8mEBAC8kj6es7hxlGwpyR6zWki16/KacO X-Received: by 2002:a05:620a:8007:b0:6b1:4911:c5bb with SMTP id ee7-20020a05620a800700b006b14911c5bbmr20176640qkb.448.1658239579751; Tue, 19 Jul 2022 07:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658239579; cv=none; d=google.com; s=arc-20160816; b=Bo8gb/rma43pF/JgxoTGyXuvATK2Oqxwt6JeTO+69ThGvtGBWnyW6iemah/3pnY2e0 hVLlfXRtNL8xM+fkQs5zRLAMABae4Ho/k8rHMdFcE5Y+rJfV9THuqy0iOzZbLtkm7XqM spgMpNQNvfP+bMe5fSuGAJrqD6Wn09e79NO0bI60+VcvPJdnm6uw9ffuhec1vqNDWUSL APSYSkYVbnBk34sFBSABPDSsYs5fn1IM+x9gvqLWIPK9oSPg1hM++Tt2Dd7olUXWxzx6 EuW+OwHsEK5BabN7JmEgRioVMEm9uBr5xv6Bf7xU7m+Q0y2pPbPv7jIgqx1hFMbplHs2 koRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:to:from:subject; bh=bw30XE3pUNXJhYX/8M7+AA5+k850tUwThzwEaQdCLC0=; b=HB7/1Fty6kGngssKSTrIRWbo+8bP1cI07H3GkzrkDrWGqQrT5d/62HI2p+W7Dnf2we ZIBKW3edIoE3G9YtE2+hfQTZ3qz6TYslmT4kZBrmi8csYMteICFOImzmxC8Hgg1PTgEE YL636XrPL9hr3nxztzVgHQxJnA8ozMOiNDq1Otv4R+K5jA/SKXxpYjMU0XCsiqLLoZLV k1CBJOFgEyEybDXakaqLH48XyZilo9UBkyG/Qve3Jur4RK+Nmw4rZUxYVS+zna5TeMll mC7u5KHyvVv2oSmfLu7/UfCP7e5BL7XBvbTX861Uvipwp9YbqKJyybG8vDwLTWQpyUTW LDvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x23-20020a05610223d700b00357ad901c6csi1922053vsr.587.2022.07.19.07.05.55; Tue, 19 Jul 2022 07:06:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230035AbiGSOFY (ORCPT + 99 others); Tue, 19 Jul 2022 10:05:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236227AbiGSOE4 (ORCPT ); Tue, 19 Jul 2022 10:04:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C178D1659E for ; Tue, 19 Jul 2022 06:18:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 581BA6006F for ; Tue, 19 Jul 2022 13:18:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B219C341CA for ; Tue, 19 Jul 2022 13:18:36 +0000 (UTC) Subject: [PATCH] SUNRPC: Fix xdr_encode_bool() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Tue, 19 Jul 2022 09:18:35 -0400 Message-ID: <165823671509.3047.16569036635528856192.stgit@manet.1015granger.net> User-Agent: StGit/1.5.dev2+g9ce680a5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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-nfs@vger.kernel.org I discovered that xdr_encode_bool() was returning the same address that was passed in the @p parameter. The documenting comment states that the intent is to return the address of the next buffer location, just like the other "xdr_encode_*" helpers. The result was the encoded results of NFSv3 PATHCONF operations were not formed correctly. Fixes: ded04a587f6c ("NFSD: Update the NFSv3 PATHCONF3res encoder to use struct xdr_stream") Signed-off-by: Chuck Lever --- include/linux/sunrpc/xdr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 5860f32e3958..986c8a17ca5e 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h @@ -419,8 +419,8 @@ static inline int xdr_stream_encode_item_absent(struct xdr_stream *xdr) */ static inline __be32 *xdr_encode_bool(__be32 *p, u32 n) { - *p = n ? xdr_one : xdr_zero; - return p++; + *p++ = n ? xdr_one : xdr_zero; + return p; } /**