From: Michael Meffie Date: Tue, 18 Feb 2014 18:59:59 +0000 (-0500) Subject: volser: log message for cross-device link errors X-Git-Tag: upstream/1.6.17^2~58 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=3b93c89863512b17d9fbc6b9e8702d63853ff8bf;p=packages%2Fo%2Fopenafs.git 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. ... Reviewed-on: http://gerrit.openafs.org/10849 Tested-by: BuildBot Reviewed-by: Perry Ruiter Reviewed-by: D Brashear (cherry picked from commit 21a85792c44e2145eea6d10dc31d58028ba933b8) Change-Id: Ib0a8a12e61948ed45b0b0a87723cac8668c987ff Reviewed-on: http://gerrit.openafs.org/11586 Tested-by: BuildBot Reviewed-by: Daria Phoebe Brashear Reviewed-by: Jeffrey Altman Reviewed-by: Stephan Wiesand --- diff --git a/src/vol/vutil.c b/src/vol/vutil.c index 991005bae..0bb10e340 100644 --- a/src/vol/vutil.c +++ b/src/vol/vutil.c @@ -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; } diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index ea12c6397..d6cd1047a 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -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; }