kern/164472: [ufs] fsck -B panics on particular data
inconsistency
Kirk McKusick
mckusick at mckusick.com
Wed Feb 1 06:30:21 UTC 2012
The following reply was made to PR kern/164472; it has been noted by GNATS.
From: Kirk McKusick <mckusick at mckusick.com>
To: eugene at zhegan.in
Cc: bug-followup at FreeBSD.org, freebsd-fs at FreeBSD.org,
Kostik Belousov <kostikbel at gmail.com>
Subject: Re: kern/164472: [ufs] fsck -B panics on particular data inconsistency
Date: Tue, 31 Jan 2012 22:26:43 -0800
> From: Kostik Belousov <kostikbel at gmail.com>
> To: bug-followup at FreeBSD.org, eugene at zhegan.in
> Cc:
> Subject: Re: kern/164472: [ufs] fsck -B panics on particular data inconsistency
> Date: Mon, 30 Jan 2012 07:30:04 +0200
>
> You failed to mention which panic you got. Was it 'dup alloc' ? A
> backtace would be also useful.
>
> If it was indeed 'dup alloc', then there is nothing fsck or snapshots
> can be accused for. Your filesystem is in inconsistent state, which
> requires full fsck to recover. It must be not mounted while not
> repaired.
>
> Somewhat more interesting is how the fs got into this state.
Thanks for your report and in particular a small file image that
demonstrates the problem. I have been able to reproduce your panic
reliably on my test machine.
Running a normal fsck on the image does indeed show that the filesystem
has corruption that is unexpected on a filesystem running with soft
updates. So, in the end, if the background fsck were able to run, it
would fail and notify the system that it needed to be checked by a
full fsck. But as you have aptly demonstrated, the background fsck
crashes the system as it tries to take a snapshot of the filesystem
on which to run its check.
The cause of the crash is because in taking a snapshot, the filesystem
needs to allocate an inode for the snapshot. As it turns out, the
inode that it tries to allocate is marked free in the inode map, but
is in fact already allocated which leads to the panic.
I am still mulling over how to resolve this problem, but have not
yet come up with one. I am looking for a solution that effectively
will let the snapshot fail rather than crashing the system so that
the fsck -B can then gracefully fail and lead to the full fsck as
is needed in this case.
Kirk McKusick
More information about the freebsd-fs
mailing list