From owner-freebsd-fs@freebsd.org Sat Jan 16 05:23:51 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50F2A4D38DA for ; Sat, 16 Jan 2021 05:23:51 +0000 (UTC) (envelope-from jdavidlists@gmail.com) Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DHmgB5BMZz4rHp for ; Sat, 16 Jan 2021 05:23:50 +0000 (UTC) (envelope-from jdavidlists@gmail.com) Received: by mail-lf1-x129.google.com with SMTP id m25so16328712lfc.11 for ; Fri, 15 Jan 2021 21:23:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=t25NAXjITrZ6RjcEhuy478lZwWQZQG0Ex2FBQgBxuf0=; b=k1SsFHms61L+KKMqp898wuFrj5kSKfbqhk/jfZMdKou9ZtTqQrd9mX42dMAP60ARhA Xh9zUiyFJaC6uqb5Nxk309KOtonJ+PVC+GpUbZdSzpiCV9a9/xAmtFC9U+l+LFw9+Qc8 4SgtTXk/b7LFb1n3o3jTzz9uhc8mVkdUpe3PGWMI6UTXs7FnZyXrp6rLFKoHzoHVkFSV BRHl/I5TJLi9dzl+L+kc1/LXBF5vayQbRV99OmAx25K8lo+x8Cl1xpNjGJCQpuVTegNZ EN2CuiKx2amcxMXpmwPZuEIrMkMwQftzfZZJeJYBX9RvpYIgDC6NFuk0l5P+3rfRayfP 20yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=t25NAXjITrZ6RjcEhuy478lZwWQZQG0Ex2FBQgBxuf0=; b=UVYqdiFgr7I3LebFKUEetVmxvctt3rtS9q5J/4TEBaKZR4VQKZnX2Byn9HHqhj9MnJ 2b/U8IkzJpZjShCj7qkAXihevSvfztz+9FPybiGrbMEDUCqYxdxEGuerFDEaQgtgG9QD GtxmKdZI/1AEygyYIua0bjOLnwQSOF31ei3qIy1Pg1M13sVU9jDK1+YxPvwIn1IBTVXx JMTzj/klHmFnHMjmvmaIKJWhEXtpbpEz6oqjFfd0f3D06MI643OKin9jO7z6ilQtT3rt rHgeR1LyURRe44Nvq0di5kQM0ivtorBnbFf9ADAnDeOT3+1JIEt+vwlRwUjHYFHjzn3E N+bQ== X-Gm-Message-State: AOAM533srAa80cF9eDTfobhJB1loUInTwwPduhjtfWFBnXeyHs2Q8Zdg tuitVZZTmpuz8Z4eeLooLmKRza/0zsj1EBR4wiargbSqWBo= X-Google-Smtp-Source: ABdhPJw54c74+aBj1WfwaABhS3MnD945KCHqA4aV6VE+5fOSK6+CXXIRy6Md+K6iUjs4Bl2YuJa3OUbifOVIT439SQs= X-Received: by 2002:a19:23d8:: with SMTP id j207mr7655211lfj.144.1610774628998; Fri, 15 Jan 2021 21:23:48 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: J David Date: Sat, 16 Jan 2021 00:23:37 -0500 Message-ID: Subject: Re: Major issues with nfsv4 To: Rick Macklem Cc: Konstantin Belousov , "freebsd-fs@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DHmgB5BMZz4rHp X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=k1SsFHms; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of jdavidlists@gmail.com designates 2a00:1450:4864:20::129 as permitted sender) smtp.mailfrom=jdavidlists@gmail.com X-Spamd-Result: default: False [-3.19 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.19)[-0.193]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::129:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-fs@freebsd.org]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::129:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::129:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-fs]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2021 05:23:51 -0000 On Thu, Jan 14, 2021 at 5:30 PM Rick Macklem wrote: > One thing to try (other than a FreeBSD13/head system, if possible) > is the "oneopenown" mount option. The odds of being able to run an unreleased version of FreeBSD on production servers are slim to none. While trying to develop a reproduction, I think I have narrowed down what the problem is. There are no jails or nullfs involved here, just NFSv4.1. Window 1: (to track OpenOwner/Opens) while true; do date; nfsstat -E -c | fgrep -A1 OpenOwner; sleep 1; done Window 2: mount -o ro,nfsv4,minorversion=1,nosuid fileserver:/path/to/freesbd/root /mnt chroot /mnt (OpenOwner is now 1 and Opens is now 9.) Window 3: chroot /mnt (OpenOwner is now 2 and Opens is now 18.) ls (OpenOwner is now 3 and Opens is now 21.) ls (OpenOwner is now 4 and Opens is now 24.) ls (OpenOwner is now 5 and Opens is now 27.) ls (OpenOwner is now 6 and Opens is now 30.) ls (OpenOwner is now 7 and Opens is now 33.) bash while true; do ls | true; done (Allow about a minute to pass, hit CTRL-C. OpenOwner is now 4647 and Opens is now 13957) exit exit (OpenOwner is now 4647 and Opens is now 13952.) Back in Window 2: exit (wait about 30 seconds, OpenOwner is now 0 and Opens is now 0.) So it looks like the NFSv4 code can't let go of *any* Opens on a file/directory until *all* references to that file/directory are closed. If chroot is too much, "vi /mnt/etc/motd" in Window 2 and "cat /mnt/etc/motd" in Window 3 have the same effect, leaking one Open per cat instead of 3. You probably don't even need a FreeBSD install on the NFS mount; just hold a single file open in one window and open/close it repeatedly in another. Then I re-tested this with "-o ro,nfsv4,minorversion=1,nosuid,oneopenown." At least for this simple case, the problem did not occur with oneopenown set. Are there downsides to the oneopenown flag other than breaking delegations? Thanks!