Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp75059rdh; Tue, 13 Feb 2024 09:47:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXZRyRWh8ctR4But3/neSBV1x7IQ0QR3FRwLgTZRgDLNXh8gBiqMMAPxkrJy3QDWYveI9WxVd8lFdRa22q3KFyrDenTPdyZ6YPDD7HY4Q== X-Google-Smtp-Source: AGHT+IHBs8DTbAmKWGI/HSJ5U/9rM+PxKc7zybmAa5C16+tu4kvpriFSI5xoUbpIpvRIV9fXYo0C X-Received: by 2002:a05:6808:d52:b0:3c0:3c85:1c9f with SMTP id w18-20020a0568080d5200b003c03c851c9fmr139520oik.41.1707846466975; Tue, 13 Feb 2024 09:47:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707846466; cv=pass; d=google.com; s=arc-20160816; b=Xf23B9qNtU/VCuV8OWyYkE1nkQXNU1VIgc0QgfHrBjZVfGVCeeI49lYGhjDdG37DCw 3uyYI3IuurxfYWfFoAlyfN6El4tJQumPHJEvcDsBtc6x2/oZvLjBkUOOk4qrxUQT5z3Q m3pGH9c+Dh5i+8q9IcmqWRu1bloAggxaHL04639dwZPHhhjmbfyU0c0+ADw/MnNmxfCs vZV50CbSkQPTd0SOvz22b86AUVx8W0IkDUdVTICuBLoSYZBLwdJWiwMQKqzeeYdgjnXO 66B4Q4vDC2YevoBGwF22YMA/iqB1jbOoMxVPll3nyY739skZRtXVxIrIlCwN1BKJ0HEc CAgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature; bh=BBIknkphlJz2VSVHhmxZsuQSPJ7mex4iKirVIQL1R4k=; fh=vhUBR5E1pX0Yfp0rAdoGUM92ltWSY85kc5vTWB64xlQ=; b=zmT6mAJHatMPLmOopo9Gvnrqm7SzQzvOvdiIRw1Tkt5zKn0q8Q17axbX6KAhiTRiSj fXVb8v0LDzpEGhraTuzv0oER56tPnL51VSWNx2KspgIWJxX4G/A0df9nQbWN2aPIplDA /NK2kcOtNXjIOLtY1DKQy2sTpl2FsojAZtbzZRQokz6xK+mFhoauQyVwzdWD9sV2worb 4ODkv/eYHNoR4lOE+o3rzYnuz5OMGP1M1ZZEY3qFa59YIaA5vwfdLUxH6cPS/IpJ+7KY G+SSoAwHpe//PumLge0dH0LmlKc2yE3Xm3149WCofMMep/9qiT8JYH07RQAub6+qobGg e2Sg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=EdfzP7WM; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-nfs+bounces-1911-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1911-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com X-Forwarded-Encrypted: i=2; AJvYcCU3tIr+YSCDEYWcrmRePAStOOL/KKPIYavgzYDDiSxKp5L4B4R2Ol3F3AypkLYfCKmlVrJixu7PYO+GTYnrIKeuolsUreKt6xHOWzBQUQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u7-20020a05622a010700b0042c0efe3099si3742513qtw.360.2024.02.13.09.47.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 09:47:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1911-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=EdfzP7WM; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-nfs+bounces-1911-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1911-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A13021C219B1 for ; Tue, 13 Feb 2024 17:47:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48A6160257; Tue, 13 Feb 2024 17:47:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="EdfzP7WM" X-Original-To: linux-nfs@vger.kernel.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7EEC86024A for ; Tue, 13 Feb 2024 17:47:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.165.32 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707846465; cv=none; b=DqoEXOdUNC784h0EFtc7S6nj4B3yglUiQx76LgHaFaqdnSG9XG3G/HcLmwb/NhkOZbXZVBukVBW9ds8iFDcrig1Sk/RrfDQRj7bFWz0pSgIauKIGngcwDhimCN/fD8cmEgcz17IxR4+ZRxhkaT/aNb8ZO56J5ec0nnSYoTxmPfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707846465; c=relaxed/simple; bh=+msueTY3r5/fEl9fJfjsQ/0z3cgWitp3F3a0C9OCAS8=; h=From:To:Cc:Subject:Date:Message-Id; b=cwKItLnccJejuLzL98GxAwxXEZ1oE5+jloy0OWVX3kB8ALMQqNmGTqt5iW6RiNo3aX4DcDZJiDxZGfYeeSEZFauAspWmIvSSo1lygYcarwmOfbe/WH42Q/2KD3APW+jkroOUniS9UsyzzW/VGRAJfkl6XdxGnTntNsuBsMh0bEA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=EdfzP7WM; arc=none smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com 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 41DGXHCC010256; Tue, 13 Feb 2024 17:47:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2023-11-20; bh=BBIknkphlJz2VSVHhmxZsuQSPJ7mex4iKirVIQL1R4k=; b=EdfzP7WMY8wyNRkv2Yf8P17snFqPzmrY9fWJI5fOM13UTJTFJfV0TXoEm9hSl/VkH4dL Tr9Msl4/sxHN65T6GCxCT0bgrfYajnOcDtnsdMlipN4dR7p7HclbOEQ8O/pGP6FrNfII MNEYiNvws2+k83ywXLtcOgQ/GmntBaHqFHhu2QMErCSNScmCjYvXFbMMLFBUKqvRIt2F dNaxe7yfCYhD4xEZiuIyk1fr7yflh87u4tikKsyREoHC5+Bm4Rmqr0bX275qeu+K8pP2 JaEXLqXY2tWQ0Vp0L0GerGEES7e2G6WC6nEeqmEN2Oqd/BCBt2Oz6/lCwkaX/W+0MzX/ 0w== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w8c1s0b4k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Feb 2024 17:47:40 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41DGVNqR014965; Tue, 13 Feb 2024 17:47:40 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yk7ekys-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Feb 2024 17:47:40 +0000 Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41DHhlh6002073; Tue, 13 Feb 2024 17:47:39 GMT Received: from ca-common-hq.us.oracle.com (ca-common-hq.us.oracle.com [10.211.9.209]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3w5yk7eky3-1; Tue, 13 Feb 2024 17:47:39 +0000 From: Dai Ngo To: chuck.lever@oracle.com, jlayton@kernel.org Cc: linux-nfs@vger.kernel.org Subject: PATCH [0/2] NFSD: use CB_GETATTR to handle GETATTR conflict with write delegation Date: Tue, 13 Feb 2024 09:47:25 -0800 Message-Id: <1707846447-21042-1-git-send-email-dai.ngo@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-13_10,2024-02-12_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 mlxscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402130140 X-Proofpoint-GUID: JzaJ1oMTHFNmJL7jh-aujvwm8a4rB7gJ X-Proofpoint-ORIG-GUID: JzaJ1oMTHFNmJL7jh-aujvwm8a4rB7gJ Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Currently GETATTR conflict with a write delegation is handled by recalling the delegation before replying to the GETATTR. This patch series add supports for CB_GETATTR callback to get the latest change_info and size information of the file from the client that holds the delegation to reply to the GETATTR from the second client. NOTE: this patch series is mostly the same as the previous patches which were backed out when un unrelated problem of NFSD server hang on reboot was reported. The only difference is the wait_on_bit() in nfsd4_deleg_getattr_conflict was replaced with wait_on_bit_timeout() with 30ms timeout to avoid a potential DOS attack by exhausting NFSD kernel threads with GETATTR conflicts. fs/nfsd/nfs4callback.c | 97 +++++++++++++++++++++++++++++++++++- fs/nfsd/nfs4state.c | 119 ++++++++++++++++++++++++++++++++++++++++---- fs/nfsd/nfs4xdr.c | 10 +++- fs/nfsd/nfsd.h | 1 + fs/nfsd/state.h | 24 ++++++++- fs/nfsd/xdr4cb.h | 18 +++++++ 6 files changed, 255 insertions(+), 14 deletions(-)