Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1183190rwd; Sat, 20 May 2023 14:38:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7T5D0gZjWB6TYrPQ4AjBccZ0zZAlFSz2rYVojUQtcBvMxl68Ntq38qYInG5CTAIPsEzYxV X-Received: by 2002:a05:6a20:2d1f:b0:101:b080:e744 with SMTP id g31-20020a056a202d1f00b00101b080e744mr6188609pzl.42.1684618714937; Sat, 20 May 2023 14:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684618714; cv=none; d=google.com; s=arc-20160816; b=Wd6Xl01kaBaO9u8YAoUzSp9irNA0OG+6MiwQvZ+Y7HpVTphtVCu7K6rKuMWpJPADi4 CNI3EcUehhOQsvf1Dvfm08mi8pxFdHrZ1Z0R7rfYqU9lgpNTAaq+m8JKr57FX/yq8G+V mGzWfr6kVLbk3EANi7gCDZW6hqOEhd3m4EBYcXnUsPGh1igiGgYKxobMgVxfKEcg5TpF oZb07seOotGzeibxJ2a6riYUGy1VFvv7uSMcoAW7924U3eBXYdJbRvN+tCh3RhguMBBH bThziIju2aAmfi8nD9NSkbBHugcbyNFJq0PSZ3lFaA1p0bvejHCRXXvpFlR5hcVoMklX Gnww== 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=Hmva6kEKO11S1kN8sb0nXxJApRRvBA7nuqN6A8zSpUUq0zcNVC3ZypV/WpuKp6FnOy so7MeVL1v0hj8i4frbgf/HL5vzYLspuQ1eO2Y+waH4sbYFgq8n09u+lSkuuOfRAANHqG OertwcSyJNCO3h+yn087+j4R/TLYi8yWLPrp+sR6I7eKXC06n9e/L/Wr/xsTMZaJGJ2N mMRroxJLNNcqlK2K6UZYJl/I1wOLDkkwOq0+43Oo5kdAqZ4ynFUnl8mglZpC5yOXj/yR UeJOfVb4yQOJN8L+PLYUtSlJBDyDRI0Afb8dFY4v2ViAiO0NHhs4z5MN7DGwX1P9o43X qb7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=ciMbN7cD; 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 w18-20020a639352000000b0051b37c000dcsi2174376pgm.81.2023.05.20.14.38.21; Sat, 20 May 2023 14:38:34 -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=ciMbN7cD; 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 S229464AbjETVg5 (ORCPT + 99 others); Sat, 20 May 2023 17:36:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbjETVg4 (ORCPT ); Sat, 20 May 2023 17:36:56 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0ACEEA; Sat, 20 May 2023 14:36:55 -0700 (PDT) Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34KLT7fX014342; Sat, 20 May 2023 21:36:48 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=ciMbN7cDjcMXmRVipSwulpW+tcFIhyRL9UjTaerlkAr4XRAmtrQwN9rW/MCkUBjYIxCO A1Y49iuk8hwXEIDPilRrAMp0d0ve5zZkP/cfXbZTJenqUotqwqDgd5L+eqTxeV4+JeL2 FuFsStl0revrgBFEDfRQgvydciYDvBV+xmpDon2D6sraEXsMkOrxFD0kBYdjwbWMuC39 c/2gSOTe/KyklFGDxZDy5xD9jbku9ilwzeCre0v6bXvi9uU0E6Y2HPDbk1dygLA1L7HP iDF+O7/SH2hrbH+KNBuyM618CQykvOYjm34XmDAUfKm9xC/D8uvWogEpSp3YXVT1Ppoo UA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qpp5bgnp5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 20 May 2023 21:36:48 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34KG50B9011202; Sat, 20 May 2023 21:36:46 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qpmn82h4f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 20 May 2023 21:36:46 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34KLajTn030297; Sat, 20 May 2023 21:36:46 GMT Received: from ca-common-hq.us.oracle.com (ca-common-hq.us.oracle.com [10.211.9.209]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3qpmn82h46-2; Sat, 20 May 2023 21:36:46 +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 v4 1/4] locks: allow support for write delegation Date: Sat, 20 May 2023 14:36:32 -0700 Message-Id: <1684618595-4178-2-git-send-email-dai.ngo@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1684618595-4178-1-git-send-email-dai.ngo@oracle.com> References: <1684618595-4178-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.170.22 definitions=2023-05-20_14,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 malwarescore=0 suspectscore=0 adultscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305200192 X-Proofpoint-GUID: NYuhYJ4it656svUncTS6WjAJudx-zDOV X-Proofpoint-ORIG-GUID: NYuhYJ4it656svUncTS6WjAJudx-zDOV 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, 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