mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-11 14:10:34 +00:00
Fix corruption introduced in previous delta.
Reported by: Aurelien Nephtali <aurelien.nephtali@wanadoo.fr> Sponsored by: DARPA & NAI Labs.
This commit is contained in:
parent
d8e7d462eb
commit
4c572f6222
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=108050
@ -983,15 +983,19 @@ mapacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
|
||||
ufs1_daddr_t blkno;
|
||||
struct inode *ip;
|
||||
ino_t inum;
|
||||
int acctit;
|
||||
|
||||
ip = VTOI(vp);
|
||||
inum = ip->i_number;
|
||||
if (lblkno == -1)
|
||||
acctit = 0;
|
||||
else
|
||||
acctit = 1;
|
||||
for ( ; oldblkp < lastblkp; oldblkp++, lblkno++) {
|
||||
blkno = *oldblkp;
|
||||
if (blkno == 0 || blkno == BLK_NOCOPY)
|
||||
continue;
|
||||
if (lblkno != -1 && expungetype == BLK_SNAP &&
|
||||
blkno != BLK_SNAP)
|
||||
if (acctit && expungetype == BLK_SNAP && blkno != BLK_SNAP)
|
||||
*ip->i_snapblklist++ = lblkno;
|
||||
if (blkno == BLK_SNAP)
|
||||
blkno = blkstofrags(fs, lblkno);
|
||||
@ -1254,15 +1258,19 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
|
||||
ufs2_daddr_t blkno;
|
||||
struct inode *ip;
|
||||
ino_t inum;
|
||||
int acctit;
|
||||
|
||||
ip = VTOI(vp);
|
||||
inum = ip->i_number;
|
||||
if (lblkno == -1)
|
||||
acctit = 0;
|
||||
else
|
||||
acctit = 1;
|
||||
for ( ; oldblkp < lastblkp; oldblkp++, lblkno++) {
|
||||
blkno = *oldblkp;
|
||||
if (blkno == 0 || blkno == BLK_NOCOPY)
|
||||
continue;
|
||||
if (lblkno != -1 && expungetype == BLK_SNAP &&
|
||||
blkno != BLK_SNAP)
|
||||
if (acctit && expungetype == BLK_SNAP && blkno != BLK_SNAP)
|
||||
*ip->i_snapblklist++ = lblkno;
|
||||
if (blkno == BLK_SNAP)
|
||||
blkno = blkstofrags(fs, lblkno);
|
||||
|
Loading…
Reference in New Issue
Block a user