Module Name: src
Committed By: dyoung
Date: Wed Feb 23 17:05:33 UTC 2011
Modified Files:
src/sys/ufs/ffs: ffs_snapshot.c
Log Message:
Initialize blkno to 0 right before the snapblkaddr() call that GCC does
not understand so that if ffs_copyonwrite() sprouts a new code path that
does not initialize blkno, the compiler has the chance to reveal it.
To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/ufs/ffs/ffs_snapshot.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/ufs/ffs/ffs_snapshot.c
diff -u src/sys/ufs/ffs/ffs_snapshot.c:1.108 src/sys/ufs/ffs/ffs_snapshot.c:1.109
--- src/sys/ufs/ffs/ffs_snapshot.c:1.108 Wed Feb 23 08:53:21 2011
+++ src/sys/ufs/ffs/ffs_snapshot.c Wed Feb 23 17:05:33 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_snapshot.c,v 1.108 2011/02/23 08:53:21 hannken Exp $ */
+/* $NetBSD: ffs_snapshot.c,v 1.109 2011/02/23 17:05:33 dyoung Exp $ */
/*
* Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.108 2011/02/23 08:53:21 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.109 2011/02/23 17:05:33 dyoung Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -1826,8 +1826,6 @@
uint32_t gen;
int lower, upper, mid, snapshot_locked = 0, error = 0;
- blkno = 0; /* XXX: GCC */
-
/*
* Check for valid snapshots.
*/
@@ -1898,6 +1896,7 @@
blkno = db_get(ip, lbn);
} else {
mutex_exit(&si->si_lock);
+ blkno = 0; /* XXX: GCC */
if ((error = snapblkaddr(vp, lbn, &blkno)) != 0) {
mutex_enter(&si->si_lock);
break;