diff options
author | Kirk McKusick <mckusick@FreeBSD.org> | 2023-04-18 06:03:30 +0000 |
---|---|---|
committer | Kirk McKusick <mckusick@FreeBSD.org> | 2023-04-29 18:09:01 +0000 |
commit | b180a0773bef95880e06b0ee4a1635ab6c077175 (patch) | |
tree | 2f653f431625e4e823080997e3cab82acb8954e5 /sbin/fsck_ffs/inode.c | |
parent | 146ba7a1d60c7ab8959d41ccfdd2543cc5d18b34 (diff) | |
download | src-b180a0773bef95880e06b0ee4a1635ab6c077175.tar.gz src-b180a0773bef95880e06b0ee4a1635ab6c077175.zip |
Bug fixes for fsck_ffs(8).
Sponsored by: Netflix
(cherry picked from commit 18746531a881356ed24b6ef2fdc9e50707642163)
Diffstat (limited to 'sbin/fsck_ffs/inode.c')
-rw-r--r-- | sbin/fsck_ffs/inode.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index a46fea0607a0..37b0f9ebc1b1 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -747,6 +747,7 @@ snapremove(ino_t inum) bzero(&snaplist[i - 1], sizeof(struct inode)); snapcnt--; } + memset(&idesc, 0, sizeof(struct inodesc)); idesc.id_type = SNAP; idesc.id_func = snapclean; idesc.id_number = inum; @@ -767,14 +768,15 @@ snapclean(struct inodesc *idesc) if (blkno == 0) return (KEEPON); - bp = idesc->id_bp; dp = idesc->id_dp; if (blkno == BLK_NOCOPY || blkno == BLK_SNAP) { - if (idesc->id_lbn < UFS_NDADDR) + if (idesc->id_lbn < UFS_NDADDR) { DIP_SET(dp, di_db[idesc->id_lbn], 0); - else + } else { + bp = idesc->id_bp; IBLK_SET(bp, bp->b_index, 0); - dirty(bp); + dirty(bp); + } } return (KEEPON); } |