Subject: kern/21283: current FFS (not v2) incompatible with older NetBSD releases
To: None <gnats-bugs@gnats.netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-bugs
Date: 04/23/2003 17:54:04
>Number:         21283
>Category:       kern
>Synopsis:       current FFS (not v2) incompatible with older NetBSD releases
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 23 15:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6R from today's sources
>Organization:
>Environment:
System: NetBSD comore 1.6R NetBSD 1.6R (GENERIC.MP) #1: Wed Apr 23 17:16:43 CEST 2003  bouyer@pop:/local/pop1/bouyer/tmp/i386/obj/local/pop1/bouyer/current/src/sys/arch/i386/compile/GENERIC.MP i386
Architecture: i386
Machine: i386
>Description:
	I have an alpha running 1.6.1_RC2 and a i386 running current.
	I have a ZIP100 drive on both, which I use to move data from
	one system to another. I'm using FFS on the raw partition
	of the zip drive.
	Since I upgraded the i386 to a system supporting FFSv2,
	I can't read the zip on the 1.6.1 box once it has been mounted
	R/W by the current box. It mount fine but accessing the mount
	point returns "Bad file descriptor". fsdb on the filesystem doesn't
	complains, and can access all inodes just fine.
	A fsck -f doesn't complain. After a fsck_ffs -b 32, I can read
	the disk again on 1.6.1.
	I did an hexdump of the raw zip device before and after the mount
	on the current system. Here is the diff.
armandeche:/local/armandeche1/tmp#diff -u zip.OK.x zip.BAD.x
--- zip.OK.x    Wed Apr 23 17:46:43 2003
+++ zip.BAD.x   Wed Apr 23 17:47:00 2003
@@ -19,7 +19,7 @@
 *
 0020000     0000    0000    0000    0000    0010    0000    0018    0000
 0020020     0020    0000    0410    0000    0010    0000    ffc0    ffff
-0020040     b1fc    3ea6    8000    0001    73ef    0001    0003    0000
+0020040     b300    3ea6    8000    0001    73ef    0001    0003    0000
 0020060     2000    0000    0400    0000    0008    0000    0005    0000
 0020100     0000    0000    003c    0000    e000    ffff    fc00    ffff
 0020120     000d    0000    000a    0000    0008    0000    0800    0000
@@ -30,12 +30,21 @@
 0020240     2000    0000    0040    0000    0020    0000    0800    0000
 0020260     0060    0000    002e    0000    1f80    0000    b800    0000
 0020300     0001    0000    2e7c    0000    5e7d    0000    000e    0000
-0020320     0100    0000    7a2f    7069    0000    0000    0000    0000
+0020320     0100    8000    7a2f    7069    0000    0000    0000    0000
 0020340     0000    0000    0000    0000    0000    0000    0000    0000
 *
-0021500     6c0c    001c    fe00    ffff    6800    001c    fe00    ffff
-0021520     6c00    001c    fe00    ffff    0001    0000    0000    0000
+0021500     6c0c    001c    fe00    ffff    e40c    c10c    e000    c10c
+0021520     e400    c10c    fe00    ffff    0001    0000    2000    0000
 0021540     0000    0000    0000    0000    0000    0000    0000    0000
+*
+0021740     0000    0000    0000    0000    2000    0000    0000    0000
+0021760     0001    0000    0000    0000    2e7c    0000    0000    0000
+0022000     5e7d    0000    0000    0000    000e    0000    0000    0000
+0022020     0000    0000    0000    0000    0000    0000    0000    0000
+*
+0022060     b300    3ea6    0000    0000    8000    0001    0000    0000
+0022100     73ef    0001    0000    0000    0410    0000    0000    0000
+0022120     0000    0000    0000    0000    0000    0000    0000    0000
 *
 0022240     0000    0000    0000    0000    0000    0000    4000    0000
 0022260     0040    0000    0000    0000    0000    0000    0000    0000

	dump of the raw device before and after the mount on current
	available from
	ftp://asim.lip6.fr/outgoing/zip.OK.gz
	ftp://asim.lip6.fr/outgoing/zip.BAD.gz
	they're less than 100k each, and decompress to a 128m file.
	
>How-To-Repeat:
armandeche:/#uname -a
NetBSD armandeche 1.6.1_RC2 NetBSD 1.6.1_RC2 (ARMANDECHE) #5: Fri Mar 14 15:21:13 CET 2003     bouyer@folk:/local/folk1/bouyer/netbsd-1-6/src/sys/arch/alpha/compile/ARMANDECHE alpha
armandeche:/#newfs -I /dev/rsd0c
/dev/rsd0c:     196608 sectors in 96 cylinders of 64 tracks, 32 sectors
        96.0MB in 3 cyl groups (46 c/g, 46.00MB/g, 8064 i/g)
super-block backups (for fsck -b #) at:
     32,  94272, 188512,
armandeche:/#mount /dev/rsd0c /zip
mount_ffs: /dev/rsd0c on /zip: Block device required
armandeche:/#mount /dev/sd0c /zip
armandeche:/#ls -a /zip/
.  ..
armandeche:/#eject sd0
[move zip media to a NetBSD current box]
comore:/#uname -a
NetBSD comore 1.6R NetBSD 1.6R (GENERIC.MP) #1: Wed Apr 23 17:16:43 CEST 2003  bouyer@pop:/local/pop1/bouyer/tmp/i386/obj/local/pop1/bouyer/current/src/sys/arch/i386/compile/GENERIC.MP i386
comore:/#mount /dev/sd0d /zip
comore:/#eject sd0
[move back zip media to the 1.6.1 system]
armandeche:/#mount /dev/sd0c /zip
armandeche:/#ls -a /zip
ls: /zip: Bad file descriptor
armandeche:/#fsdb -n -f /dev/rsd0c
** /dev/rsd0c (NO WRITE)
** File system is already clean
Editing file system `/dev/rsd0c'
Last Mounted on /zip
current inode: directory
I=2 MODE=40755 SIZE=512
        MTIME=Apr 23 17:31:42 2003 [0 nsec]
        CTIME=Apr 23 17:31:42 2003 [0 nsec]
        ATIME=Apr 23 17:32:15 2003 [535405000 nsec]
OWNER=root GRP=wheel LINKCNT=2 FLAGS=0x0 BLKCNT=0x2 GEN=0x0
fsdb (inum: 2)> ls
slot 0 ino 2 reclen 12: directory, `.'
slot 1 ino 2 reclen 500: directory, `..'
fsdb (inum: 2)> quit
armandeche:/#fsck_ffs -b32 /dev/rsd0c
Alternate super block location: 32
** /dev/rsd0c
** File system is already clean
** Last Mounted on 
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
1 files, 1 used, 95214 free (14 frags, 11900 blocks, 0.0% fragmentation)

UPDATE STANDARD SUPERBLOCK? [yn] y


***** FILE SYSTEM WAS MODIFIED *****
armandeche:/#mount /dev/sd0c /zip
armandeche:/#ls -a /zip
.  ..

>Fix:
	unknown
>Release-Note:
>Audit-Trail:
>Unformatted: