Commit Graph

317 Commits

Author SHA1 Message Date
Marc Dionne
f02d34315e Remove unused variable in vos.c
Remove an unused variable introduced by a recent commit.

Change-Id: I04432d87a27b656807430f041f84d6ada2632434
Reviewed-on: http://gerrit.openafs.org/1765
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-04-16 16:41:34 -07:00
Harald Barth
2a35e3a028 Add vos setaddrs command and man page
The vos setaddrs command sets the IP addresses for a server entry
in the Volume Location Database (VLDB). Specify one or serveral hosts.
All existing hosts in the VLDB entry are replaced with the new entries
on the command line.

Change-Id: I3c26e49c4a6e2aebae363017d074329ac265132a
Reviewed-on: http://gerrit.openafs.org/1744
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-16 10:15:29 -07:00
Jonathan Billings
ae19c2d246 Move restorevol to bin from sbin in make dest
Adds to the changes made in d6df1a8cec
so that 'make dest' installs restorevol into bin.

Change-Id: I9c7f302ad9a2f25e9a362ea96dbbf0d91a7d9b04
Reviewed-on: http://gerrit.openafs.org/1669
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-30 13:27:19 -07:00
Jeffrey Altman
88305c3065 Windows LWP and UNIX LWP do not have the same lwp_cpptr structure
Windows LWP uses Windows Fibers.  There is no 'stack' field.

Change-Id: I8ebc7b355642f9e3ad6f2953345b9858ab9c151a
Reviewed-on: http://gerrit.openafs.org/1638
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-03-23 16:00:03 -07:00
Andrew Deason
6448d4edc8 vos: correct syncvldb -verbose server byte order
'vos syncvldb -verbose' outputs the before/after VLDB entries for
altered entries, but the 'after' output shows server addresses in NBO.
EnumerateEntry expects server IPs to be in NBO, so correct one location
where they were passed in HBO.

Change-Id: I332fe83b45b2b595e091c8eb9bdc57d89d5e36a8
Reviewed-on: http://gerrit.openafs.org/1550
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 12:28:35 -07:00
Andrew Deason
9af8d46e77 vos: Avoid LWP stack overflow error on SIGINT
vsproc's method of longjmp'ing out of a signal handler can thoroughly
confuse LWP. At the very least, the information on our stack becomes
incorrect, since we're no longer using the stack supplied by LWP. At the
very least, we seem to (almost) always fail the sanity check checking
for stack overflow. To prevent the test from happening, NULL the stack
pointer before the longjmp so we can attempt recovery.

FIXES 33360

Change-Id: Ie910cb1cc8564ac119c3b751fd8295bf312a3ce7
Reviewed-on: http://gerrit.openafs.org/1559
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 12:14:29 -07:00
Andrew Deason
bf2d0db680 vos: Use IOMGR_SoftSig for signals
When vsprocs tries to longjmp from the signal handler, use IOMGR_SoftSig
first, so sleeping processes are woken back up. Without this, IOMGR can
bail out since it finds no processes READY when we attempt to do
anything with RX.

Change-Id: I9089bc4d003786d4a2205cd97f722fbf85fd1aa8
Reviewed-on: http://gerrit.openafs.org/1558
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 12:14:04 -07:00
Andrew Deason
fe3ff8e912 vos: Mark longjmp-used variables as 'volatile'
vsprocs tries to do error recovery by calling longjmp from a signal
handler. Although this is quite error-prone since we call a ton of
non-async-signal-safe functions, make it a bit more likely to work by
marking variables that are used after the longjmp as volatile. This
reduces how often (depending on the platform) these values will be
completely worthless after a longjmp since they were cached in a
register or similar.

FIXES 125535

Change-Id: I8566f8cffde6cfdffd99a11d637645494e0a0514
Reviewed-on: http://gerrit.openafs.org/1557
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 12:13:33 -07:00
Dan Hyde
105481d334 VOL_LOCK needed when traversing DiskPartitionList
VLockPartition sets VOL_LOCK, opens (perhaps creating) the lock file
for a partition, and flock's it.  VUnlockPartition, sets VOL_LOCK, and
closes the lock file fd.

VLockPartition is called from the salvager.  Nothing ever calls
VUnlockPartition.

VPFullUnlock is called every 30 seconds, does NOT set VOL_LOCK, and
happily closes any lock file fd it finds, breaking any lock set with
flock.

Other routines use the VOL_LOCK when traversing DiskPartitionList.

Change-Id: I683547f574b1f760e72014f5d44ce3987f07b5df
Reviewed-on: http://gerrit.openafs.org/1213
Reviewed-by: Dan Hyde <drh@umich.edu>
Tested-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-18 20:53:55 -07:00
Andrew Deason
2d7e83dccc Squash pthreaded vos warnings
Trying to build vos in src/tvolser can produce a warning, at least on
amd64_linux26, since we cast to an int of the wrong size in SendFile and
ReceiveFile. Use intptr_t like we do everywhere else instead.

Change-Id: Ic624bf90ab7338b63f8177b762e1deddbe7fb73d
Reviewed-on: http://gerrit.openafs.org/1556
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-03-10 12:52:21 -08:00
Andrew Deason
1e53da39f5 Include stdint.h when using intptr_t
Some platforms such as OpenBSD require including stdint.h before you can
use intptr_t. So, include stdint.h (if it is available) whenever we use
intptr_t.

Change-Id: I6da005755752e8d52f62e78d15103b19a951e50a
Reviewed-on: http://gerrit.openafs.org/1336
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-02-17 12:49:27 -08:00
Jeffrey Altman
7b6ccc1b91 Windows: Permit Windows to build
Recent changes added a new dependency of afspioctl.lib to all
server binaries.

Export new afsconf_ functions from libafsauthent.dll

Fix afsconf_* usage in afsio.c

Change-Id: I03e377a3d28b4efbea4a799e6ca63606eab699c9
Reviewed-on: http://gerrit.openafs.org/1273
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-02-09 11:54:37 -08:00
Antoine Verheijen
4221d7acc8 Fix segmentation fault in vsu_GetVolumeID
When determining the volume type of a volume, vsu_GetVolumeID() checks
to see if the volume name ends in '.backup' or '.readonly' by backing
up the appropriate number of characters from the end of the name. It
does not, however, check to see if it skips past the beginning of the
volume name. This can result in a segmentation fault (which it has for
me on many occasions during a vos release) depending on where memory
is allocated or how/if memory is protected.

This patch corrects this behaviour by checking the volume name string
length prior to doing the string comparison.

Change-Id: Ia27fcac76b86ae2707663caa6bff365a4e8dd0da
Reviewed-on: http://gerrit.openafs.org/1269
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-02-08 19:37:25 -08:00
Simon Wilkinson
a82f8591a1 Common interface for server security objects
Add an interface for creating arrays of server security objects.
This collects all of the various daemon code for initialising
security objects into one place, reducing duplication and making
it easier to add new objects in the future.

Change-Id: I9df20afccdbac4a610cb5bde32f01069272f27a2
Reviewed-on: http://gerrit.openafs.org/1177
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-02-03 12:07:49 -08:00
Dan Hyde
d4f6ece19b volmonitor keep vtrans lock
VolMonitor must maintain the VTRANS lock the whole time it is walking
the allTrans list.  Failure to do so can cause core dumps trying to
access memory that has already been free'd.

Two versions of this change were coded and tested.  The other version
used the VTRANS lock only around a THOLD, but needed a TRELE, too.
Timing tests were run counting the number of vos status, vos listvol,
and vos backupsys operations that could be performed during a fixed
number of vos status operations.  The THOLD/TRELE version caused other
vos operations to run about 5% slower.

FIXES 126110

Change-Id: I7e749d30c955867faacafa978d7d643dee648ca3
Reviewed-on: http://gerrit.openafs.org/1098
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-01-14 08:10:08 -08:00
Andrew Deason
1544243167 Always check VInitVolumePackage2 return code
Some programs were not checking the return code of VInitVolumePackage2.
Although some programs do not care so much if we fail to properly init
the volume package (SYNC debug tools), at the very least log/print an
error, so it doesn't silently fail.

Other programs are changed to exit when VInitVolumePackage2 fail, so
e.g. salvages don't accidentally cause corruption on 'logging'-mounted
UFS partitions.

In any case, ensure the return code is always checked anywhere it is
called.

Change-Id: I164d5920a5ea2dd7e5ed9ad4ccc578e9bdf0db0b
Reviewed-on: http://gerrit.openafs.org/1090
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-01-14 07:07:06 -08:00
Andrew Deason
fe07f017f7 DAFS: Allow non-fileserver to schedule salvages
Allow non-fileserver programs to schedule salvages through the fileserver
via FSSYNC (VOL_FORCE_ERROR with the FSYNC_SALVAGE reason code). Also
make the volserver schedule salvages this way when it encounters the
appropriate errors.

FIXES 124484

Change-Id: I03ecf6302436c35fec705cd6c84a40b7cdbf6f97
Reviewed-on: http://gerrit.openafs.org/787
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-01-12 08:52:01 -08:00
Dan Hyde
8f689aec14 volmonitor copy link before calling free
Copy tt->next before TRELE(tt) calls free(tt).

We have a core file from a VTRANS_OBJ_LOCK(tt) assert failure, with tt
pointing into glibc's malloc data structures.

Change-Id: Id52b774520c59c224b58f5d507cc490dafea5ca1
Reviewed-on: http://gerrit.openafs.org/1069
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Thomas L. Kula <tkula@umich.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-01-06 12:32:03 -08:00
Simon Wilkinson
f545882014 Remove --disable-full-vos-listvol-switch option
Remove the --disable-full-vos-listvol-switch configuration option,
and the corresponding #ifdefs. Full output from vos listvol is now
always enabled.

Change-Id: Ib4900cc0a8532b3db31d13d34fe59946b34e86ed
Reviewed-on: http://gerrit.openafs.org/1031
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-31 05:01:08 -08:00
Simon Wilkinson
12f35e8493 Remove --disable-largefile-fileserver
Make largefile fileservers the only option. Remove all of the
AFS_LARGEFILE_ENV ifdefs, and tidy up some code as a result of
this change.

Change-Id: I126f7dc5505bbdb28c9337dcd2e81403045707f4
Reviewed-on: http://gerrit.openafs.org/1029
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Andrew Deason <adeason@sinenomine.net>
2009-12-31 04:55:31 -08:00
Andrew Deason
3df80a1638 Add the 'vos endtrans' command
Add a command to vos to explicitly end volume transactions. These can
happen if (for example) we segfault or the user ctrl-C's in 'vos'
before/after a volume operation, but before we AFSVolEndTrans.

Change-Id: Ie34ee1fdff917b56900f456c7cf8b1329533a7da
Reviewed-on: http://gerrit.openafs.org/870
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-16 10:57:07 -08:00
Andrew Deason
6f439ff7ed Expand ProgramType enumeration
The ProgramType values volumeUtility and salvager are overloaded. Expand
the ProgramType enum to include more specific program types, and adjust
conditionals to match.

Also, instead of determining all behavior by checking programType, add
some flags to be passed in to VInitVolumePackage to determine e.g.
whether or not we can use the FSSYNC channel. This makes it easier to
see the intent of some conditionals, and reduces the number of times a
caller must lie about what program it is.

Change-Id: Ic9852a35bb16a6b1f4b0aa9766de63178ecea56f
Reviewed-on: http://gerrit.openafs.org/786
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-10 11:49:46 -08:00
Derrick Brashear
61ba8e5a88 add newline to lockprocs_prototypes.h
gcc was unhappy about the lack of trailing newline. add one.

Change-Id: Ie9c93bd9ed8c923ea8069fe49e7f5ddb20c28f80
Reviewed-on: http://gerrit.openafs.org/898
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-07 12:55:37 -08:00
Michael Meffie
42516f2c0b fix for volser transaction object race conditions
Spell AFS_PTHREAD_ENV correctly and fix
missing pthread_mutex_init() argument.

Change-Id: I9a6397ef5ba3ef7197f3d927759258be31914fd7
Reviewed-on: http://gerrit.openafs.org/841
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-11-18 11:56:32 -08:00
Simon Wilkinson
36524b2ed7 Rationalise our include paths
Our include paths are a bit of a mess. Fix these so that they're
more rational, and more in line with normal coding style.

In particular:
   *) Don't include all of the subdirectories of our top level
      include directory. If a file wants afs/file.h, it should
      include that, not "file.h"
   *) Try to avoid including '.' in the search path (although
      objdir builds make this harder)
   *) Don't blindly include other directories from the code tree
      in the search path. If a package wants another packages header,
      then it should get it from the include directory
   *) Use the convention that quoted includes ("") pick up local
      headers. Bracketed includes (<>) pick up ones from the top level
      include dir
   *) In directories which pull in files from multiple packages, don't
      blindly put all of the package directories in the search path.
      Specifically include the file's package directory when required

The big change here is that it's no longer possible to hide a system
include by placing a header of the same name in include/afs. The most
common case where this was happening was for 'assert.h'

Change-Id: I0796fabcf83ffcd74e533624c64e138a160dd632
Reviewed-on: http://gerrit.openafs.org/834
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-11-17 13:12:57 -08:00
Simon Wilkinson
e854e26ef1 Update warning inhibition
A number of recent changes haven't caught all of the locations where
warning inhibition can be removed. This patch updates all of the
inhibitions to reflect the current state of the tree when built with
gcc4.2

Change-Id: I7bad4fee1258f4e37fd729cda84711fed66acbc9
Reviewed-on: http://gerrit.openafs.org/813
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-11-11 09:17:56 -08:00
Simon Wilkinson
be305ae119 Prototype UV_Bind
Publicly prototype UV_Bind in volser_prototypes.h

Make dump.c use the public prototype, instead of an incomplete
private copy, and remove the warning inhibition that was required to
support the private copy.

Change-Id: I945192454702d79083a10062adaf2cb124d14a35
Reviewed-on: http://gerrit.openafs.org/809
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-11-11 09:15:56 -08:00
Simon Wilkinson
d98d3060f8 Add printf-style format checking
Add the AFS_ATTRIBUTE_FORMAT macro which can be used to turn on
printf-like format checking for our va-arg log functions.

Enable this checking for volser's Log(), and fix the fallout from
doing so.

Change-Id: Ic5ab93ba731856f1f90e894d711b0f84298ded12
Reviewed-on: http://gerrit.openafs.org/789
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-11-08 08:27:16 -08:00
Jeffrey Altman
bf8355bd9a ubik_VL_GetAddrsU does not accept a VLCallBack parameter
ubik_VL_GetAddrU accepts a pointer to a uniqifier and not
a pointer to a VLCallBack structure.  Remove an incorrect
cast and provide the correct parameter in src/volser/vos.c.

Change-Id: I4b12cf2d4c65f115fdef76f0a4306960b5cd0413
Reviewed-on: http://gerrit.openafs.org/733
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-26 11:55:10 -07:00
Michael Meffie
11cdb70155 volser transaction object race conditions
Fix the transaction object races between VolMonitor and the
volume operation procedures which can cause the volume
server to crash.

Add a per transaction object mutex to safely set the
transaction call pointer and name. Fix VolMonitor to safely
traverse the transaction list and to access the call pointer
and last proc name while copying info to send to the vos
client.  Fix the sleep thread to safely access the last proc
name.

FIXES 125479

Change-Id: I59595b93522d111b6a771d3d93c246bfc2ce65de
Reviewed-on: http://gerrit.openafs.org/718
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-23 13:48:26 -07:00
Simon Wilkinson
b9eaf43bbe Don't cast the pointer past to memset
memset() takes a void * as it's first argument. Don't explicitly cast
what we're passing in to (char *), as this may mask other errors.

Reviewed-on: http://gerrit.openafs.org/701
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-21 11:34:12 -07:00
Andrew Deason
c9dc69afae Log error messages in volser i/o errors
Currently, in various places in src/volser/, we log/print an error
message when some disk i/o error occurs, but we don't log what error was
returned. Log that little bit more info to make debugging easier in some
cases.

Reviewed-on: http://gerrit.openafs.org/671
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-18 07:32:19 -07:00
Simon Wilkinson
3064879c8d Update warning management
This change tidies up after the recent slew of warning reduction. It
updates README.WARNINGS to reflect the current state of the tree,
disables warnings for a couple of files that are now warning clean,
and ensures that the libuafs and libafsrpc Makefiles match the state
of the rest of the tree in terms of which warnings are enabled.

Reviewed-on: http://gerrit.openafs.org/672
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-18 06:13:58 -07:00
Derrick Brashear
50313a72a9 snowleopard 64 bit warning death
make all errors from warnings when compiling on snowleopard die

as a note, the ukernel pid, and pthread self as id changes, probably
should be revisited, but for now i have changed nothing. it should
be a separate change.

Reviewed-on: http://gerrit.openafs.org/666
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-16 05:54:46 -07:00
Simon Wilkinson
2588289987 Fix checked builds with gcc4.2
Recent change sets removed the 'ignore-all-warnings' mode from a
number of files, in favour of using the implicit-function-declaration
pragma. Sadly, that pragma isn't available in gcc 4.2. Revert the
Makefile changes such that ignore all warnings is turned back on
for the affected files, and note this in README.WARNINGS

Reviewed-on: http://gerrit.openafs.org/639
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-14 17:09:26 -07:00
Jeffrey Altman
5a403db74e Windows: fix build due to broken src/volser/NTMakefile
Commit 82aa5b4e09 incorrectly
updated the src/volser/NTMakefile resulting in a broken
build system.

Reviewed-on: http://gerrit.openafs.org/658
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-14 05:09:01 -07:00
Jeffrey Altman
664e5aca16 Windows: If SecurityLevel is configured use it for vos.exe and pts.exe
If the SecurityLevel registry value indicates that crypt should be
the default, then always set -encrypt for vos.exe and pts.exe.

Reviewed-on: http://gerrit.openafs.org/648
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-13 12:00:10 -07:00
Simon Wilkinson
82aa5b4e09 Add public protoypes for volser
Add a new public header file volser_prototypes.h, which contains
prototypes for those volser functions that are used by the rest of the
tree, and link it into the Unix and Windows build systems.

Rename the current volser_prototypes.h volser_internal.h, and update
references to it.

Make those places that should use the new public header use it, and
re-enable warnings-as-errors as appropriate.

Remove the warning free files from the list in README.WARNINGS

Add butm_prototypes.h to butc/lwps.c, so we can enable warnings for that,
too.

Reviewed-on: http://gerrit.openafs.org/636
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-13 05:33:46 -07:00
Andrew Deason
8314001bdb Reduce warnings in vos.c
Squash a few miscellaneous that appear when building vos.c:

 -- CreateVolume should use util_GetUInt32 to parse vol ids, since they
    are now unsigned

 -- The m_uuid argument of print_addrs is altered, so do not declare it
    const

 -- Declare the confDir argument of ugen/vsu_ClientInit to be const,
    since it does not change, and vos.c passes a const confDir in
    MyBeforeProc

 -- Ignore implicit function declaration warnings and remove
    CFLAGS_NOERROR from the vos.c build, since the only remaining
    warning is an implicit function declaration

Reviewed-on: http://gerrit.openafs.org/602
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 08:01:05 -07:00
Andrew Deason
db949b7fad Correct and use AFS_SIZET_FMT
On *nix, a size_t needs either %lu or %u to be interpolated in a string,
depending on if we're on an ILP32 arch or not. Define AFS_SIZET_FMT
accordingly, and actually use AFS_SIZET_FMT when we try to print a
size_t.

This removes numerous -Wformat warnings, at least when building on
i386_linux26.

Reviewed-on: http://gerrit.openafs.org/592
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-07 20:09:30 -07:00
Andrew Deason
d88c03492d DAFS: Avoid volserver segfault in GetVolInfo
It is possible for GetVolObject to return success, but result in a NULL
fs_tv. In particular, when the fileserver responds with FSYNC_WRONG_PART
or FSYNC_UNKNOWN_VOLID. It is possible, though difficult, for the
fileserver to respond with FSYNC_UNKNOWN_VOLID if the requested volume
hasn't been preattached on the fileserver yet.

So, in GetVolInfo, also check fs_tv, so we don't try to dereference it
later.

Reviewed-on: http://gerrit.openafs.org/562
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-30 15:08:12 -07:00
Simon Wilkinson
f5c55d23a2 Demand attach warning fixes
Fix a whole host of warnings in the demand attach code.

Make a broken tvolser build stop the build, rather than carrying on
regardless.

Reviewed-on: http://gerrit.openafs.org/551
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-29 12:11:37 -07:00
Simon Wilkinson
4f65bec3fc Fix warnings in new dumptag code
3f2dd80697 contained a number of
new warnings. This patch fixes them.

It also adds the AFS_UNUSED_FUNCTION macro which can be used to
portably mark functions as unused.

Reviewed-on: http://gerrit.openafs.org/543
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 07:52:35 -07:00
Simon Wilkinson
6d51ebd6c8 Add support for warning checked builds
This patch adds a '--enable-checking' configuration option. When this
option is supplied, and gcc is in use, the compiler will treat any
warnings as errors. This will hopefully help stop new warnings from
creeping into the tree.

In order to still be able to build, all of the currently existing
warnings are accepted (these are documented in README.WARNINGS). With
this set of warning inhibitions, the tree is known to build on 32bit
Leopard - other systems may vary. Warning inhibition may be disabled
by supplying --enable-checking=all - in this case the tree will
definitely not build!

If --enabled-checking is not specified, the existing compilation
behaviour is maintained, so there is no user-visible change.

Gcc 4.2, or later, is required to use the pragma sets contained within
this patch. Again, they are not visible unless --enable-checking is
given.

Reviewed-on: http://gerrit.openafs.org/526
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 05:00:04 -07:00
Hartmut Reuter
3f2dd80697 Implementation of new dump tag and length standard
The implementation follows the specification from October 2007.

All old tags are accecpted as before.
New tags 0x06-0x60 (capital letters) are followed by a 1 byte length
field which may contain directly the length (up to 127) or the length
of the then following length field (max 8) ored with 0x80.
New tags 0x61-0x77a are directly followed by 4 bytes building a 32bit
integer.
0x7b-0xf are single-byte tags, 0x7e meaning next tag is critical.

On this basis unknown tags can be skipped unless they were marked
critical. In this case the restore is aborted.

in dump.h tags following the new standard are marked by an asterisk

Last update: added parameter types for HandleUnknownTag.

Reviewed-on: http://gerrit.openafs.org/191
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 02:59:14 -07:00
Marc Dionne
d7b00d5f19 Use intptr_t and uintptr_t for integer/pointer conversions
Use intptr_t and uintptr_t casts to appease the compiler when
values are converted between 32-bit integers and pointers.
This generates many warnings (currently ~170 on linux amd64)
when pointers are 64-bit.

These types are normally defined in stdint.h, and get defined
by autoconf if that's not the case.

In a few places, NULL is simply replaced with 0 where compared
with an integer.

Reviewed-on: http://gerrit.openafs.org/474
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 02:40:48 -07:00
Russ Allbery
d6df1a8cec Move restorevol to bin from sbin
restorevol only requires access to a dump file and write access to the
directory in which the dump is being unpacked.  It doesn't require being
a superuser, so it should be installed in bin instead of sbin.  Also
move the man page to section 1 and update references accordingly.

Reviewed-on: http://gerrit.openafs.org/333
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-09-09 21:22:34 -07:00
Marc Dionne
12a7afa648 Remove extraneous + character in src/volser/common.c
Remove an unneeded extra + character at the end of line - probably
from a typing accident.

This generates a warning at compile time.

Reviewed-on: http://gerrit.openafs.org/437
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-09 16:02:28 -07:00
Christof Hanke
3e28e72e40 Remove unnecessary type ViceFid
The type "ViceFid" is just a clone of the type AFSFid and used only in a couple of places.
Thus, for simplicity, rename all occurences of ViceFid to AFSFid and remove the
typedef itself.

Reviewed-on: http://gerrit.openafs.org/383
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-01 02:27:39 -07:00
Jeffrey Altman
1c12747818 Windows: Permit build system to update symbol store
Microsoft Debugging Tools for Windows, Visual Studio Debugger,
and SysInternals tools can all make use of a Symbol Server.
  http://msdn.microsoft.com/en-us/magazine/cc163563.aspx
The commit adds functionality to the build system to automatically
add binaries and symbols to a symbol store during the build.
This functionality is only enabled if two environment variables
are defined:

  SYMSTORE_EXE  - specifies the location of symstore.exe
  SYMSTORE_ROOT - specifies the location of the symbol store

an optional environment variable permits an arbitrary comment
to be added to the symbol store history file.

  SYMSTORE_COMMENT - arbitrary text to be added to the history

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/324
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2009-08-19 10:19:43 -07:00