From nobody Fri Sep 16 09:02:40 2022 X-Original-To: freebsd-fs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MTSqq3c6lz4c4tf for ; Fri, 16 Sep 2022 09:06:47 +0000 (UTC) (envelope-from lecocq@ipgp.fr) Received: from belenos.ipgp.fr (belenos.ipgp.fr [194.254.225.6]) by mx1.freebsd.org (Postfix) with ESMTP id 4MTSqp0Cm1z3xKK for ; Fri, 16 Sep 2022 09:06:46 +0000 (UTC) (envelope-from lecocq@ipgp.fr) Received: from localhost (localhost [127.0.0.1]) by belenos.ipgp.fr (Postfix) with ESMTP id B7119196097 for ; Fri, 16 Sep 2022 11:06:44 +0200 (CEST) Received: from belenos.ipgp.fr ([127.0.0.1]) by localhost (belenos.ipgp.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QKJaD5AZnIWo for ; Fri, 16 Sep 2022 11:06:44 +0200 (CEST) Received: from mailhost.ipgp.fr (teupa.ipgp.fr [10.0.21.99]) by belenos.ipgp.fr (Postfix) with ESMTPS id 78C8B196088 for ; Fri, 16 Sep 2022 11:06:44 +0200 (CEST) Received: from pasdepanix.ipgp.fr (pasdepanix.ipgp.fr [10.0.11.2]) by mailhost.ipgp.fr (8.13.1/jtpda-5.4) with ESMTP id 28G96iea050566 for ; Fri, 16 Sep 2022 11:06:44 +0200 (CEST) Received: by pasdepanix.ipgp.fr (Postfix, from userid 112) id 0B40C7A055; Fri, 16 Sep 2022 11:06:44 +0200 (CEST) Received: from wund.lan (ccvisit42.in2p3.fr [134.158.32.172]) by pasdepanix.ipgp.fr (Postfix) with ESMTPSA id C41427A053; Fri, 16 Sep 2022 11:06:43 +0200 (CEST) Received: by wund.lan (Postfix, from userid 1000) id 50CB97EE; Fri, 16 Sep 2022 11:06:43 +0200 (CEST) References: User-agent: mu4e 1.6.10; emacs 27.1 From: Michel Le Cocq To: freebsd-fs@FreeBSD.org Subject: Fwd: FreeBSD 13.1 : ZFS NFS : .zfs/snapshot : Stale file handle : with zfs destroy snapshot process in Uninterruptible sleep Date: Fri, 16 Sep 2022 11:02:40 +0200 Message-ID: <87pmfvadss.fsf@ipgp.fr> List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 4MTSqp0Cm1z3xKK X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lecocq@ipgp.fr designates 194.254.225.6 as permitted sender) smtp.mailfrom=lecocq@ipgp.fr X-Spamd-Result: default: False [-3.18 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; NEURAL_HAM_MEDIUM(-0.98)[-0.984]; R_SPF_ALLOW(-0.20)[+ip4:194.254.225.6:c]; RCVD_NO_TLS_LAST(0.10)[]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-fs@FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:2200, ipnet:194.254.0.0/16, country:FR]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[ipgp.fr]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_SEVEN(0.00)[8]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-fs@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi push here this following bug, which si specific FS. in short, since FreeBSD 13.1 a ZFS exported FS over NFS will hang if a NFS client tried to acces to a snapshot. see bellow my post to freebsd-bug. -- M Michel Le Cocq writes: > Hi, since upgrading to 13.1-RELEASE of FreeBSD I can't anymore access to > .zfs/snapshot folder over NFS. > > When I tried to acces do .zfs/snapshot over NFS I obtain a 'Stale file > handle'. > > Worse : Then if you tried to delete the snapshot that was accessed, you > 'zfs destroy snapshot' process will fall in 'Uninterruptible sleep' > (usually IO). So you can't kill it ! > > I post this bug here : > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266236 > > A little small procedure to reproduce this bug. > > Install a fresh FreeBSD server under 13.1-p2 > > root@server:~# freebsd-version > 13.1-RELEASE-p2 > > Inside a zfs pool create a vol and share it by NFS. > > root@server:~# zfs get name,mountpoint,sharenfs tank/zfsnfstest > NAME PROPERTY VALUE SOURCE > tank/zfsnfstest name tank/zfsnfstest - > tank/zfsnfstest mountpoint /tank/zfsnfstest local > tank/zfsnfstest sharenfs on local > > Mount localy your sharenfs vol. > > root@server:~# mount -t nfs 127.0.0.1:/tank/zfsnfstest /mnt > > Create a snapshot. > > root@server:~# zfs snapshot tank/zfsnfstest@1 > > Check you can access localy. > > root@server:~# ls -l /tank/zfsnfstest/.zfs/snapshot/1/ > total 0 > root@server:~# > > Try to acces from mounted NFS vol. > > root@server:~# ls -l /mnt/.zfs/snapshot/1/ > total 0 > ls: /mnt/.zfs/snapshot/1/: Stale NFS file handle > > Here we see we don't have access from NFS. > > Try to remove your previous created snapshot. > > root@server:~# zfs destroy tank/zfsnfstest@1 > > This process didn't end... > > root@server:~ # ps aux > USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND > [...] > root 58027 0.0 0.0 18012 7256 1 D+ 12:27 0:00.01 zfs destroy > tank/zfsnfstest@1 > > D mean : Uninterruptible sleep (usually IO). So you can't kill it ! > > root@server:~ # kill 58027 > root@server:~ # ps aux | grep 58027 > root 58027 0.0 0.0 18012 7256 1 D+ 12:27 0:00.01 zfs destroy > tank/zfsnfstest@1 > root@server:~ # kill -1 58027 > root@server:~ # ps aux | grep 58027 > root 58027 0.0 0.0 18012 7256 1 D+ 12:27 0:00.01 zfs destroy > tank/zfsnfstest@1 > root@server:~ # kill -9 58027 > root@server:~ # ps aux | grep 58027 > root 58027 0.0 0.0 18012 7256 1 D+ 12:27 0:00.01 zfs destroy > tank/zfsnfstest@1 > root@server:~ # > > Thanks.