Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3217293rdb; Wed, 13 Sep 2023 05:57:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUmDe68ONUKEYz5gjjCpUNYoZaUoWFuR9Z8QZhyJr5HylrnDPFUwlFMeh1kS1zvI37PiFG X-Received: by 2002:a9d:6f04:0:b0:6b8:dcd2:8b9e with SMTP id n4-20020a9d6f04000000b006b8dcd28b9emr2815366otq.7.1694609830405; Wed, 13 Sep 2023 05:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694609830; cv=none; d=google.com; s=arc-20160816; b=MmGlzkPZa9xMk6uMC56vTXQZkalDBBbYfEbaculIpQURV/pYua8gJkxu7PWXlS4ZE6 SSdHFXH0ZPbXRDsGHO584HpzZEwr0hgk/iCuL82jU7X3FjhA25MZdzlRzapIiTAzUr9x ppp5XrOQWcNFzX7nrNNt3JnJqDeIRIgpMb6i2L7xxlxb2ez0b1e3JcHwaehjRjDuKXGF wyhIGOtTJo4rNkBYjHDqjc5Rzc8nYAkIPTiU3cYgiJDkSRdQfFuKozauYkFQmuKwsRpM d/nMrgda3if4P/0yDDYtLgVKb6edI5Tc2zy4o8EMYn3TYjoFToFAaF0a8B27zlmB9lMQ EjSw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=twgRLEWHQGgDrs33JHbFXACkmGR+Ekoa3f4TUpczBRw=; fh=83jIsur+KW5rtnKSRzNFQGWV3pmTDwvrqHBfcbjqsL4=; b=apJfQWVYifBeDm4APOdizUaPdxfBaYHBLoRKB99V6LxYN5MMVT0TCpCe3dboT+gknY EqyPgFgk5Ez3qoS20W6xY9TIPyZffHNbceBqy2dBj8OAIiL6pha6RK0gMYqD26fiumk4 SfW5vOIuXUb5/EkCNmZml28MY4wLezFSD/uSokGRgRYXsXioM3jtkdTdqCne9mNeWBvW hUHEN8noeYsIYyJ7w4IvolDDWNWEeEJICPLr2xJJItgfzp9g0rnLdxS7HSFevFRAtYQC OfThWudiLFJnyHC5iOjJlAIX+05aLVealXtcejBiBECQKRuR4FDu7FY21JdTYj3U2Fc+ vU8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XYcJzyhV; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id s11-20020a056a00194b00b0068fbdfa7379si6105444pfk.311.2023.09.13.05.57.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 05:57:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XYcJzyhV; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 622F181A9B78; Tue, 12 Sep 2023 14:54:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236369AbjILVyo (ORCPT + 99 others); Tue, 12 Sep 2023 17:54:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234887AbjILVyl (ORCPT ); Tue, 12 Sep 2023 17:54:41 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 86FBA10D3 for ; Tue, 12 Sep 2023 14:53:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694555630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=twgRLEWHQGgDrs33JHbFXACkmGR+Ekoa3f4TUpczBRw=; b=XYcJzyhV1XONbwn6mv588i6teQQLELvCxL35zSD2+MBE/Y485SnTFCBMmYTWp8IA7axPEw 2OBhQ08/KwCDVrQ4F5DxEHtJfy+Af0CpM5Kgutj8caeLtypxa+GQ5jcTf2imHt3Rq8HLIo e2jZ04j3rXpM1quJkf5yuWXIA6497rI= 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-640-NfuNQi9KNDe6K-7MWlQ7wA-1; Tue, 12 Sep 2023 17:53:47 -0400 X-MC-Unique: NfuNQi9KNDe6K-7MWlQ7wA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 131BF8019DC; Tue, 12 Sep 2023 21:53:47 +0000 (UTC) Received: from fs-i40c-03.fs.lab.eng.bos.redhat.com (fs-i40c-03.fs.lab.eng.bos.redhat.com [10.16.224.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 958C840C2009; Tue, 12 Sep 2023 21:53:46 +0000 (UTC) From: Alexander Aring To: linux-nfs@vger.kernel.org Cc: gfs2@lists.linux.dev, ocfs2-devel@lists.linux.dev, linux-fsdevel@vger.kernel.org, teigland@redhat.com, rpeterso@redhat.com, agruenba@redhat.com, trond.myklebust@hammerspace.com, anna@kernel.org, chuck.lever@oracle.com, jlayton@kernel.org, aahringo@redhat.com Subject: [PATCHv2 nfsd/master 0/7] lockd: dlm: async lock request changes Date: Tue, 12 Sep 2023 17:53:17 -0400 Message-Id: <20230912215324.3310111-1-aahringo@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 12 Sep 2023 14:54:53 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Hi, I sent this as a PATCH now and drop the RFC. I got some review back from Jeff Layton and hope I was successful to follow it. There are still issues with lockd and asynchronous lock request but it will at least not directly crash when somebody is using nfs on top of GFS2. The issues are related to cancellation of locks/lockd decides to drop nlm_block for some reasons while pending request is happening. I did not change more documentation about the asynchronous lock request functionality to not confuse users. In my opinion there should be more documentation about what you SHOULD NOT do with this API. Otherwise I think the documentation is still correct. I will send a follow up patch to fsdevel to change all users using IS_SETLKW() to use FL_SLEEP to determine if it's blocking or non-blocking and send it to fsdevel as it was recommended. This will just be a grep and replace patch and look what happens. - Alex changes since v2: - remove B_PENDING_CALLBACK paragraph from commit msg. Was a leftover and I forgot to update the commit message. - change function name from export_op_support_safe_async_lock() to exportfs_lock_op_is_async() - change flag name from EXPORT_OP_SAFE_ASYNC_LOCK to EXPORT_OP_ASYNC_LOCK - add documentation for EXPORT_OP_ASYNC_LOCK to Documentation/filesystems/nfs/exporting.rst - add newline between function name and return type of exportfs_lock_op_is_async() - remove f_op->lock() check and mention it in Documentation/filesystems/nfs/exporting.rst to only use it with filesystems implementing their own ->lock() - add kdoc for exportfs_lock_op_is_async() changes since RFC: - drop the pending callback flag but introduce "lockd: don't call vfs_lock_file() for pending requests", see patch why I need it. - drop per nlm_block callback mutex - change async lock request documentation - use always FL_SLEEP to determine if it's blocking vs non-blocking in DLM Alexander Aring (7): lockd: introduce safe async lock op lockd: don't call vfs_lock_file() for pending requests lockd: fix race in async lock request handling lockd: add doc to enable EXPORT_OP_ASYNC_LOCK dlm: use fl_owner from lockd dlm: use FL_SLEEP to determine blocking vs non-blocking dlm: implement EXPORT_OP_ASYNC_LOCK Documentation/filesystems/nfs/exporting.rst | 7 ++++ fs/dlm/plock.c | 20 +++-------- fs/gfs2/export.c | 1 + fs/lockd/svclock.c | 38 ++++++++++++++------- fs/locks.c | 12 ++++--- fs/nfsd/nfs4state.c | 10 ++++-- fs/ocfs2/export.c | 1 + include/linux/exportfs.h | 14 ++++++++ 8 files changed, 67 insertions(+), 36 deletions(-) -- 2.31.1