From: Mark Vitale Date: Fri, 28 Aug 2020 20:19:29 +0000 (-0400) Subject: volser: document 'vos restore -readonly' restriction X-Git-Tag: openafs-devel-1_9_1~80 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=8e1c321dc8e85966383760a6765f7f192ecf632a volser: document 'vos restore -readonly' restriction Commit 0c03f8607e15 vos-command-enhancements-20011008 introduced the 'vos restore' -readonly option, which allows the restored volume to be RO instead of the default RW. The commit message documents the following restriction: - ... This option causes the restored volume to be an RO volume. It is not permitted to restore an RO volume when the associated RW volume already exists. While it is possible to restore an RW volume where an RO volume exists, caution should be used to avoid doing this with VLDB entries created by 'vos restore -readonly', since such entries have their ROVOL and RWVOL ID's set to the same thing. Document this restriction in the 'vos restore' man page, and in a code comment. No functional change is incurred by this commit. Change-Id: I34f6c5434b82da538a38a9d219207b33dcf62b17 Reviewed-on: https://gerrit.openafs.org/14348 Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- diff --git a/doc/man-pages/pod1/vos_restore.pod.in b/doc/man-pages/pod1/vos_restore.pod.in index 6c5dd70..701af0c 100644 --- a/doc/man-pages/pod1/vos_restore.pod.in +++ b/doc/man-pages/pod1/vos_restore.pod.in @@ -193,7 +193,8 @@ Leaves the new volume flagged as off-line in the volume database. =item B<-readonly> -Flags the new volume as read-only in the volume database. +Flags the new volume as read-only in the volume database. This option +is prohibited if an RW volume is already defined in the VLDB entry. =item B<-creation> > diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index de0b900..a2c00ca 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -4542,6 +4542,7 @@ UV_RestoreVolume2(afs_uint32 toserver, afs_int32 topart, afs_uint32 tovolid, error = vcode; goto refail; } else if (flags & RV_RDONLY) { + /* -readonly restore is prohibited if an RW already exists */ if (entry.flags & VLF_RWEXISTS) { fprintf(STDERR, "Entry for ReadWrite volume %s already exists!\n",