]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
do not destroy 'snapdir' when it becomes inactive
authorAndriy Gapon <avg@FreeBSD.org>
Mon, 16 May 2016 15:48:56 +0000 (15:48 +0000)
committerAndriy Gapon <avg@FreeBSD.org>
Mon, 16 May 2016 15:48:56 +0000 (15:48 +0000)
commitafe674f08943dba60d163d1d0ff02340a65af6fb
treeb15670d2b3494143e50b6ae972cf2e316f507c95
parent41cee4e41b865e9ffc9f8468ec922565615cfe58
do not destroy 'snapdir' when it becomes  inactive

That was just wrong.  In fact, we can safely keep this static entry when
it's inactive.
Now the destructive action is moved to the reclaim method and the
function is renamed from zfsctl_snapdir_inactive(0 to
zfsctl_snapdir_reclaim().

Also, we can use gfs_vop_reclaim() instead of gfs_dir_inactive() +
kmem_free().

Lastly, we can just assert that the node does not any children when it
is reclaimed, even on the force unmount.  That's because zfs_umount()
does an extra vflush() pass which should destroy all snapshot-mountpoint
vnodes that are the snapdir's children.

MFC after: 5 weeks
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c