Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp21582927rwd; Thu, 29 Jun 2023 19:05:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlHnV3Z/u5N7Cun7BAyCTBpXWFiuVedPEY/5GgCOp+SUW465yt0JlduLO550knOg63APE7b+ X-Received: by 2002:a17:90b:4c8f:b0:263:3c2e:1a3 with SMTP id my15-20020a17090b4c8f00b002633c2e01a3mr949018pjb.3.1688090745954; Thu, 29 Jun 2023 19:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688090745; cv=none; d=google.com; s=arc-20160816; b=oLp4JYr8KFbI53YGebuiAEHNjjoCsFU0JIMnDBegcIgIk6evYbly1U6y8iUB+bc4P+ 2GgmAE08+wYZ2OTC0RKlzN5JfdtidL4IMH/Kg7adixohp4SGQvd4Xyh9ixe0Nqp9cxx8 90qm1Tg0HUiCHIzWDdMqfRcjYsqea5S5/E7T6zlNj3YZ4Z0wkqXipT/gI46x+2kHkz2E osixUTKPwHuLAWgP7fuoYoFRV3NYR2yIH/tSS1b3Ol3tKzymFnMj7mdTCqhm0GrTmcl/ mC066IZGzVmcHnCeypjSpA8HqHeZEVOYp9CKxjgZ53MpK7ZFd3aH/1bfINT94PmeO3N9 RnMQ== 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=nq+VTikulC7/MtA6NoALJ65gGF5jo5R0NLyFgz/M0FE=; fh=v8xUtyFkmzGZMmWmAQ4FadTGq5GKhFfG2qkBWhr83JU=; b=hygNYJH/fD8P7eEOCSMMdIWRStKNsKD9UE/nT7JwngKROhDODtXdieSgtW5ZG/kG0H iIKn/10ys+1Boec+DQ4LrFJkVaw0lJDhF3MMbyuaKtH4BpOcUEdksq7HN2CsfI1jRWIk FiBg9OmzkDAGfRiL6wnzU/wx+PYNz1NoU8zHwAuTtL7dvo04dAPvnZo1+s3g3lo5ypll DVuHXd7WE1a0xYwT+eMFmCx8TrSoibUKkQ7oT8o1TMfkOuVamDtZWO/eCjWv9MehX03m mWZiKSP+1yMrGDqvV8btVO9ULC6dt5R0KWLJ5udqYVXc+ZI+8fsUlDxlId4hCe+oDV5Z s5UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=mTyhMFmq; 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 9-20020a17090a0b8900b00262df8f6cf2si9543876pjr.43.2023.06.29.19.05.30; Thu, 29 Jun 2023 19:05: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=@oracle.com header.s=corp-2023-03-30 header.b=mTyhMFmq; 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 S230488AbjF3BxA (ORCPT + 99 others); Thu, 29 Jun 2023 21:53:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230079AbjF3Bw7 (ORCPT ); Thu, 29 Jun 2023 21:52:59 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FC12E68 for ; Thu, 29 Jun 2023 18:52:58 -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 35TNbavE031766; Fri, 30 Jun 2023 01:52:54 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=nq+VTikulC7/MtA6NoALJ65gGF5jo5R0NLyFgz/M0FE=; b=mTyhMFmqUqrwDBrzUhRmXITSB/FAD7wpA4z/KCHRSQvmugrBhChNeJfUVl8yFDMwBHR1 SkxoFhlg1hAafZ+vwT4d64Zpm+emBWs9aXn9hueIwagmdMk9QecnC1OqdgSWistekQIn HwbaAttmr3GbO65kyV0s+vTEjTVwP0FvG/UIG2QGlIJrLM9qJBz/0zK2qep3gDmbEezb 9vgHLa5WaeFr4fHER/lga1KyWv1vbnuV/rbGFE/NkDFBn5RoDY9e7Yg3wbWkd8EP+TyU 4FGVnJnT83TLX4Y53HvUtHHxfEFsd+cjAvWidUyrIuHgclfSyOP9/L/jk+jUJOko6QVm KA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rdqdtxy48-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Jun 2023 01:52:54 +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 35U0SwIS020074; Fri, 30 Jun 2023 01:52:52 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpxdypyu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Jun 2023 01:52:52 +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 35U1qper034790; Fri, 30 Jun 2023 01:52:52 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 3rdpxdypy9-2; Fri, 30 Jun 2023 01:52:52 +0000 From: Dai Ngo To: chuck.lever@oracle.com, jlayton@kernel.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH v7 1/4] locks: allow support for write delegation Date: Thu, 29 Jun 2023 18:52:37 -0700 Message-Id: <1688089960-24568-2-git-send-email-dai.ngo@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1688089960-24568-1-git-send-email-dai.ngo@oracle.com> References: <1688089960-24568-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.591,FMLib:17.11.176.26 definitions=2023-06-29_10,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306300014 X-Proofpoint-GUID: LS7gkiVvzCCUyqH_RAeG7KKiRYiqmajm X-Proofpoint-ORIG-GUID: LS7gkiVvzCCUyqH_RAeG7KKiRYiqmajm 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_H5,RCVD_IN_MSPIKE_WL,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.39.3