]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
viced: Check vnode length on Rename and Link
authorAndrew Deason <adeason@sinenomine.net>
Mon, 16 May 2011 20:02:14 +0000 (15:02 -0500)
committerDerrick Brashear <shadow@dementix.org>
Fri, 16 Dec 2011 11:01:21 +0000 (03:01 -0800)
Commit 2578555d7e08131bf2fe4cdd0aa4b32567a76eb2 added vnode length
checks when we create or remove vnodes, but not during Rename and Link
operations (when vnodes are neither created nor destroyed). Add the
check in Rename and Link.

Reviewed-on: http://gerrit.openafs.org/4668
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 6df5547a7b93af74bc49ec8d4678aafd646dda1b)

Change-Id: I795407a143a56f26c0679b929763ebdc9c633e7a
Reviewed-on: http://gerrit.openafs.org/6298
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/viced/afsfileprocs.c

index b7319b8df5f0b08ace809c0ef0b588dabac12bbc..9238654b1867eec267ad64f432b5e8f90a8261ac 100644 (file)
@@ -3980,6 +3980,13 @@ SAFSS_Rename(struct rx_call *acall, struct AFSFid *OldDirFid, char *OldName,
        goto Bad_Rename;
     }
 
+    if (CheckLength(volptr, oldvptr, -1) ||
+        CheckLength(volptr, newvptr, -1)) {
+       VTakeOffline(volptr);
+       errorCode = VSALVAGE;
+       goto Bad_Rename;
+    }
+
     /* The CopyOnWrite might return ENOSPC ( disk full). Even if the second
      *  call to CopyOnWrite returns error, it is not necessary to revert back
      *  the effects of the first call because the contents of the volume is
@@ -4673,6 +4680,12 @@ SAFSS_Link(struct rx_call *acall, struct AFSFid *DirFid, char *Name,
        goto Bad_Link;
     }
 
+    if (CheckLength(volptr, parentptr, -1)) {
+       VTakeOffline(volptr);
+       errorCode = VSALVAGE;
+       goto Bad_Link;
+    }
+
     /* get the file vnode  */
     if ((errorCode =
         CheckVnode(ExistingFid, &volptr, &targetptr, WRITE_LOCK))) {