Subject: Re: FFS snapshots and magic reserved inodes?
To: Thor Lancelot Simon <tls@coyotepoint.com>
From: Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>
List: tech-kern
Date: 07/07/2007 12:11:38
On Fri, Jul 06, 2007 at 08:12:59PM -0400, Thor Lancelot Simon wrote:
> I built a kernel with options APPLE_UFS and mounted a filesystem created
> on MacOS 10.4.10 (x86).  Mounting read-only worked fine.  Mounting read-write
> emitted messages from the FFS snapshot code about "non-snapshot inode 64"
> and "non-snapshot inode 16384".
> 
> Are these inodes reserved by the snapshot code?  If they are, is it safe
> to have the snapshot code in our default kernels, which can mount (much)
> older FFS filesystems that may have these inodes in use?

Please try the attached diff.  Mounting tried to establish persistent
snapshots.  Looks like your file systems superblock has non-zeros in
fs_snapinum[FSMAXSNAP].  Before going further please check your file system
from MacOS, fs_snapinum[FSMAXSNAP] has been zeroed during mount.

-- 
Juergen Hannken-Illjes - hannken@eis.cs.tu-bs.de - TU Braunschweig (Germany)

Index: ffs_snapshot.c
===================================================================
RCS file: /cvsroot/src/sys/ufs/ffs/ffs_snapshot.c,v
retrieving revision 1.43
diff -p -u -2 -r1.43 ffs_snapshot.c
--- ffs_snapshot.c	4 Mar 2007 06:03:43 -0000	1.43
+++ ffs_snapshot.c	7 Jul 2007 10:05:11 -0000
@@ -1659,4 +1659,10 @@ ffs_snapshot_mount(struct mount *mp)
 	int i, error, ns, snaploc, loc;
 
+	/*
+	 * No snapshots on apple ufs file systems.
+	 */
+	if (UFS_MPISAPPLEUFS(ump))
+		return;
+
 	ns = UFS_FSNEEDSWAP(fs);
 	/*