]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
viced: Do not offline volume on successful IH_DEC
authorAndrew Deason <adeason@sinenomine.net>
Thu, 5 Apr 2012 22:55:17 +0000 (17:55 -0500)
committerDerrick Brashear <shadow@dementix.org>
Thu, 10 May 2012 21:34:03 +0000 (14:34 -0700)
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.

Reviewed-on: http://gerrit.openafs.org/7054
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 613f14727fbb404fb7fc1cac953dda46b671222e)

Change-Id: I207ffc4db59bdbd8b80fa4ffad9210d13d76b68f
Reviewed-on: http://gerrit.openafs.org/7394
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/viced/afsfileprocs.c

index 23149763ef2c4c4780c0c6c435c2cc2dc60ebfe0..e09a96820c7ae2bb32995c00d82b0400005a8677 100644 (file)
@@ -1347,7 +1347,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));