make sure to zero out allocated buffers.
SCCS-vsn: sys/ufs/lfs/lfs_segment.c 7.32
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)lfs_segment.c 7.31 (Berkeley) %G%
+ * @(#)lfs_segment.c 7.32 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
}
#endif
sup->su_nbytes -= sizeof(struct dinode);
}
#endif
sup->su_nbytes -= sizeof(struct dinode);
+ redo_ifile =
+ (ino == LFS_IFILE_INUM && !(bp->b_flags & B_GATHERED));
- redo_ifile = (ino == LFS_IFILE_INUM && !(bp->b_flags & B_GATHERED));
sup->su_flags |= SEGUSE_ACTIVE;
sup->su_ninos += ninos;
++sup->su_nsums;
sup->su_flags |= SEGUSE_ACTIVE;
sup->su_ninos += ninos;
++sup->su_nsums;
+ do_again = !(bp->b_flags & B_GATHERED);
(void)VOP_BWRITE(bp);
fs->lfs_bfree -= (fsbtodb(fs, ninos) + LFS_SUMMARY_SIZE / DEV_BSIZE);
(void)VOP_BWRITE(bp);
fs->lfs_bfree -= (fsbtodb(fs, ninos) + LFS_SUMMARY_SIZE / DEV_BSIZE);
- do_again = !(bp->b_flags & B_GATHERED);
i_dev = VTOI(fs->lfs_ivnode)->i_dev;
strategy = VTOI(fs->lfs_ivnode)->i_devvp->v_op[VOFFSET(vop_strategy)];
i_dev = VTOI(fs->lfs_ivnode)->i_dev;
strategy = VTOI(fs->lfs_ivnode)->i_devvp->v_op[VOFFSET(vop_strategy)];
+ ++cbp->b_vp->v_numoutput;
splx(s);
cbp->b_bcount = p - cbp->b_un.b_addr;
/*
splx(s);
cbp->b_bcount = p - cbp->b_un.b_addr;
/*
struct buf *bp;
dev_t i_dev;
int (*strategy) __P((struct vop_strategy_args *));
struct buf *bp;
dev_t i_dev;
int (*strategy) __P((struct vop_strategy_args *));
struct vop_strategy_args vop_strategy_a;
i_dev = VTOI(fs->lfs_ivnode)->i_dev;
struct vop_strategy_args vop_strategy_a;
i_dev = VTOI(fs->lfs_ivnode)->i_dev;
bp->b_flags &= ~(B_DONE | B_CALL | B_ERROR | B_READ | B_DELWRI);
vop_strategy_a.a_desc = VDESC(vop_strategy);
vop_strategy_a.a_bp = bp;
bp->b_flags &= ~(B_DONE | B_CALL | B_ERROR | B_READ | B_DELWRI);
vop_strategy_a.a_desc = VDESC(vop_strategy);
vop_strategy_a.a_bp = bp;
+ s = splbio();
+ bp->b_vp->v_numoutput += 2;
+ splx(s);
(strategy)(&vop_strategy_a);
biowait(bp);
(strategy)(&vop_strategy_a);
biowait(bp);
nbytes = roundup(size, DEV_BSIZE);
bp = malloc(sizeof(struct buf) + nbytes, M_SEGMENT, M_WAITOK);
nbytes = roundup(size, DEV_BSIZE);
bp = malloc(sizeof(struct buf) + nbytes, M_SEGMENT, M_WAITOK);
- bzero(bp, sizeof(struct buf));
+ bzero(bp, sizeof(struct buf) + nbytes);
bgetvp(vp, bp);
bp->b_un.b_addr = (caddr_t)(bp + 1);
bp->b_bufsize = size;
bgetvp(vp, bp);
bp->b_un.b_addr = (caddr_t)(bp + 1);
bp->b_bufsize = size;