Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/ufs ufs_inactive: stop overwriting error status and ...
details: https://anonhg.NetBSD.org/src/rev/5c9e619e44f4
branches: trunk
changeset: 338872:5c9e619e44f4
user: hannken <hannken%NetBSD.org@localhost>
date: Sat Jun 13 14:56:45 2015 +0000
description:
ufs_inactive: stop overwriting error status and return the last error seen.
Should resolve CID 1306276 (UNUSED_VALUE)
diffstat:
sys/ufs/ufs/ufs_inode.c | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diffs (63 lines):
diff -r fc995ddf245b -r 5c9e619e44f4 sys/ufs/ufs/ufs_inode.c
--- a/sys/ufs/ufs/ufs_inode.c Sat Jun 13 07:35:50 2015 +0000
+++ b/sys/ufs/ufs/ufs_inode.c Sat Jun 13 14:56:45 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_inode.c,v 1.94 2015/06/10 15:28:27 hannken Exp $ */
+/* $NetBSD: ufs_inode.c,v 1.95 2015/06/13 14:56:45 hannken Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_inode.c,v 1.94 2015/06/10 15:28:27 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_inode.c,v 1.95 2015/06/13 14:56:45 hannken Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -86,7 +86,7 @@
struct inode *ip = VTOI(vp);
struct mount *mp = vp->v_mount;
mode_t mode;
- int error = 0;
+ int allerror = 0, error;
bool wapbl_locked = false;
UFS_WAPBL_JUNLOCK_ASSERT(mp);
@@ -102,10 +102,12 @@
ufs_extattr_vnode_inactive(vp, curlwp);
#endif
if (ip->i_size != 0)
- error = ufs_truncate(vp, 0, NOCRED);
+ allerror = ufs_truncate(vp, 0, NOCRED);
#if defined(QUOTA) || defined(QUOTA2)
error = UFS_WAPBL_BEGIN(mp);
- if (error == 0) {
+ if (error) {
+ allerror = error;
+ } else {
wapbl_locked = true;
(void)chkiq(ip, -1, NOCRED, 0);
}
@@ -124,8 +126,10 @@
if (ip->i_flag & (IN_CHANGE | IN_UPDATE | IN_MODIFIED)) {
if (! wapbl_locked) {
error = UFS_WAPBL_BEGIN(mp);
- if (error)
+ if (error) {
+ allerror = error;
goto out;
+ }
wapbl_locked = true;
}
UFS_UPDATE(vp, NULL, NULL, 0);
@@ -140,7 +144,7 @@
*ap->a_recycle = (ip->i_mode == 0);
VOP_UNLOCK(vp);
fstrans_done(mp);
- return (error);
+ return (allerror);
}
/*
Home |
Main Index |
Thread Index |
Old Index