Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ffs Initialize error in snapshot_expunge(); if the l...



details:   https://anonhg.NetBSD.org/src/rev/5344d041a873
branches:  trunk
changeset: 762268:5344d041a873
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Fri Feb 18 14:48:54 2011 +0000

description:
Initialize error in snapshot_expunge(); if the list is empty error would
be returned uninitialized. t_snapshot_v2 was failing for me when
librumpffs was compiled DGB=-g.
No idea why gcc didn't catch this ...

diffstat:

 sys/ufs/ffs/ffs_snapshot.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 8cd15bd4acbb -r 5344d041a873 sys/ufs/ffs/ffs_snapshot.c
--- a/sys/ufs/ffs/ffs_snapshot.c        Fri Feb 18 14:44:46 2011 +0000
+++ b/sys/ufs/ffs/ffs_snapshot.c        Fri Feb 18 14:48:54 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_snapshot.c,v 1.104 2011/02/18 08:39:13 hannken Exp $       */
+/*     $NetBSD: ffs_snapshot.c,v 1.105 2011/02/18 14:48:54 bouyer 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.104 2011/02/18 08:39:13 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.105 2011/02/18 14:48:54 bouyer Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -563,7 +563,7 @@
 snapshot_expunge(struct mount *mp, struct vnode *vp, struct fs *copy_fs,
     daddr_t *snaplistsize, daddr_t **snaplist)
 {
-       int cg, error, len, loc;
+       int cg, error = 0, len, loc;
        daddr_t blkno, *blkp;
        struct fs *fs = VFSTOUFS(mp)->um_fs;
        struct inode *xp;



Home | Main Index | Thread Index | Old Index