Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2914969rdb; Tue, 12 Sep 2023 16:56:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1mtYJ1WNEEfS+nG1s2tIvD623C08rI/9dUO/P3AapUk2dmQ0qlelKSyQ4bc77rfGMQclW X-Received: by 2002:a05:620a:c4c:b0:768:1db5:d9d1 with SMTP id u12-20020a05620a0c4c00b007681db5d9d1mr1156599qki.5.1694563019222; Tue, 12 Sep 2023 16:56:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694563019; cv=none; d=google.com; s=arc-20160816; b=flK2aP6bCpxhaRhN77dwElNVvtPXUFWeQoG4JMvPpZqltCMgWoNQiXLb7ZHm/hsiqd 03frimtzDoLxlRcAmjQVJzJqD0U0sIIYxVjA5Lnh+vLVsV4ydwfIcRgaNSQev5KIhO8O aJx+PP8wvj+ctA7X5BoX9kGrBHFDLp0R3uUC+WwWML6gcH3GppSTn2HWn1t4gwm5b290 wX2eDpoGK22e7QalnvifPAI26eF/kW3LGIYTQUci6F3GmbK6LUq1SA80lWKCCHfz4ij/ D8W5wMG1rGl/iVk8wE+rpF2uDvbW9d6PHI8gPy7aB6ySoyxBT1Fr8clmqU4lq9U6pqHK F/QQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IckdSVzMK+BSFRjaA/U5gFIv6MBdqOAoK8cZbMlk/7Y=; fh=83jIsur+KW5rtnKSRzNFQGWV3pmTDwvrqHBfcbjqsL4=; b=xxSjJInyc6U0M+KEnau7ZUSO0FBzp5yCM+gRjT54c1ZszdkKsWy3D31x4vbXgiMGwV xO3saSw/y6Ey1R7scyl0k3QaLcJQW+I7NtYhgEEZcUSkyC0yObs3T8gRgsJkYy/VQG1v CzAeiRL6kOAr7jMvN0WbKWm1b8Ubc5EGYwy3y503SyRHlaRGNXl3FyjC2zHMao5D1DeE SK03wrMnT7DLb7NE7Gm8+r5Px8c4uAYnNr4HfPmjU54pjbRCQyWz4TKaUXQQ2OFS4sx4 A9lx8PjS+NYDZLnTMQVXI++RAa1RjW2LTAxy2N5kSk3FCgdNTdMxKJB77Bj5dcN9syhm Iitg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=brNK+rXP; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id f16-20020a63e310000000b00565e0624182si5491490pgh.404.2023.09.12.16.56.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 16:56:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=brNK+rXP; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 179F381EA5EA; Tue, 12 Sep 2023 14:55:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230453AbjILVzZ (ORCPT + 99 others); Tue, 12 Sep 2023 17:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235507AbjILVzY (ORCPT ); Tue, 12 Sep 2023 17:55:24 -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 0F93710F7 for ; Tue, 12 Sep 2023 14:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694555634; 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: in-reply-to:in-reply-to:references:references; bh=IckdSVzMK+BSFRjaA/U5gFIv6MBdqOAoK8cZbMlk/7Y=; b=brNK+rXPAIPNL9mnVhocF96rsB2ezZF8EspR+1NlwHmaVuYpK4RbAXbMIQkVIMsyJDHFtR bscGAds25MyR5sinoY2+85+Z2mbGVf/sLjb/6ZXoNPnJfTaBqPO+2wc2X0/W9R5EwYbOwk OonfY/d4NuLA+mUgoO9vaPDCk01crkE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-606-FlW2D6UtODqTg0xXP3PKsQ-1; Tue, 12 Sep 2023 17:53:49 -0400 X-MC-Unique: FlW2D6UtODqTg0xXP3PKsQ-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 6D5673806702; Tue, 12 Sep 2023 21:53:48 +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 1FD2440C200A; Tue, 12 Sep 2023 21:53:48 +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 4/7] lockd: add doc to enable EXPORT_OP_ASYNC_LOCK Date: Tue, 12 Sep 2023 17:53:21 -0400 Message-Id: <20230912215324.3310111-5-aahringo@redhat.com> In-Reply-To: <20230912215324.3310111-1-aahringo@redhat.com> References: <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 (morse.vger.email [0.0.0.0]); Tue, 12 Sep 2023 14:55:23 -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 morse.vger.email This patch adds a note to enable EXPORT_OP_ASYNC_LOCK for asynchronous lock request handling. Reviewed-by: Jeff Layton Signed-off-by: Alexander Aring --- fs/locks.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 76ad05f8070a..d4e49a990a8d 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -2264,11 +2264,13 @@ int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock *flock) * To avoid blocking kernel daemons, such as lockd, that need to acquire POSIX * locks, the ->lock() interface may return asynchronously, before the lock has * been granted or denied by the underlying filesystem, if (and only if) - * lm_grant is set. Callers expecting ->lock() to return asynchronously - * will only use F_SETLK, not F_SETLKW; they will set FL_SLEEP if (and only if) - * the request is for a blocking lock. When ->lock() does return asynchronously, - * it must return FILE_LOCK_DEFERRED, and call ->lm_grant() when the lock - * request completes. + * lm_grant is set. Additionally EXPORT_OP_ASYNC_LOCK in export_operations + * flags need to be set. + * + * Callers expecting ->lock() to return asynchronously will only use F_SETLK, + * not F_SETLKW; they will set FL_SLEEP if (and only if) the request is for a + * blocking lock. When ->lock() does return asynchronously, it must return + * FILE_LOCK_DEFERRED, and call ->lm_grant() when the lock request completes. * If the request is for non-blocking lock the file system should return * FILE_LOCK_DEFERRED then try to get the lock and call the callback routine * with the result. If the request timed out the callback routine will return a -- 2.31.1