From owner-cvs-all Mon Apr 30 22: 9:52 2001 Delivered-To: cvs-all@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id 0D47037B424; Mon, 30 Apr 2001 22:09:45 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.3/8.11.3) with ESMTP id f4159PU58260; Tue, 1 May 2001 07:09:25 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Bruce Evans Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/fs/hpfs hpfs_vnops.c In-Reply-To: Your message of "Tue, 01 May 2001 13:35:07 +1000." Date: Tue, 01 May 2001 07:09:25 +0200 Message-ID: <58258.988693765@critter> From: Poul-Henning Kamp Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message , Bruce Ev ans writes: >> Modified files: >> sys/fs/hpfs hpfs_vnops.c >> Log: >> Uncut&paste som bogus use of VOP_BMAP in hpfs::VOP_STRATEGY. >> >> At the same time, eliminate uninitialized use of a vnode >> pointer. Interesting GCC didn't spot this. > >This is because the pointer was supposed to be, and was, initialized by >VOP_BMAP(). gcc must assume that foo(&bar) initializes `bar'. But VOP_BMAP() was not called in all cases: int hpfs_strategy(ap) struct vop_strategy_args /* { struct buf *a_bp; } */ *ap; { register struct buf *bp = ap->a_bp; register struct vnode *vp = ap->a_vp; struct vnode *nvp; int error; dprintf(("hpfs_strategy(): \n")); if (vp->v_type == VBLK || vp->v_type == VCHR) panic("hpfs_strategy: spec"); if (bp->b_blkno == bp->b_lblkno) { error = VOP_BMAP(vp, bp->b_lblkno, &nvp, &bp->b_blkno, NULL, NULL); if (error) { printf("hpfs_strategy: VOP_BMAP FAILED %d\n", error); bp->b_error = error; bp->b_ioflags |= BIO_ERROR; biodone(bp); return (error); } if ((long)bp->b_blkno == -1) vfs_bio_clrbuf(bp); } if ((long)bp->b_blkno == -1) { biodone(bp); return (0); } bp->b_dev = nvp->v_rdev; VOP_STRATEGY(nvp, bp); return (0); } -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message