bug in htree rename: doesn't delete old name, leaves ino with bad

Jeremy Fitzhardinge (jeremy@goop.org)
04 Nov 2002 14:32:43 -0800


--=-XXosG75PINjsoUZ1dXam
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

I've isolated the problem to rename not removing the old name under some
circumstances, leaving two names for a file with an nlink of 1. This
will reliably reproduce the problem for me, under 2.4.19-ac4 w/
patch-ext3-dxdir-2.4.19-4.

Generate a new filesystem: this will create htree-bug.fs
$ sh genfs

# mkdir m
# mount -o loop htree-bug.fs m

$ gcc -o tickle tickle.c
$ ./tickle m/test
*** rename("drivers/scsi/psi240i.h", "drivers/scsi/psi240i.h.orig") failure:
stating drivers/scsi/psi240i.h
ino=294
nlink=1
stating drivers/scsi/psi240i.h.orig
ino=294
nlink=1
*** rename("drivers/scsi/sun3_scsi.h", "drivers/scsi/sun3_scsi.h.orig") failure:
stating drivers/scsi/sun3_scsi.h
ino=350
nlink=1
stating drivers/scsi/sun3_scsi.h.orig
ino=350
nlink=1

# umount m

$ e2fsck -f htree-bug.fs
e2fsck 1.30-WIP (30-Sep-2002)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Inode 294 ref count is 1, should be 2. Fix<y>? yes

Inode 350 ref count is 1, should be 2. Fix<y>? yes

Pass 5: Checking group summary information

htree-bug.fs: ***** FILE SYSTEM WAS MODIFIED *****
htree-bug.fs: 541/10240 files (0.2% non-contiguous), 1369/10240 blocks
exit status 1
$ debugfs htree-bug.fs
debugfs 1.30-WIP (30-Sep-2002)
debugfs: ncheck 294
Inode Pathname
294 /test/drivers/scsi/psi240i.h
debugfs: ncheck 350
Inode Pathname
350 /test/drivers/scsi/sun3_scsi.h

J

--=-XXosG75PINjsoUZ1dXam
Content-Disposition: attachment; filename=genfs
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; name=genfs; charset=ISO-8859-1

# script to generate a filesystem

FS=3D${1:-htree-bug.fs}

dd 'count=3D40k' 'bs=3D1k' < /dev/zero > $FS
mke2fs -F -b4096 -j -J size=3D4 $FS
echo 'set_super_value hash_seed ac791939-995d-4962-bb03-86a0f8626a0c' | deb=
ugfs -w $FS

e2fsck -f $FS

--=-XXosG75PINjsoUZ1dXam
Content-Disposition: attachment; filename=tickle.c.gz
Content-Type: application/x-gzip; name=tickle.c.gz
Content-Transfer-Encoding: base64

H4sICOzzxj0CA3RpY2tsZS5jAOWd+W/cRpaAf7b+ih4FWdiGLPch65hsduHYmoURWx44CXYXmwVB
kex+nPAyi60jm/zvy5vFFqvVrvfKU+wKEEtikR9fvfr6kc3z4Bs/coK1603+lWWuHx/Dvx10k9aR
n0/tT1s6URb0J7F79pJldlZMzScvI9dbTj5a719/+o/Lv717f3nwTT7Bjzx+2mR68I0Xuf7yoG19
+9H6+PfLq6dLP/COJsvAXrGjSRi7+R/eXeI52bOJG1tx4kXiWY4mlvX+3dWlZT07KELynclN7Lvt
gk4csWzigJ1OnlcQP8oaUPFrBSt+a4DF70Ee37OD/zt4Us7tTr6fDIfx7LuDfJ7l5OnTYqbvJy9m
zyZ/+X7ytGLVU54dPHmyTNIctXyap9dL06PJ4Tqq5vHcybdssozTag2/Hn7Lfj08mnx7l/8fP5vY
2eRb9y+/RodHOeRJs5LJv08Ol7YfrFPvcPLXySFbO47HWL7cQKLKvnx38MQJYublcea//9kbhA8/
vn336anrpwPZD3/Lpz9s25L2agk+7+XSO+Y69fKsTTbW2mW5bBalebJbnit4m+gHSW7XIc4yl486
u/2M/nKVJ+fHWhcum+son/233vQtmaznHlb4kQxyayrGnjB9NbnKn0Tuqi50aeM7naTFXw96XPaN
Zek6D7aYIf+nMKKO9bAkRKs8wCKMSdPnosdByatW+S8sH4S69znvSZL3ME6rxQ+LBYro12mU//Yn
R5/kKY6//9Yt2Sw7ZpmVTyjm7+YoU9Kfp5z0QIxPl1evP1w+tY8m1z0xUi+yQ683fYsY9dx8mvIl
+T+vd5KEWyvtR6wGN58xaVeqfNSuVPHVS02rM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S6EhzoReirofYQMibhz17fRV
R3zXCuJby0784+wuQ6bsAezxmRAfvoer0/pjOJRqQz6QzLEj7OexZQjbECq1cK0N4tJoijj3IUOL
0zCEbRhxGrje4nRpNEMcxw6R2jQEQYu8Mg1YZ2G69BmgC+ZVL2zoJS9M+vUuTO8XuzDXJCsAYwUM
jS2M+/uCZ6/sDPW9iiMIWiQ/NxxY2w9PL30GfILq/gJaFxCON+B0gRHoYsyhYtTpqcHTUvKnozQ/
DWXQ6Sc/PJthbnTiAMMNkoZ0WG0t4VNngCmoU0yDp5bkTylpfirJoFNIKaZ2pEN1I5WuGane9SI1
qFZYfuxkAapicAhRk6wnHFpfW3opNMCZDGNLNuRJJm1IprcbmTlWrKMF9hXjfYawrfe8jy+RpYfX
1pmNRBqgzn34auGcoF6P1mcI2ySrTA+urTgbaTRJHCAQB7aMO2DFgVGIY1bFwb0juM8QtmHE0f0d
wZtpNEkcIBAHtow7YMWBUYhjXMWx5rQSPeDtNB9SrgcrVf/EaG7dX8XMgXEyzlJrFaw9Okk73C6z
kSjarXJfDeXHaP8FzWbzc8Q+W7v40GQ54VqkrttaLmWG+AE4P2B4jAHhB+juhzH1Iyx+YK6I5QmC
FklROLC2rvTSt/+6rGcnLxYnS4QuPEHQIqcLD9ZVl376zNEF0LqAcLwBpwuMQBdTNkbrIEttlqFu
Ce8zhG2S0vTg2mqzkUaTxAECcWDLuANWHBiFOKZUnFv3bDrFvFyBAww3yPnCYXWVpZc6Y0wBrCkg
GmtAmQL6m4KoKc0L7DejmQ62d8NfXxCTetk6jSbT7w7+PPh/BfFoKsHgAQA=

--=-XXosG75PINjsoUZ1dXam--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/