Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs If DIAGNOSTIC and the segment writer gets a badl...



details:   https://anonhg.NetBSD.org/src/rev/2d734e286a12
branches:  trunk
changeset: 501912:2d734e286a12
user:      joff <joff%NetBSD.org@localhost>
date:      Tue Jan 09 05:05:35 2001 +0000

description:
If DIAGNOSTIC and the segment writer gets a badly sized buffer, panic()
instead of silently corrupting the filesystem.

diffstat:

 sys/ufs/lfs/lfs_segment.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 7421032bbab6 -r 2d734e286a12 sys/ufs/lfs/lfs_segment.c
--- a/sys/ufs/lfs/lfs_segment.c Tue Jan 09 05:04:23 2001 +0000
+++ b/sys/ufs/lfs/lfs_segment.c Tue Jan 09 05:05:35 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_segment.c,v 1.66 2000/12/03 05:56:27 perseant Exp $        */
+/*     $NetBSD: lfs_segment.c,v 1.67 2001/01/09 05:05:35 joff Exp $    */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -1085,6 +1085,10 @@
                               " has same lbn and daddr\n",
                               VTOI(vp)->i_number, off);
                }
+#ifdef DIAGNOSTIC
+               if((*sp->start_bpp)->b_bcount < fs->lfs_bsize && i != 0)
+                       panic("lfs_updatemeta: fragment is not last block\n");
+#endif
                bb = fragstodb(fs, numfrags(fs, (*sp->start_bpp)->b_bcount));
                fs->lfs_offset += bb;
                error = ufs_bmaparray(vp, lbn, &daddr, a, &num, NULL);



Home | Main Index | Thread Index | Old Index