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

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Feb 12 05:35:30 UTC 2021


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

--- Comment #8 from commit-hook at FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=8563de2f2799b2cb6f2f06e3c9dddd48dca2a986

commit 8563de2f2799b2cb6f2f06e3c9dddd48dca2a986
Author:     Kirk McKusick <mckusick at FreeBSD.org>
AuthorDate: 2021-02-12 05:31:16 +0000
Commit:     Kirk McKusick <mckusick at FreeBSD.org>
CommitDate: 2021-02-12 05:31:16 +0000

    Fix bug 253158 - Panic: snapacct_ufs2: bad block - mksnap_ffs(8) crash

    The panic reported in 253158 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 ffs_copyonwrite() function.

    Reported by:  Harald Schmalzbauer
    Tested by:    Peter Holm
    PR:           253158
    Sponsored by: Netflix

 sys/ufs/ffs/ffs_snapshot.c | 137 +++++++++++++++++++++++----------------------
 1 file changed, 70 insertions(+), 67 deletions(-)

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


More information about the freebsd-fs mailing list