NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PR/59885 CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs



The following reply was made to PR kern/59885; it has been noted by GNATS.

From: "YAMAMOTO Takashi" <yamt%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/59885 CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Date: Sun, 22 Mar 2026 13:10:57 +0000

 Module Name:	src
 Committed By:	yamt
 Date:		Sun Mar 22 13:10:57 UTC 2026
 
 Modified Files:
 	src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vfsops.c
 	    zfs_vnops.c zfs_znode.c
 	src/external/cddl/osnet/dist/uts/common/fs/zfs/sys: zfs_znode.h
 
 Log Message:
 zfs: fix "slow rm" issue
 
 * stop commiting zil in zfs_netbsd_reclaim and other operations
   in vnode reclaim path.
 
 * retire zfs_zget_cleaner/VN_RELE_CLEANER.
   instead, just use normal zfs_zget and vrele_async.
 
 note that these two changes depend on each other:
 
 * zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
   ensure that the znode referenced by TX_WRITE itx is always in-core.
 
 * otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
   possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
   the vnode in VS_RECLAIMING state, which would make vcache_vget
   block.
   if the vnode being reclaimed happened to have TX_WRITE itx on the
   zil, it deadlocks.
 
 an alternative would be to make the upper layer (vfs_vnode.c) retain
 unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
 interval should be enough.) eg. by making zfs_netbsd_inactive report
 a_recycle = 0. but i guess it's better to remove
 zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
 from the upstream zfs.
 
 also, this commit makes zfs_umount retry vflush a bit.
 it's necessary because, for some reasons, during unmount, zil_close
 commits the log, which can load some referenced vnodes back to the
 cache. i don't understand why zil_close needs to commit the log
 when we are syncing txg for unmount anyway. although it might be
 possible to avoid the zil commit at all, probably this change
 is less invasive than that. this logic is partly from J. Hannken-Illjes.
 
 PR/59885
 https://gnats.netbsd.org/59885
 discussed on tech-kern.
 https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.32 -r1.33 \
     src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c
 cvs rdiff -u -r1.91 -r1.92 \
     src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
 cvs rdiff -u -r1.35 -r1.36 \
     src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c
 cvs rdiff -u -r1.9 -r1.10 \
     src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 



Home | Main Index | Thread Index | Old Index