Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1252262imw; Tue, 5 Jul 2022 06:28:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tbkie6hGCfZF7P1FUkXckPszSl++GRJXylkEvswlqCsg7wSKPRD78x2PrqpLy7O+8e6Z8/ X-Received: by 2002:a17:903:18d:b0:16a:6faf:c15c with SMTP id z13-20020a170903018d00b0016a6fafc15cmr40642897plg.87.1657027683662; Tue, 05 Jul 2022 06:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657027683; cv=none; d=google.com; s=arc-20160816; b=Iqjy4BtjBzEn+HfYFZjEyoUUuRHI2WhJqjLGbf9LI2gVJT1FDKpq0bU0osyPlSf/9o 2QWKdTWhIo2DJDci7fNtAIcXiDOV7nUkIAw8nly73HG86eKAyvf6lfN7EkMiKlzMlIBm atUj2CYZy0Cyx4wkKXiAW/WuYMnBEfA5nkJ5ok8lWKeg3945VU57+Y1yxcwPRqU+KI4F rbanW2G4hhxpYuaa4/yAgLgt1ydp5BCzaF0PKDcwRLKY2I3Y2T8kJIc8U1XC+Ql3KeXX zUshDfsbeGkyVqtwzOoGsqipsujYhKQ9PVa0gscmp8nJrU16rSAocfESh+JnJOkk4kPF 5MIw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oZG03FvqKV7CsJQ+kROEmEudUXfXB1gpmBUDOLl2MCs=; b=vTQ5HjsMwm3K9GaWlHvBe0N7nl/CV3Wmq4XKNx9YSTiPs3s7dQqov3hecj8GA2lDYq Qz5LxSWJYMfZUrHzhkK2mPlA2akpAXbJ9rOf2+cPZD9x//Va0iaeyuEDcIrK0sgIumhR RYssDnQj2MGj7UJSfjYQjE7esFHh9RxZG73n7MOENW8MSfn1xfmyQIfZSKh8lEMWuv9p 9rMSdSYcEmFMpoATfL6/thsOIgmtLA/BYaMOr4Z7OZc4E4wHSUKmopZfBIwVO6ow3JEn BgKDzWF9Geu6dEZLej6Lg/2TcMfKxoR8pN1v2kA1p13slN+xbP/BHcFy0Wa28l+3eiOs HI8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Gnyho8FZ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r17-20020a634411000000b00408d94d8198si9226219pga.119.2022.07.05.06.27.52; Tue, 05 Jul 2022 06:28:03 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Gnyho8FZ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235095AbiGEMOW (ORCPT + 99 others); Tue, 5 Jul 2022 08:14:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234931AbiGEMIL (ORCPT ); Tue, 5 Jul 2022 08:08:11 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89C791A04B; Tue, 5 Jul 2022 05:07:15 -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 ams.source.kernel.org (Postfix) with ESMTPS id 39024B817C7; Tue, 5 Jul 2022 12:07:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CF44C341CE; Tue, 5 Jul 2022 12:07:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657022832; bh=9WvpGQQ/zRN3VI0MvCJkXgQF7F+69TafaWbWVm5Uy4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gnyho8FZCqVX9LP9+fMrQE+mfP72NOamO9X4nfIyq7sn8h4ysKJSx+BjzZat6tOIT 6LQ9AonS523ciRwzcBeEbD/kV4Fx+LcdvgyJQblX7fZ1a+GE3PNGKHxtD/cAPZ1PJw iOroMzhxTuI8aA5qDQvgh8mtwJAgI7BQNfeWt7GQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Khoroshilov , Chuck Lever Subject: [PATCH 5.10 26/84] NFSD: restore EINVAL error translation in nfsd_commit() Date: Tue, 5 Jul 2022 13:57:49 +0200 Message-Id: <20220705115616.089890830@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220705115615.323395630@linuxfoundation.org> References: <20220705115615.323395630@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Alexey Khoroshilov commit 8a9ffb8c857c2c99403bd6483a5a005fed5c0773 upstream. commit 555dbf1a9aac ("nfsd: Replace use of rwsem with errseq_t") incidentally broke translation of -EINVAL to nfserr_notsupp. The patch restores that. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Alexey Khoroshilov Fixes: 555dbf1a9aac ("nfsd: Replace use of rwsem with errseq_t") Signed-off-by: Chuck Lever Signed-off-by: Greg Kroah-Hartman --- fs/nfsd/vfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1156,6 +1156,7 @@ nfsd_commit(struct svc_rqst *rqstp, stru nfsd_net_id)); err2 = filemap_check_wb_err(nf->nf_file->f_mapping, since); + err = nfserrno(err2); break; case -EINVAL: err = nfserr_notsupp; @@ -1163,8 +1164,8 @@ nfsd_commit(struct svc_rqst *rqstp, stru default: nfsd_reset_boot_verifier(net_generic(nf->nf_net, nfsd_net_id)); + err = nfserrno(err2); } - err = nfserrno(err2); } else nfsd_copy_boot_verifier(verf, net_generic(nf->nf_net, nfsd_net_id));