Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3552800pxb; Mon, 9 Nov 2020 14:27:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDjWphpf1IUvX6wdeV2UKuqC682PdRy4pHCclZP2kTBtEtyWmry+E/bHbCA5AqCO0JM3xv X-Received: by 2002:a50:e183:: with SMTP id k3mr17667059edl.111.1604960870233; Mon, 09 Nov 2020 14:27:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604960870; cv=none; d=google.com; s=arc-20160816; b=qzfSjVHCKIbLT8AEeOoUIT6dSlJhmrPJAtMPL183oX4dkcU4eOuvwQKs50ZkJhoa8R qtkp38QFCNkA/F82gDdINE/DUDJUl05IEG1N1jbk6SlGCA0x0h3ugMlEWbIsJeCkLZyg sI4OxGO0qHQ5drOsKLBn6wL1U20HrokKJyM/+5T/3SSkmomkypa6gvBVupYdRw2UgVYs U9j8URWdZoq17Yw2eCckbASTFZ3+errjJ2105jdeJ6A6+LNajirS/j9TpB2al2oLO9V9 2cHBYdU9tDL2cjmnKuiSrUcW7qF73n0LR7Sf2SGoQOGeZ1ZYGXsS3yAtPLJrPHu0TvOj hfBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=0ZJRy9RnZmHGyK8akzTu+QHy67v3hJLon9bxf7Fw+0k=; b=uZ6XA4bExAEGDZIKbrgQu6W3l0+pVg83tkxnpTsdJxp5MuTNtKaqoNlPxnUhnWs1Mq cVrPgzJo1Yun3aAVQDrzGFaiAV01wiNz2b8IZkrONUGxJZO9NmkX+wl3VTdcCHNjCM3Q LdCHNAILTk+kOSQY8IEFAZ9k+3mHt8iyaQS02epYTJi0OABl1MEse5Fs3m0X9c69HvMp E3gsQCoHf+kBQBiJQelU8snkVeLoigFLFMk9YF1pb6hd16ajz/63a6v4FbY5CMsDvhft QSefwYjxLab2OW0lb+P8+vexUGnVN3A/mVc1/aKO3G9p5FhTaNg8DoqHTMZUKmFjVMhX vgFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=uY5Izoci; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk4si2648533edb.429.2020.11.09.14.27.14; Mon, 09 Nov 2020 14:27:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=uY5Izoci; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 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 S1731565AbgKIW0l (ORCPT + 99 others); Mon, 9 Nov 2020 17:26:41 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:45468 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731496AbgKIW0l (ORCPT ); Mon, 9 Nov 2020 17:26:41 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0A9MOtFU105476; Mon, 9 Nov 2020 22:26:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=0ZJRy9RnZmHGyK8akzTu+QHy67v3hJLon9bxf7Fw+0k=; b=uY5Izoci7iQPN3mHYZSnBfOkgcbFzkFhD+a48ZzYtFWGDEc0/L8mCAdQ9XFhyY0Iuocn /qbKoDNX5ogzjyLgIoIsi6zDy/dnEVm3Oe0qC0BsoPSSPnaFLLF2ln89Vn/ff/t2CyMb p/0iRZjX4PydjRf2s8aFfn/zYwcQ556njKakMpWo6BDbtlYqjlt2sjI1SFVkkjXLFP92 5POjeGToFYReENnoKqUXVeAngaLb0MJk6EpFWlsfZlY4aYc/EzOM8awumSfvJJdFtDvG Vaq1bzcctbwwwAz6iYZDL/8P7jEN+0c7WLo7qf+Xw98+4cm6FDuCauoT171ZGhntDN8X 4Q== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 34nkhkrks9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 09 Nov 2020 22:26:39 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0A9MK6mO149769; Mon, 9 Nov 2020 22:26:38 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 34p5gvwxk8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 Nov 2020 22:26:38 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 0A9MQc7C001215; Mon, 9 Nov 2020 22:26:38 GMT Received: from dhcp-10-154-143-59.vpn.oracle.com (/10.154.143.59) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 09 Nov 2020 14:26:37 -0800 Subject: Re: [PATCH v4 1/1] NFSv4.2: Fix NFS4ERR_STALE error when doing inter server copy To: "J. Bruce Fields" Cc: linux-nfs@vger.kernel.org References: <20201019034249.27990-1-dai.ngo@oracle.com> <20201020170114.GF1133@fieldses.org> <20201109183054.GD11144@fieldses.org> <20201109204206.GA20261@fieldses.org> From: Dai Ngo Message-ID: <7a18452a-3120-ea5b-f676-9d7e18a65446@oracle.com> Date: Mon, 9 Nov 2020 14:26:37 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.4.1 MIME-Version: 1.0 In-Reply-To: <20201109204206.GA20261@fieldses.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9800 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 malwarescore=0 suspectscore=3 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011090141 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9800 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 priorityscore=1501 mlxscore=0 suspectscore=3 mlxlogscore=999 lowpriorityscore=0 spamscore=0 malwarescore=0 adultscore=0 clxscore=1015 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011090141 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 11/9/20 12:42 PM, J. Bruce Fields wrote: > On Mon, Nov 09, 2020 at 11:34:08AM -0800, Dai Ngo wrote: >> On 11/9/20 10:30 AM, J. Bruce Fields wrote: >>> On Tue, Oct 20, 2020 at 11:34:35AM -0700, Dai Ngo wrote: >>>> On 10/20/20 10:01 AM, J. Bruce Fields wrote: >>>>> On Sun, Oct 18, 2020 at 11:42:49PM -0400, Dai Ngo wrote: >>>>>> NFS_FS=y as dependency of CONFIG_NFSD_V4_2_INTER_SSC still have >>>>>> build errors and some configs with NFSD=m to get NFS4ERR_STALE >>>>>> error when doing inter server copy. >>>>>> >>>>>> Added ops table in nfs_common for knfsd to access NFS client modules. >>>>> OK, looks reasonable to me, applying. Does this resolve all the >>>>> problems you've seen, or is there any bad case left? >>>> Thanks Bruce. >>>> >>>> With this patch, I no longer see the NFS4ERR_STALE in any config. >>>> >>>> The problem with NFS4ERR_STALE was because of a bug in nfs42_ssc_open. >>>> When CONFIG_NFSD_V4_2_INTER_SSC is not defined, nfs42_ssc_open >>>> returns NULL which is incorrect allowing the operation to continue >>>> until nfsd4_putfh which does not have the code to handle nfserr_stale. >>>> >>>> With this patch, when CONFIG_NFSD_V4_2_INTER_SSC is not defined the >>>> new nfs42_ssc_open returns ERR_PTR(-EIO) which causes the NFS client >>>> to switch over to the split copying (read src and write to dst). >>> That sounds reasonable, but I don't see any of the patches you've sent >>> changing that error return. Did I overlook something, or did you mean >>> to append a patch to this message? >> Since with the patch, I did not run into the condition where NFS4ERR_STALE >> is returned so I did not fix this return error code. Do you want me to >> submit another patch to change the returned error code from NFS4ERR_STALE >> to NFS4ERR_NOTSUPP if it ever runs into that condition? > That would be great, thanks. (I mean, it is still possible to hit that > case, right? You just didn't test with !CONFIG_NFSD_V4_2_INTER_SSC ?) will do. I did tested with (!CONFIG_NFSD_V4_2_INTER_SSC) but did not hit this case. Because with this patch, when CONFIG_NFSD_V4_2_INTER_SSC is not defined the new nfs42_ssc_open returns ERR_PTR(-EIO), instead of NULL in the old code, which causes the NFS client to switch over to the split copying (read src and write to dst). Returning NULL in the old nfs42_ssc_open is not correct, it allows the copy operation to proceed and hits the NFS4ERR_STALE case in the COPY operation. -Dai > > --b.