Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jan 2012 22:26:43 -0800
From:      Kirk McKusick <mckusick@mckusick.com>
To:        eugene@zhegan.in
Cc:        freebsd-fs@FreeBSD.org, bug-followup@FreeBSD.org
Subject:   Re: kern/164472: [ufs] fsck -B panics on particular data inconsistency 
Message-ID:  <201202010626.q116Qhvf060616@chez.mckusick.com>
In-Reply-To: <201201300540.q0U5eDYi068367@freefall.freebsd.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> From: Kostik Belousov <kostikbel@gmail.com>
> To: bug-followup@FreeBSD.org, eugene@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202010626.q116Qhvf060616>