Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/ffs Fix unchecked UFS_WAPBL_BEGIN. Coverity 975226.
details: https://anonhg.NetBSD.org/src/rev/d2825814a569
branches: trunk
changeset: 330466:d2825814a569
user: dholland <dholland%NetBSD.org@localhost>
date: Thu Jul 10 06:27:15 2014 +0000
description:
Fix unchecked UFS_WAPBL_BEGIN. Coverity 975226.
Unfortunately it looks like all we can do on error here is printf.
diffstat:
sys/ufs/ffs/ffs_wapbl.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diffs (38 lines):
diff -r 96267e59d97b -r d2825814a569 sys/ufs/ffs/ffs_wapbl.c
--- a/sys/ufs/ffs/ffs_wapbl.c Thu Jul 10 06:24:02 2014 +0000
+++ b/sys/ufs/ffs/ffs_wapbl.c Thu Jul 10 06:27:15 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_wapbl.c,v 1.25 2013/10/25 11:35:55 martin Exp $ */
+/* $NetBSD: ffs_wapbl.c,v 1.26 2014/07/10 06:27:15 dholland Exp $ */
/*-
* Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_wapbl.c,v 1.25 2013/10/25 11:35:55 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_wapbl.c,v 1.26 2014/07/10 06:27:15 dholland Exp $");
#define WAPBL_INTERNAL
@@ -147,9 +147,16 @@
* initialized in ufs_makeinode. If so, just dallocate them.
*/
if (ip->i_mode == 0) {
- UFS_WAPBL_BEGIN(mp);
- ffs_vfree(vp, ip->i_number, wr->wr_inodes[i].wr_imode);
- UFS_WAPBL_END(mp);
+ error = UFS_WAPBL_BEGIN(mp);
+ if (error) {
+ printf("ffs_wapbl_replay_finish: "
+ "unable to cleanup inode %" PRIu32 "\n",
+ wr->wr_inodes[i].wr_inumber);
+ } else {
+ ffs_vfree(vp, ip->i_number,
+ wr->wr_inodes[i].wr_imode);
+ UFS_WAPBL_END(mp);
+ }
}
vput(vp);
}
Home |
Main Index |
Thread Index |
Old Index