Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-2-0]: src/sys/ufs/ext2fs Pull up revision 1.19 (requested by bouy...
details: https://anonhg.NetBSD.org/src/rev/05ecc3902e3a
branches: netbsd-2-0
changeset: 564773:05ecc3902e3a
user: riz <riz%NetBSD.org@localhost>
date: Wed May 11 13:43:46 2005 +0000
description:
Pull up revision 1.19 (requested by bouyer in ticket #1355):
getblk() can return NULL if we are the pagedaemon. Check for this.
diffstat:
sys/ufs/ext2fs/ext2fs_bmap.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diffs (35 lines):
diff -r 608e1ba3233e -r 05ecc3902e3a sys/ufs/ext2fs/ext2fs_bmap.c
--- a/sys/ufs/ext2fs/ext2fs_bmap.c Sat May 07 07:11:13 2005 +0000
+++ b/sys/ufs/ext2fs/ext2fs_bmap.c Wed May 11 13:43:46 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ext2fs_bmap.c,v 1.15 2004/03/22 19:23:08 bouyer Exp $ */
+/* $NetBSD: ext2fs_bmap.c,v 1.15.2.1 2005/05/11 13:43:46 riz Exp $ */
/*
* Copyright (c) 1989, 1991, 1993
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_bmap.c,v 1.15 2004/03/22 19:23:08 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_bmap.c,v 1.15.2.1 2005/05/11 13:43:46 riz Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -225,6 +225,16 @@
xap->in_exists = 1;
bp = getblk(vp, metalbn, mp->mnt_stat.f_iosize, 0, 0);
+ if (bp == NULL) {
+
+ /*
+ * getblk() above returns NULL only iff we are
+ * pagedaemon. See the implementation of getblk
+ * for detail.
+ */
+
+ return (ENOMEM);
+ }
if (bp->b_flags & (B_DONE | B_DELWRI)) {
trace(TR_BREADHIT, pack(vp, size), metalbn);
}
Home |
Main Index |
Thread Index |
Old Index