From 21a85792c44e2145eea6d10dc31d58028ba933b8 Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Tue, 18 Feb 2014 13:59:59 -0500 Subject: [PATCH] volser: log message for cross-device link errors 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. ... Change-Id: Iaa471c46059d598a5095d59580e3b0b8ac6e1992 Reviewed-on: http://gerrit.openafs.org/10849 Tested-by: BuildBot Reviewed-by: Perry Ruiter Reviewed-by: D Brashear --- src/vol/vutil.c | 6 +++++- src/volser/volprocs.c | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vol/vutil.c b/src/vol/vutil.c index 7517e709f..35389d47a 100644 --- a/src/vol/vutil.c +++ b/src/vol/vutil.c @@ -158,9 +158,13 @@ VCreateVolume_r(Error * ec, char *partname, VolumeId volumeId, VolumeId 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 %" AFS_VOLID_FMT " for parent %" AFS_VOLID_FMT + " found on %s; unable to create volume on %s.\n", + afs_printable_VolumeId_lu(vol.id), + afs_printable_VolumeId_lu(vol.parentId), part, partition->name); *ec = EXDEV; return NULL; } diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 5555ca429..0c373d814 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -794,7 +794,8 @@ VolClone(struct rx_call *acid, afs_int32 atrans, VolumeId 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 %" AFS_VOLID_FMT " for parent %" AFS_VOLID_FMT "; clone aborted\n", + afs_printable_VolumeId_lu(newId), afs_printable_VolumeId_lu(V_parentId(originalvp))); newvp = (Volume *) 0; goto fail; } -- 2.39.5