[Bug 253158] Panic: snapacct_ufs2: bad block - Non-suJ mksnap_ffs(8) crash

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Feb 11 07:27:47 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253158

Kirk McKusick <mckusick at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #222084|0                           |1
        is obsolete|                            |

--- Comment #7 from Kirk McKusick <mckusick at FreeBSD.org> ---
Created attachment 222359
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=222359&action=edit
correct fix for bug

The previous fix masked the problem but had other unintended side effects.

The reported panic arises because the /mnt/.snap/.factory snapshot allocated
the last block in the filesystem. The snapshot code allocates the last block in
the filesystem as a way of setting its length to be the size of the filesystem.
Part of taking a snapshot is to remove all the earlier snapshots from the image
of the newest snapshot so that newer snapshots will not claim the blocks of the
earlier snapshots. The panic occurs when the new snapshot finds that both it
and an earlier snapshot claim the same block.

The fix is to set the size of the snapshot to be one block after the last block
in the filesystem. This block can never be allocated since it is not a valid
block in the filesystem. This extra block is used as a place to store the
initial list of blocks that the snapshot has already copied and is used to
avoid a deadlock in and speed up the copyonwrite() function.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-fs mailing list