]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
volser: log message for cross-device link errors
authorMichael Meffie <mmeffie@sinenomine.net>
Tue, 18 Feb 2014 18:59:59 +0000 (13:59 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 7 Oct 2015 10:09:30 +0000 (06:09 -0400)
Add a log entry to the volume server to help diagnose those pesky
'Invalid cross-link device' errors returned by vos, which occur when
a clone volume is located in a different partition than the parent
read-write volume, or when a read-only volume is on the incorrect
partition on the server.

With this change, a new log entry is added when the volume server
fails to create a clone or a read-write volume because a volume with
the target volume id already exists on a different partition.  For a
clone volume, this would be a different partition than the
read-write volume. For a read-only volume, this would be a different
partition than indicated in the vldb.

Examples:

Volume foobar is on /vicepb, but foobar.backup is incorrectly on
partition /vicepa.

$ vos backup foobar
Failed to clone the volume 536870934
: Invalid cross-device link

VolserLog:
 VCreateVolume: volume 536870936 for parent 536870934 found on /vicepa; unable to create volume on /vicepb.
 1 Volser: Clone: Couldn't create new volume 536870936 for parent 536870934; clone aborted
 ...

The vldb indicates a read-only volume should be on /vicepa on a
remote site, but the actual volume is on /vicepb.

$ vos release xyzzy
Failed to create the ro volume: : Input/output error
The volume 536870921 could not be released to the following 1 sites:
                             mantis /vicepa
VOLSER: release could not be completed
...

VolserLog on mantis:
 VCreateVolume: volume 536870922 for parent 536870921 found on /vicepb; unable to create volume on /vicepa.
 ...

Reviewed-on: http://gerrit.openafs.org/10849
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 21a85792c44e2145eea6d10dc31d58028ba933b8)

Change-Id: Ib0a8a12e61948ed45b0b0a87723cac8668c987ff
Reviewed-on: http://gerrit.openafs.org/11586
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Phoebe Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/vol/vutil.c
src/volser/volprocs.c

index 991005bae06225c9e065c58578028099584ff204..0bb10e340bc3fca49c12fe6f7dfa2ab9436083c5 100644 (file)
@@ -173,9 +173,13 @@ VCreateVolume_r(Error * ec, char *partname, VolId volumeId, VolId parentId)
     if (*ec == VNOVOL || !strcmp(partition->name, part)) {
        /* this case is ok */
     } else {
-       /* return EXDEV if it's a clone to an alternate partition
+       /* return EXDEV if it's a clone or read-only to an alternate partition
         * otherwise assume it's a move */
        if (vol.parentId != vol.id) {
+           Log("VCreateVolume: volume %lu for parent %lu"
+               " found on %s; unable to create volume on %s.\n",
+               afs_printable_uint32_lu(vol.id),
+               afs_printable_uint32_lu(vol.parentId), part, partition->name);
            *ec = EXDEV;
            return NULL;
        }
index ea12c639719b1dea28dacbc6f5e3479a40532c21..d6cd1047a67d344f9336855b30adb74f1a016f39 100644 (file)
@@ -804,7 +804,8 @@ VolClone(struct rx_call *acid, afs_int32 atrans, afs_uint32 purgeId,
            VCreateVolume(&error, originalvp->partition->name, newId,
                          V_parentId(originalvp));
        if (error) {
-           Log("1 Volser: Clone: Couldn't create new volume; clone aborted\n");
+           Log("1 Volser: Clone: Couldn't create new volume %lu for parent %lu; clone aborted\n",
+               afs_printable_uint32_lu(newId), afs_printable_uint32_lu(V_parentId(originalvp)));
            newvp = (Volume *) 0;
            goto fail;
        }