Received: by 2002:ac8:71d8:0:b0:40f:fb00:664b with SMTP id i24csp200946qtp; Fri, 4 Aug 2023 08:26:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqD23whu/vPhUeiw9zB1TY1R67wwsPSca9BiKFclgkzumYffD9sYNQJUEopryzTpJd9uF/ X-Received: by 2002:aa7:d0c3:0:b0:522:bbc1:a343 with SMTP id u3-20020aa7d0c3000000b00522bbc1a343mr1495527edo.6.1691162805598; Fri, 04 Aug 2023 08:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691162805; cv=none; d=google.com; s=arc-20160816; b=vYN85j0BItIzSwEVqJnM+TNWhLznsCIvIcnkT07nSig14UCPhIcTRg8uiMyYiPvpzZ Lq5WiE0TUc3o727uox4bhVCgzxeLVO1pZJL+BazXS8wPAjsXAJppJV1NZklRtxIUcEUV 8KGXPY2cuSloOHfd4TGt/ZvC0nN4ZV6bBRQauvOI1kQZsbN/KeE1lFoIJPe6JOFp1EIl hL3wYqY7Sa3E2EFAtsOmIPmy2AGAwzH0g65WM/jlFDYnivTs3CzfBsz1kQjb4f0HvIo2 QBDpCIsesG288P7pR2AASHjEiC94zhRgyzv2rPt41Cl4AFtJIfMuX8jg76jR8u7hFb3e WoSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=TFGCVBixHWoddaHUZlj3GwOKpQe3T9GklOi5J5GPXO8=; fh=r9hTBFsOyF9nA53+W4/h1fVM4pDqYqQOEs4CjW6CJg0=; b=dZS3ZjjvnmDinKhM19znY+gbpnBXezeUeCDsq0BEsvPVA9EilAodFrMTA0SEQr9yZE dTi+uQg7CNONKmJUY6GPh2Tj9fSPsxQhHm298xIVMEYO0g2lNp0QQ2hfGl7eJNaDz+FD wQ/tCvSrhtiWYw1EiuyifsyWB2jAU8NNmsVYfl0GvPFBLX6YCozTJi0Zs23MBMqvmGJ0 LiUD+3CdpsJ4DkyK92Juo99BZ4/zIIaLTXSDva6H4BXIGVQp0kOx7BJvupGyajb/MPii MxQQiOyfjG6473+2EV5J3Zd9Mj6Lno/Z8/nlLBeOFlRg5p5KfeEd5WqM48uXlCMDHLfX ykKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jOuRqcfr; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m19-20020aa7c493000000b0051e031046a1si506743edq.444.2023.08.04.08.25.30; Fri, 04 Aug 2023 08:26:45 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jOuRqcfr; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229584AbjHDPQz (ORCPT + 99 others); Fri, 4 Aug 2023 11:16:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbjHDPQz (ORCPT ); Fri, 4 Aug 2023 11:16:55 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FF8F46B2 for ; Fri, 4 Aug 2023 08:16:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691162168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TFGCVBixHWoddaHUZlj3GwOKpQe3T9GklOi5J5GPXO8=; b=jOuRqcfrfRadZx20NZpQFfjCY1CXPYInMtvTVlqzwxvZEfhk/qqfqn29TuharFpglUv3ya 2dcOrzDRChNmm3xWi1u5hJ8QVQSFX65sRGh6/mXJlnQ2piRbmgoKgozc3WZ+sJF/UlDR/m oQ4UZWUYPj6uYP+SjoJPxk6thR53eY8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-161-auNe4SOsMHqkrhZQkeDG0w-1; Fri, 04 Aug 2023 11:16:05 -0400 X-MC-Unique: auNe4SOsMHqkrhZQkeDG0w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 97722104458B; Fri, 4 Aug 2023 15:16:04 +0000 (UTC) Received: from [192.168.37.1] (unknown [10.22.50.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 08CACC5796B; Fri, 4 Aug 2023 15:16:03 +0000 (UTC) From: Benjamin Coddington To: Chuck Lever Cc: Jeff Layton , linux-nfs@vger.kernel.org Subject: Re: [PATCH] nfsd: Fix race to FREE_STATEID and cl_revoked Date: Fri, 04 Aug 2023 11:16:02 -0400 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 On 4 Aug 2023, at 11:02, Chuck Lever wrote: > On Fri, Aug 04, 2023 at 10:52:20AM -0400, Benjamin Coddington wrote: >> We have some reports of linux NFS clients that cannot satisfy a linux knfsd >> server that always sets SEQ4_STATUS_RECALLABLE_STATE_REVOKED even though >> those clients repeatedly walk all their known state using TEST_STATEID and >> receive NFS4_OK for all. >> >> Its possible for revoke_delegation() to set NFS4_REVOKED_DELEG_STID, then >> nfsd4_free_stateid() finds the delegation and returns NFS4_OK to >> FREE_STATEID. Afterward, revoke_delegation() moves the same delegation to >> cl_revoked. This would produce the observed client/server effect. >> >> Fix this by ensuring that the setting of sc_type to NFS4_REVOKED_DELEG_STID >> and move to cl_revoked happens within the same cl_lock. This will allow >> nfsd4_free_stateid() to properly remove the delegation from cl_revoked. >> >> Link: https://bugzilla.redhat.com/show_bug.cgi?id=2217103 >> Link: https://bugzilla.redhat.com/show_bug.cgi?id=2176575 >> Signed-off-by: Benjamin Coddington > > Hi Ben, does this fix deserve: > > Cc: stable@vger.kernel.org # v4.17+ Yes, that's probably appropriate. Ben