afs: improve -volume-ttl error messages 36/12936/2
authorMichael Meffie <mmeffie@sinenomine.net>
Tue, 20 Feb 2018 16:51:01 +0000 (11:51 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Sat, 14 Apr 2018 02:34:51 +0000 (22:34 -0400)
commit0b1d10fd2535b0059d1e88c23fbd3f60041edc9f
tree25eea36832ed7a2c1210492192e78dfb098bfb16
parent1d288d8776f1e91e55ee150a864126bcd60c1998
afs: improve -volume-ttl error messages

Change the afs call which sets the volume ttl value to return EFAULT
instead of EINVAL when given an out of range value for the volume ttl
parameter.  This is more consistent with the other op codes, which
return EFAULT when given an out of range parameter and allows the caller
to distinguish between an invalid opcode and a bad parameter.

Move the volume ttl range constants to afs_args.h, which is where
constants related to the op codes are supposed to be defined. This makes
the constants available to the caller in afsd.c as well as the
implementation in afs_call.c.

Update afsd to print a more sensible error message when the volume ttl
set calls fails due to an out of range parameter.

Reviewed-on: https://gerrit.openafs.org/12918
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 6d74e3d6a1becf86cec30efc2d01a5692167afe1)

Change-Id: I2cd86b6fbba31f74862bb902ac94b0874de8afac
Reviewed-on: https://gerrit.openafs.org/12936
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/afs/afs.h
src/afs/afs_call.c
src/afsd/afsd.c
src/config/afs_args.h