Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp548336pxb; Sat, 20 Feb 2021 12:35:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrWZmRjZwV32f4mKkGg+szpXJG3ESJbkdRY4CdKFBfnxsb2sfj07mTUgxptg6F5HQPezYa X-Received: by 2002:a17:906:c2d2:: with SMTP id ch18mr14709757ejb.385.1613853319547; Sat, 20 Feb 2021 12:35:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613853319; cv=none; d=google.com; s=arc-20160816; b=jO6gCjwQdjb232tC707cTJzaDTd3cO5Peu83TqT2tvRJL00ZlOoai3KsM/5tay2VG/ ERpmLE7c0KsFr5xJImf5ASH60iG49gC4y12qbSv+vhmz/1LUH5idLu+gFDOdhQUzu2mh 0pvLltggEPtA1QFB7iy7ea2xPumZpUurVlDBMCrOypvyHjilt3AGqG8O01K4UWCQ0U10 Fs8TXJQhI+X5znGLIPb05P4K+MNG4nfqcAfmxGyiqV/LHLdDsgE7ugB+OAHOuw01j9rs zlO9Tw3grRr8PZXnrk7bpGoCBRC8TCwgrqd6ht550VWFU8c9A0IIknbwda5Sr7zPMG4J D0zw== 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:organization :from:references:cc:to:subject; bh=4L7RlGX1wTx1GG+1WAi+fIR1oQnoAy1bFdaTsN5ymMw=; b=eR4VL8lHRD8Mgt5ieuJNXy+VH8CvOxZFg2GIjYc4s/6rrNcaGbgUmeuG/ZvlTZ+cmz mz4Ww7jAzv6duvt10ClsKtlB5TO5DJBorpo7SrrDoSf12uc1Um3weqGtUI0MjpSu2AS7 nHs59Xhwi8WOnomFyw7vjNrEElnxUabL9ko9JziBNuZKi/7RPkXXy03TY6PphiIpXp9v Wb3PZWZSrMeFAf6wi9KDtio7wBKGBo82mxTIYoLZlqaOxaPVfvggr+Dlsa9sUll04U0g SLt4cXtTPkJoHW7EU1So4Ca4kFK+VNooX09eCWSIAmzZvsPAY6YIlahbBqJE5HpWVLOS fs3w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n12si8470454edr.430.2021.02.20.12.34.49; Sat, 20 Feb 2021 12:35:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbhBTUe3 (ORCPT + 99 others); Sat, 20 Feb 2021 15:34:29 -0500 Received: from ivanoab7.miniserver.com ([37.128.132.42]:45452 "EHLO www.kot-begemot.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbhBTUe0 (ORCPT ); Sat, 20 Feb 2021 15:34:26 -0500 X-Greylist: delayed 1192 seconds by postgrey-1.27 at vger.kernel.org; Sat, 20 Feb 2021 15:34:25 EST Received: from tun252.jain.kot-begemot.co.uk ([192.168.18.6] helo=jain.kot-begemot.co.uk) by www.kot-begemot.co.uk with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lDYdP-0001Ob-Ez; Sat, 20 Feb 2021 20:13:47 +0000 Received: from madding.kot-begemot.co.uk ([192.168.3.98]) by jain.kot-begemot.co.uk with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lDYdN-0007Q5-1O; Sat, 20 Feb 2021 20:13:47 +0000 Subject: Re: NFS Caching broken in 4.19.37 To: Salvatore Bonaccorso Cc: Linux Kernel Mailing List , 940821@bugs.debian.org, linux-nfs@vger.kernel.org, bfields@fieldses.org, chuck.lever@oracle.com References: <5022bdc4-9f3e-9756-cbca-ada37f88ecc7@cambridgegreys.com> From: Anton Ivanov Organization: Cambridge Greys Message-ID: Date: Sat, 20 Feb 2021 20:13:44 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Score: -1.0 X-Spam-Score: -1.0 X-Clacks-Overhead: GNU Terry Pratchett Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 20/02/2021 20:04, Salvatore Bonaccorso wrote: > Hi, > > On Mon, Jul 08, 2019 at 07:19:54PM +0100, Anton Ivanov wrote: >> Hi list, >> >> NFS caching appears broken in 4.19.37. >> >> The more cores/threads the easier to reproduce. Tested with identical >> results on Ryzen 1600 and 1600X. >> >> 1. Mount an openwrt build tree over NFS v4 >> 2. Run make -j `cat /proc/cpuinfo | grep vendor | wc -l` ; make clean in a >> loop >> 3. Result after 3-4 iterations: >> >> State on the client >> >> ls -laF /var/autofs/local/src/openwrt/build_dir/target-mips_24kc_musl/linux-ar71xx_tiny/linux-4.14.125/arch/mips/include/generated/uapi/asm >> >> total 8 >> drwxr-xr-x 2 anivanov anivanov 4096 Jul 8 11:40 ./ >> drwxr-xr-x 3 anivanov anivanov 4096 Jul 8 11:40 ../ >> >> State as seen on the server (mounted via nfs from localhost): >> >> ls -laF /var/autofs/local/src/openwrt/build_dir/target-mips_24kc_musl/linux-ar71xx_tiny/linux-4.14.125/arch/mips/include/generated/uapi/asm >> total 12 >> drwxr-xr-x 2 anivanov anivanov 4096 Jul 8 11:40 ./ >> drwxr-xr-x 3 anivanov anivanov 4096 Jul 8 11:40 ../ >> -rw-r--r-- 1 anivanov anivanov 32 Jul 8 11:40 ipcbuf.h >> >> Actual state on the filesystem: >> >> ls -laF /exports/work/src/openwrt/build_dir/target-mips_24kc_musl/linux-ar71xx_tiny/linux-4.14.125/arch/mips/include/generated/uapi/asm >> total 12 >> drwxr-xr-x 2 anivanov anivanov 4096 Jul 8 11:40 ./ >> drwxr-xr-x 3 anivanov anivanov 4096 Jul 8 11:40 ../ >> -rw-r--r-- 1 anivanov anivanov 32 Jul 8 11:40 ipcbuf.h >> >> So the client has quite clearly lost the plot. Telling it to drop caches and >> re-reading the directory shows the file present. >> >> It is possible to reproduce this using a linux kernel tree too, just takes >> much more iterations - 10+ at least. >> >> Both client and server run 4.19.37 from Debian buster. This is filed as >> debian bug 931500. I originally thought it to be autofs related, but IMHO it >> is actually something fundamentally broken in nfs caching resulting in cache >> corruption. > According to the reporter downstream in Debian, at > https://bugs.debian.org/940821#26 thi seem still reproducible with > more recent kernels than the initial reported. Is there anything Anton > can provide to try to track down the issue? > > Anton, can you reproduce with current stable series? 100% reproducible with any kernel from 4.9 to 5.4, stable or backports. It may exist in earlier versions, but I do not have a machine with anything before 4.9 to test at present. From 1-2 make clean && makeĀ  cycles to one afternoon depending on the number of machine cores. More cores/threads the faster it does it. I tried playing with protocol minor versions, caching options, etc - it is still reproducible for any nfs4 settings as long as there is client side caching of metadata. A. > > Regards, > Salvatore > -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/