Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3619082rwd; Mon, 22 May 2023 17:25:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7g+lbuim4XHmaRg2TrjTtQiYIvGbE9DrMExCePgcU5gR5tTf2TfBigY/F71BmepCWKXxbW X-Received: by 2002:a17:902:f7c6:b0:1ae:3036:b594 with SMTP id h6-20020a170902f7c600b001ae3036b594mr11190538plw.49.1684801533783; Mon, 22 May 2023 17:25:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684801533; cv=none; d=google.com; s=arc-20160816; b=U7InNHOGpD6kzzm1owDFAQX8A5RwntmK3IKnvFOqAcpFQTjd5cIhaIqtFKN7His6K/ ACYXSin5BV9YOAG/CNcxp29Pv0BnWD7nZLg0nCeGN85fAOBPl66zyNZOGCpIPGXs8a4c h3fDvHq8Wa3R0pCc/dC9/VDYoYDmNcY0mxXOLkh8rfc/HHYdo4Z/UwzFXJjGtoOzEOpf YgAJvomWBtzUH5rT6Vjue9iktwHZj+bE2C09LbPlDZcmGisCK8xDRJymaC65r9OFoGL0 ifJ7GX0iDk2oVX9pmz0OaIEkorPlHHj+MiFbLrQiRNI1A9d/ykQtVFMW+J9Y/tAmC6nF 096w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=/N2LpwZMHf8t9rQO6kZ7l4/DJAl3DnwMVCbSh1H47sk=; b=MEki/7fiqYxBznq/lkmYRpmO8eItjgdWbYxljJrI29icgDNwtZ6gB3Iaq7yor72AAD uoFjAT/62dVl4YAwtI5eIbcrO7ajHn5oQ66dOdRHA425BXm0nL/8MVevD6F5pjQiXCg0 4S/r1Af3IS5EjD9WiKMYBssSK2vOpKfVklYanfR+WUszFWC+1oFFGxiMW1nqNp21JhG2 0unDc65vSHxUAibG5eN/UZL9MDAZI99tGSpzWrU3oGTxhqvp9g3w9WIBWUygNaeBgyly /klwUYRoDqeauB8YZCdDuPRTR+Bq2NGD6efnvj+BSQZNFubHYqGkL4tFvh9Dj8EjR0Nk 6fbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=1IEseT7I; 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=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i25-20020a633c59000000b005347fcb785dsi921270pgn.181.2023.05.22.17.25.21; Mon, 22 May 2023 17:25:33 -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=@oracle.com header.s=corp-2023-03-30 header.b=1IEseT7I; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229615AbjEWAYp (ORCPT + 99 others); Mon, 22 May 2023 20:24:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234472AbjEVX4t (ORCPT ); Mon, 22 May 2023 19:56:49 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 761692128; Mon, 22 May 2023 16:52:59 -0700 (PDT) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34MKNuIB019632; Mon, 22 May 2023 23:52:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-03-30; bh=/N2LpwZMHf8t9rQO6kZ7l4/DJAl3DnwMVCbSh1H47sk=; b=1IEseT7IyF+uW70NfXFKjWbwz6zKuWfL4Iuc4iCrhD3thRwlP7CeN9PJChjcTwbMJ4xO x6HOgWtGymG7IHxwPprc3FBhzhyI3R14BFblqiBsV0co4pc0H4UHnjToA6vbb9MHV+Wt dJieTk81ELtH2JXypoq4irLKI58jMFhhNQp7t9HpRxo0W5D9UvagpjuklwLglDwQuekP sOIJIbv1LW4oEbwWn9CyBz7Q3iZ+g/RSHiIOHF4FZ14c/A4FjzEI7pzOH3Qb2QytG09g tpPJfkLfoJ3NShIDZkUENuiNcLTRoitq2jmxvmPj2iz/RLXU+TGMYcpzBi7STK2M0s/i hw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qpp8cbxqa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 May 2023 23:52:55 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34MLagYP013996; Mon, 22 May 2023 23:52:55 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qqk7e43wb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 May 2023 23:52:55 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34MNqqh3018982; Mon, 22 May 2023 23:52:54 GMT Received: from ca-common-hq.us.oracle.com (ca-common-hq.us.oracle.com [10.211.9.209]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3qqk7e43vc-4; Mon, 22 May 2023 23:52:54 +0000 From: Dai Ngo To: chuck.lever@oracle.com, jlayton@kernel.org Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v5 3/3] locks: allow support for write delegation Date: Mon, 22 May 2023 16:52:40 -0700 Message-Id: <1684799560-31663-4-git-send-email-dai.ngo@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1684799560-31663-1-git-send-email-dai.ngo@oracle.com> References: <1684799560-31663-1-git-send-email-dai.ngo@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-22_17,2023-05-22_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305220201 X-Proofpoint-ORIG-GUID: bZUU06QhhgBAJ5HlQcp5qEoPkWi9On9u X-Proofpoint-GUID: bZUU06QhhgBAJ5HlQcp5qEoPkWi9On9u X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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-nfs@vger.kernel.org Remove the check for F_WRLCK in generic_add_lease to allow file_lock to be used for write delegation. First consumer is NFSD. Signed-off-by: Dai Ngo --- fs/locks.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index df8b26a42524..08fb0b4fd4f8 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1729,13 +1729,6 @@ generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **pr if (is_deleg && !inode_trylock(inode)) return -EAGAIN; - if (is_deleg && arg == F_WRLCK) { - /* Write delegations are not currently supported: */ - inode_unlock(inode); - WARN_ON_ONCE(1); - return -EINVAL; - } - percpu_down_read(&file_rwsem); spin_lock(&ctx->flc_lock); time_out_leases(inode, &dispose); -- 2.9.5