[issue1286] msdosfs crashes (when using rsync?)

Nicolas Thery nthery at gmail.com
Sat Feb 28 04:41:36 PST 2009


2009/2/18 Simon 'corecode' Schubert (via DragonFly issue tracker)
<sinknull at crater.dragonflybsd.org>:
>
> New submission from Simon 'corecode' Schubert <corecode at fs.ei.tum.de>:
>
> Just now, twice, also on a fsck'ed system:
>
> panic: msdosfs_reinsert: insertion failed 16
>
[...]
>
> happend when calling rsync -aPv /dir/on/hammer /dir/on/msdosfs
>
> crashdump available on request (mega huge one)

I think I root caused the bug and can reproduce it with the following steps:

mkdir d
cd d
touch f1
touch f2
from another term to keep a vnode on f2: vi f2
rm f2
mv f1 f3

f2 is the last entry in d.  When it is deleted, the entry is free'd
but the denode associated with f2 stays in the dehashtbl[].

When f1 is renamed, msdosfs_lookup() looks for a new dir entry to move
it too(*) and finds the one previously used by f2.

When msdosfs_rename() reinserts f1's denode in the hash table, the
assertion fires because f2's denode is still there.

So the assertion I added some months ago is incorrect (but ignoring
the error was incorrect too).

I'm trying to come up with a fix...

(*) Contrary to what is stated in comment before msdosfs_rename(),
when simply renaming a file (no move), the original dir entry is not
reused.  Instead a new one is allocated.





More information about the Bugs mailing list