Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Mar 2011 13:09:24 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Yamagi Burmeister <lists@yamagi.org>
Cc:        freebsd-fs@freebsd.org, mckusick@freebsd.org
Subject:   Re: Snapshots are never freed on at least 8.1 and 8.2
Message-ID:  <20110316110924.GN78089@deviant.kiev.zoral.com.ua>
In-Reply-To: <alpine.BSF.2.00.1103160925050.4245@saya.home.yamagi.org>
References:  <alpine.BSF.2.00.1103160925050.4245@saya.home.yamagi.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--0EnJpgTqgR2B/yCU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Mar 16, 2011 at 09:27:04AM +0100, Yamagi Burmeister wrote:
> Hello,
> I'm not sure if this is a bug or the expected behavior but it seems quit
> strange. On at least FreeBSD 8.1 and 8.2 UFS2 snapshots are never freed
> while the filesystem is mounted. Therefor you have to remount every 20
> snapshots which is quiet a pain when using "dump -L" or similar things
> via cron.
=2E..

Yes, very interesting. It seems that ffs_snapgone() is never called.
How did our build system mutated over the time so that FFS is no longer
defined, I do not know and do not much want to track.

diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c
index e997718..d819f69 100644
--- a/sys/ufs/ufs/ufs_lookup.c
+++ b/sys/ufs/ufs/ufs_lookup.c
@@ -1252,10 +1252,8 @@ out:
 	 * drop its snapshot reference so that it will be reclaimed
 	 * when last open reference goes away.
 	 */
-#if defined(FFS) || defined(IFS)
 	if (ip !=3D 0 && (ip->i_flags & SF_SNAPSHOT) !=3D 0 && ip->i_effnlink =3D=
=3D 0)
 		ffs_snapgone(ip);
-#endif
 	return (error);
 }
=20
@@ -1317,10 +1315,8 @@ ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir)
 	 * drop its snapshot reference so that it will be reclaimed
 	 * when last open reference goes away.
 	 */
-#if defined(FFS) || defined(IFS)
 	if ((oip->i_flags & SF_SNAPSHOT) !=3D 0 && oip->i_effnlink =3D=3D 0)
 		ffs_snapgone(oip);
-#endif
 	return (error);
 }
=20

--0EnJpgTqgR2B/yCU
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iEYEARECAAYFAk2AmmQACgkQC3+MBN1Mb4jAagCguKHfRKWFcDaFH5yArfiDXChA
eswAn1QSGSfBTAQsCyfvlhXTiVS1e3hF
=QnNx
-----END PGP SIGNATURE-----

--0EnJpgTqgR2B/yCU--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110316110924.GN78089>