Snapshots are never freed on at least 8.1 and 8.2

Kostik Belousov kostikbel at gmail.com
Wed Mar 16 11:09:29 UTC 2011


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.
...

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 != 0 && (ip->i_flags & SF_SNAPSHOT) != 0 && ip->i_effnlink == 0)
 		ffs_snapgone(ip);
-#endif
 	return (error);
 }
 
@@ -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) != 0 && oip->i_effnlink == 0)
 		ffs_snapgone(oip);
-#endif
 	return (error);
 }
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20110316/f7bfb256/attachment.pgp


More information about the freebsd-fs mailing list