From 613f14727fbb404fb7fc1cac953dda46b671222e Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 5 Apr 2012 17:55:17 -0500 Subject: [PATCH 1/1] viced: Do not offline volume on successful IH_DEC If we fail to CoW a file due to ENOSPC, we try to IH_DEC the new file copy, and if IH_DEC fails, we take the volume offline for salvaging. But IH_DEC returns 0 on success, not on error. So take the salvaging path when we get non-zero. Change-Id: I4f0276fd4f077ca42087e92af8ba77b4e5347422 Reviewed-on: http://gerrit.openafs.org/7054 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/viced/afsfileprocs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index f759541..0d8857f 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -1326,7 +1326,7 @@ CopyOnWrite(Vnode * targetptr, Volume * volptr, afs_foff_t off, afs_fsize_t len) IH_RELEASE(newH); FDH_REALLYCLOSE(targFdP); rc = IH_DEC(V_linkHandle(volptr), ino, V_parentId(volptr)); - if (!rc) { + if (rc) { ViceLog(0, ("CopyOnWrite failed: error %u after i_dec on disk full, volume %u in partition %s needs salvage\n", rc, V_id(volptr), volptr->partition->name)); -- 1.9.4