tech-kern archive

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

getblk() returning NULL ???



Dear folks, dear Andrew,

some serious trouble here; getblk() returns NULL at times when reading 
msdosfs files and msdosfs can't handle that... It looks like the semantics 
of getblk() has changed from "never return NULL unless we're the page 
deamon" to "can return NULL when we're running out of memory"... this could 
also explain the LFS problems since AFAICS the LFS code is also not aware 
of this change as is msdosfs and others...

Would an audit of this problem be a good idea? or revert to the old 
semantics be a better solution?

With regards,
Reinoud

> gid getblk | grep sys
sys/sys/buf.h:303:buf_t *getblk(struct vnode *, daddr_t, int, int, int);
sys/kern/vfs_bio.c:652: bp = getblk(vp, blkno, size, 0, 0);
sys/kern/vfs_bio.c:662:  * Note that if buffer is BC_INVAL, getblk() won't 
return it.
sys/kern/vfs_bio.c:1130:getblk(struct vnode *vp, daddr_t blkno, int size, int 
slpflag, int slptimeo)
sys/kern/vfs_bio.c:1150:                        panic("getblk: block size 
invariant failed");
sys/nfs/nfs_bio.c:593:          bp = getblk(vp, bn, size, PCATCH, 0);
sys/nfs/nfs_bio.c:597:                  bp = getblk(vp, bn, size, 0, 2 * hz);
sys/nfs/nfs_bio.c:600:          bp = getblk(vp, bn, size, 0, 0);
sys/fs/msdosfs/msdosfs_fat.c:435:                       /* getblk() never fails 
*/
sys/fs/msdosfs/msdosfs_fat.c:436:                       bpn = 
getblk(pmp->pm_devvp, de_bn2kb(pmp, fatbn),
sys/fs/msdosfs/msdosfs_fat.c:1117:                              bp = 
getblk(pmp->pm_devvp,
sys/fs/msdosfs/msdosfs_vnops.c:1265:    bp = getblk(pmp->pm_devvp, lbn, 
pmp->pm_bpcluster, 0, 0);
sys/fs/ntfs/ntfs_subr.c:1577:                           bp = 
getblk(ntmp->ntm_devvp, lbn,
sys/fs/sysvbfs/bfs_sysvbfs.c:145:       if ((bp = getblk(bio->vp, block, 
DEV_BSIZE, 0, 0)) == 0) {
sys/fs/sysvbfs/bfs_sysvbfs.c:146:               printf("getblk failed.\n");
sys/miscfs/specfs/spec_vnops.c:602:                             bp = getblk(vp, 
bn, bsize, 0, 0);
sys/ufs/ext2fs/ext2fs_balloc.c:163:                     bp = getblk(vp, bn, 
fs->e2fs_bsize, 0, 0);
sys/ufs/ext2fs/ext2fs_balloc.c:197:             bp = getblk(vp, 
indirs[1].in_lbn, fs->e2fs_bsize, 0, 0);
sys/ufs/ext2fs/ext2fs_balloc.c:240:             nbp = 
getblk(vp,indirs[i].in_lbn, fs->e2fs_bsize, 0, 0);
sys/ufs/ext2fs/ext2fs_balloc.c:291:                     nbp = getblk(vp, lbn, 
fs->e2fs_bsize, 0, 0);
sys/ufs/ext2fs/ext2fs_balloc.c:309:                     nbp = getblk(vp, lbn, 
fs->e2fs_bsize, 0, 0);
sys/ufs/ext2fs/ext2fs_balloc.c:345:                     bp = getblk(vp, 
indirs[i].in_lbn, (int)fs->e2fs_bsize,
sys/ufs/ext2fs/ext2fs_bmap.c:228:               bp = getblk(vp, metalbn, 
mp->mnt_stat.f_iosize, 0, 0);
sys/ufs/ext2fs/ext2fs_bmap.c:232:                        * getblk() above 
returns NULL only iff we are
sys/ufs/ext2fs/ext2fs_bmap.c:233:                        * pagedaemon.  See the 
implementation of getblk
sys/ufs/ext2fs/ext2fs_inode.c:484:      bp = getblk(vp, lbn, 
(int)fs->e2fs_bsize, 0, 0);
sys/ufs/ext2fs/ext2fs_vfsops.c:1174:    bp = getblk(mp->um_devvp, SBLOCK, 
SBSIZE, 0, 0);
sys/ufs/ext2fs/ext2fs_vfsops.c:1192:            bp = getblk(mp->um_devvp, 
fsbtodb(fs,
sys/ufs/ffs/ffs_softdep.c:1837:             getblk(ip->i_devvp, bp->b_blkno, 
bp->b_bcount, 0, 0);
sys/ufs/ffs/ffs_subr.c:121:     if ((*bpp = getblk(vp, lblkno, size, 0, 0)) == 
NULL)
sys/ufs/lfs/lfs_balloc.c:188:                           *bpp = bp = getblk(vp, 
lbn, nsize, 0, 0);
sys/ufs/lfs/lfs_balloc.c:258:                           ibp = getblk(vp, 
indirs[i].in_lbn,
sys/ufs/lfs/lfs_balloc.c:299:           *bpp = bp = getblk(vp, lbn, blksize(fs, 
ip, lbn), 0, 0);
sys/ufs/lfs/lfs_inode.c:729:    bp = getblk(vp, lbn, (int)fs->lfs_bsize, 0, 0);
sys/ufs/lfs/lfs_segment.c:1098:                 
getblk(VTOI(fs->lfs_ivnode)->i_devvp,
sys/ufs/lfs/lfs_syscalls.c:446:                 bp = getblk(vp, blkp->bi_lbn, 
blkp->bi_size, 0, 0);
sys/ufs/lfs/lfs_syscalls.c:451:                          * getblk() returned is 
empty.  So, we
sys/ufs/ufs/ufs_bmap.c:240:             bp = getblk(vp, metalbn, 
mp->mnt_stat.f_iosize, 0, 0);
sys/ufs/ufs/ufs_bmap.c:244:                      * getblk() above returns NULL 
only iff we are
sys/ufs/ufs/ufs_bmap.c:245:                      * pagedaemon.  See the 
implementation of getblk


Attachment: pgpn7LCGmH6mw.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index