From patchwork Mon Dec 6 17:59:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dai Ngo X-Patchwork-Id: 12659273 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C079C433FE for ; Mon, 6 Dec 2021 17:59:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236253AbhLFSDW (ORCPT ); Mon, 6 Dec 2021 13:03:22 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:35140 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbhLFSDV (ORCPT ); Mon, 6 Dec 2021 13:03:21 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B6GnPi4010265; Mon, 6 Dec 2021 17:59:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2021-07-09; bh=a0KSR+wVkurtga4VDW4wDXXrE272i86i+m5FrFY45yY=; b=Yl96starGg5fsucHgItPP7j4MkeqUpTLHkG1hoQJMC3KJb2FV9HLcsCyayKolhjt89Ln Y6mLeeVX4XDgBQRNqOloe3uNsvigV+Y7wDYl9qtkB+UuOS9JwuxrkfE8wtLQlxy4vuuJ kD+UxNjYYsFKOuETKSmJiuUA+RWRsQdiRs4dVN+4tVQT71VAzb/PphdJWNat5NcpqDLQ LIvbjjgeR3XKMrvPmJFbIU9R9zMRWDc6RRhLaGkxPBVnldWjny+svLAhZ8PP5UInglNs AFDHrGJkx0LSJdBwhVWueAH5/cnlXzE5Iweuu+GWHoBlV8GU7+KecV1O9Ae/lxboQgYM fA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3csbbqkbtf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 06 Dec 2021 17:59:51 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1B6HucWR072283; Mon, 6 Dec 2021 17:59:50 GMT Received: from pps.reinject (localhost [127.0.0.1]) by userp3020.oracle.com with ESMTP id 3cr1smf1sa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 06 Dec 2021 17:59:50 +0000 Received: from userp3020.oracle.com (userp3020.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 1B6HxnaX081234; Mon, 6 Dec 2021 17:59:49 GMT Received: from aserp3020.oracle.com (ksplice-shell2.us.oracle.com [10.152.118.36]) by userp3020.oracle.com with ESMTP id 3cr1smf1rt-1; Mon, 06 Dec 2021 17:59:49 +0000 From: Dai Ngo To: bfields@fieldses.org Cc: chuck.lever@oracle.com, linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH RFC v6 0/2] nfsd: Initial implementation of NFSv4 Courteous Server Date: Mon, 6 Dec 2021 12:59:40 -0500 Message-Id: <20211206175942.47326-1-dai.ngo@oracle.com> X-Mailer: git-send-email 2.20.1.1226.g1595ea5.dirty MIME-Version: 1.0 X-Proofpoint-GUID: e16T1UdhVV2bYeDkgEgJNg8ufG1bbp8h X-Proofpoint-ORIG-GUID: e16T1UdhVV2bYeDkgEgJNg8ufG1bbp8h Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Bruce, This series of patches implement the NFSv4 Courteous Server. A server which does not immediately expunge the state on lease expiration is known as a Courteous Server. A Courteous Server continues to recognize previously generated state tokens as valid until conflict arises between the expired state and the requests from another client, or the server reboots. The v2 patch includes the following: . add new callback, lm_expire_lock, to lock_manager_operations to allow the lock manager to take appropriate action with conflict lock. . handle conflicts of NFSv4 locks with NFSv3/NLM and local locks. . expire courtesy client after 24hr if client has not reconnected. . do not allow expired client to become courtesy client if there are waiters for client's locks. . modify client_info_show to show courtesy client and seconds from last renew. . fix a problem with NFSv4.1 server where the it keeps returning SEQ4_STATUS_CB_PATH_DOWN in the successful SEQUENCE reply, after the courtesy client re-connects, causing the client to keep sending BCTS requests to server. The v3 patch includes the following: . modified posix_test_lock to check and resolve conflict locks to handle NLM TEST and NFSv4 LOCKT requests. . separate out fix for back channel stuck in SEQ4_STATUS_CB_PATH_DOWN. The v4 patch includes: . rework nfsd_check_courtesy to avoid dead lock of fl_lock and client_lock by asking the laudromat thread to destroy the courtesy client. . handle NFSv4 share reservation conflicts with courtesy client. This includes conflicts between access mode and deny mode and vice versa. . drop the patch for back channel stuck in SEQ4_STATUS_CB_PATH_DOWN. The v5 patch includes: . fix recursive locking of file_rwsem from posix_lock_file. . retest with LOCKDEP enabled. The v6 patch includes: . merge witn 5.15-rc7 . fix a bug in nfs4_check_deny_bmap that did not check for matched nfs4_file before checking for access/deny conflict. This bug causes pynfs OPEN18 to fail since the server taking too long to release lots of un-conflict clients' state. . enhance share reservation conflict handler to handle case where a large number of conflict courtesy clients need to be expired. The 1st 100 clients are expired synchronously and the rest are expired in the background by the laundromat and NFS4ERR_DELAY is returned to the NFS client. This is needed to prevent the NFS client from timing out waiting got the reply. . no regression wirh pynfs 4.0 and 4.1 tests.