Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/chs-ubc2]: src/sys/ufs/ufs check for bcount being 0 in ufs_strategy().



details:   https://anonhg.NetBSD.org/src/rev/a5028cadf6a6
branches:  chs-ubc2
changeset: 471376:a5028cadf6a6
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Jul 04 01:56:30 1999 +0000

description:
check for bcount being 0 in ufs_strategy().
some casting tidyness.

diffstat:

 sys/ufs/ufs/ufs_vnops.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r 8f43fe71515e -r a5028cadf6a6 sys/ufs/ufs/ufs_vnops.c
--- a/sys/ufs/ufs/ufs_vnops.c   Sun Jul 04 01:55:41 1999 +0000
+++ b/sys/ufs/ufs/ufs_vnops.c   Sun Jul 04 01:56:30 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_vnops.c,v 1.57 1999/03/24 05:51:31 mrg Exp $       */
+/*     $NetBSD: ufs_vnops.c,v 1.57.4.1 1999/07/04 01:56:30 chs Exp $   */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993, 1995
@@ -1631,6 +1631,8 @@
        ip = VTOI(vp);
        if (vp->v_type == VBLK || vp->v_type == VCHR)
                panic("ufs_strategy: spec");
+       if (bp->b_bcount == 0)
+               panic("ufs_strategy: bp %p bcount == 0", bp);
        if (bp->b_blkno == bp->b_lblkno) {
                error = VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno,
                                 NULL);
@@ -1640,10 +1642,10 @@
                        biodone(bp);
                        return (error);
                }
-               if ((long)bp->b_blkno == -1)
+               if (bp->b_blkno == (daddr_t)-1)
                        clrbuf(bp);
        }
-       if ((long)bp->b_blkno == -1) {
+       if (bp->b_blkno == (daddr_t)-1) {
                biodone(bp);
                return (0);
        }



Home | Main Index | Thread Index | Old Index