Commit Graph

8837 Commits

Author SHA1 Message Date
Derrick Brashear
03edae9cc5 libafscp: fix kerberos bits
get the correct afs principal. this entire blob will go away
and be replaced by rxgk token getting, but deal for now.

Change-Id: I8e63a5de74efa6c2eeec4c67b4d14d1f69396e41
Reviewed-on: http://gerrit.openafs.org/4475
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-17 05:05:03 -07:00
Simon Wilkinson
9bf314d90a libafs: Remove afs_write duplication
The afs_write() code for memory and disk cache suffered from exactly
the same duplication problems as the afs_read() code.

Apply a similar fix - unify afs_UFSWrite and afs_MemWrite into a single
afs_write function, place the UFS specific code into afs_UFSWriteUIO,
and make use of the existing afs_MemWriteUIO for the memcache case.

Change-Id: I074e1f56597e5cf04d13a45bcda5ad5fedb6377f
Reviewed-on: http://gerrit.openafs.org/4465
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-16 13:49:57 -07:00
Derrick Brashear
25a46780fc libafscp fixes
fix callback package in libafscp to track addresses correctly (use
correct byte order)

Change-Id: I58207492389869591e38e582f332c910cd53f169
Reviewed-on: http://gerrit.openafs.org/4474
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-16 13:27:42 -07:00
Chaz Chandler
94d44d59e3 afsio: rewrite using libafscp
afsio is a utility for file transfer to and from AFS file space
without the help of the AFS client/cache manager.  Using libafscp,
this (partially rewritten) version of afsio is able to accomplish
(1) authenticated access to an AFS path or FID (an existing
KerberosV ticket is required), (2) fall back on unauthenticated
("anonymous") access if authentication (token acquisition) fails,
and (3) work independtly of the AFS cache manager (afsd need not
be running, though CellServDB and ThisCell are currently required).

issues:
1) libvldbint and libafsint are not compiled pthreaded. we link in
what we need. this should be changed when we are all-pthreaded.
2) venus is not a pthreaded-directory otherwise. same deal:
in an all-pthreaded universe, undo the bodge that we do here.
3) venus is not an all-krb5 directory either. slight ick.

Change-Id: I946e6eef58ac77c6fb97be256c4c564188201262
Reviewed-on: http://gerrit.openafs.org/4381
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-16 13:27:29 -07:00
Andrew Deason
44f13d8feb RX: Remove allocation counters
Remove the osi_alloccnt and osi_allocsize counters, and the associated
osi_alloc_mutex. These counters are pretty useless since nothing looks
at them, and their use of a mutex requires Rx to be initialized before
XDR can be used. Removing them lifts this restriction.

Change-Id: I22fa1335b6d34675d37cca41a2c393b9c20d3d24
Reviewed-on: http://gerrit.openafs.org/4478
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-15 15:07:22 -07:00
Andrew Deason
21578144e0 Suppress cmp component version error messages
When we use cmp to determine whether to replace
AFS_component_version_number.c, suppress stderr in addition to stdout,
to slightly reduce output during the build.

Change-Id: I4f687ce5ffff316d8f9806181bccf1c28d218932
Reviewed-on: http://gerrit.openafs.org/4471
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-15 14:37:33 -07:00
Andrew Deason
27d08416af AIX51: Fix PAGs
On AIX 5.1 and later, we set a process' PAG by using the AIX PAG
mechanism (and not by group ids), but we were determining what PAG a
process was in by the group list. Instead use the PAG identifier.

This effectively reverts 277c37f48c, but
it puts the kcred_getpag call in a different place that makes more
sense in the current PAG code organization.

Change-Id: If9fe621060a06664718a00acff91dea66760d5c2
Reviewed-on: http://gerrit.openafs.org/4479
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-15 14:28:54 -07:00
Andrew Deason
6c0d77b905 tsm41: Reformat function definitions
Make function definitions consistent with the formatting in the rest
of the tree.

Change-Id: Ifbccc02739f6fbc111e061397538a903b6f2289a
Reviewed-on: http://gerrit.openafs.org/4477
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-15 14:23:56 -07:00
Andrew Deason
78d1f8d883 pam: Use PAM_CONST more often
Some callers of pam_get_item et al were just casting their argument to
a const void **. Some PAM implementations (Linux) want a const void**,
but others (Solaris) do not. Use the PAM_CONST symbol already defined
by autoconf to declare or cast the relevant variable const or not as
appropriate.

Change-Id: I81c7863797396eb146b78ffbb2586e4f3a1e854e
Reviewed-on: http://gerrit.openafs.org/4470
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-15 10:13:17 -07:00
Andrew Deason
fbb4c6115b pam: Check for null upwd from getpwnam_r
The POSIX getpwnam_r can yield a NULL struct passwd pointer even when
the returned error code is 0 (in particular, when the requested entry
is not found). Just add a check for a null upwd to make sure we don't
dereference a NULL pointer.

Change-Id: I00e8d6c53e8228f468c984010695b798f5dcf999
Reviewed-on: http://gerrit.openafs.org/4469
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-15 10:13:01 -07:00
Andrew Deason
a7d4fbd36a pam: Use POSIX getpwnam_r on Solaris
_POSIX_PTHREAD_SEMANTICS is now always defined for Solaris, which
means we get a POSIX-conforming getpwnam_r, which takes 5 arguments.
So, add Solaris to the list of platforms that use a POSIX getpwnam_r.

Change-Id: I1ad12420f56cf39816d94a8e9c9740436100134b
Reviewed-on: http://gerrit.openafs.org/4468
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-15 10:12:06 -07:00
Andrew Deason
f26f7ed226 vfsck: Fix roken fallout
Including roken.h in vfsck sources pulls in some more modern headers
that vfsck code isn't used to. Accommodate:

 - Prevent roken.h from pulling in dirent.h so we don't conflict with
   the old-style directory defines for HP-UX. Also move the inclusion
   of the old-style directory defines to before roken.h, so we have
   the directory types defined in roken.h.

 - Remove some prototypes so the don't conflict with the prototypes in
   system headers.

 - Remove a couple of bizarre vprintf invocations, as they conflict
   with the actual vprintf definitions.

Change-Id: Ifd7cd2544e75ed49b93ab491c4acadcb18528315
Reviewed-on: http://gerrit.openafs.org/4472
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-15 10:11:15 -07:00
Derrick Brashear
f4776f0a4d kernel upcall rx env should shut down event daemon
also shut down event daemon in upcall environment

Change-Id: Ifd40754fc34bc8ea6f844867d1775a8b8b7a5044
Reviewed-on: http://gerrit.openafs.org/4473
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-04-15 09:37:45 -07:00
Andrew Deason
80df5096e7 Fix some configure header prereqs
On at least Solaris, the configure tests for netinet/if_ether.h and
security/pam_modules.h issued warnings because they existed but were
not compilable. Perform the tests with the prerequisite headers of
net/if.h and security/pam_appl.h, respectively, so autoconf will stop
yelling at us.

Change-Id: I05d637784954c10af468b6065acd78139fc45245
Reviewed-on: http://gerrit.openafs.org/4467
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-13 11:04:22 -07:00
Andrew Deason
8180f9abbf RX: Include sys/file.h for rx_lwp.c
rx_lwp.c uses FNDELAY, which requires sys/file.h on at least Solaris.
So, include it.

Change-Id: Ida652a3c9bfccb120a67f0c5d4f71537a11fa00f
Reviewed-on: http://gerrit.openafs.org/4466
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-13 10:50:15 -07:00
Jeffrey Altman
340a2c639a asetkey: permit des-cbc-md5 and des-cbc-md4 keys
A DES key is a DES key.  Permit importing CRC, MD5 and MD4
when using non-MIT keytab support.

Add a special error message that specifies what principal
name, kvno, and enctype were being searched for when the
error is KRB5_KT_NOTFOUND.

Change-Id: I7d3b5fbc41db5e5e91278854ce52842720e6b5d3
Reviewed-on: http://gerrit.openafs.org/4458
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-13 10:03:27 -07:00
Simon Wilkinson
e56b1f79b9 libafs: Remove unecessary parameters to afs_read
We were providing additional buffer and length parameters to
afs_read which are now unused, as the necessary information is
contained within the iovec. Just remove these parameters to tidy the
code up a bit.

Change-Id: I2ca80b20e253e0d54be759e6d504961958b40e6e
Reviewed-on: http://gerrit.openafs.org/4464
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-13 10:02:37 -07:00
Simon Wilkinson
fd620283a9 libafs: Remove afs_read duplication
The disk cache and memcache afs_read functions are effectively
duplicates of each other. Abstract out the common code into a generic
afs_read() function, and put the cache type specific code into
UFSReadUIO (there is already a MemReadUIO which contains the code
necessary for the memcache).

Change-Id: Ic66242fa4695a146ac874a82bd48a7c1f1f412a6
Reviewed-on: http://gerrit.openafs.org/4463
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-13 10:02:01 -07:00
Simon Wilkinson
763ec5250d fs: Abstract out code to get the last component
fs.c contained two identical copies of code to parse a path, resolve
any symbolic links in that path, and return the directory and basename.

Abstract this code out into a single function, rather than maintaining
two separate copies of it.

Change-Id: Id9fc835506f90bae2fc1f0db18c640bf28f0d39d
Reviewed-on: http://gerrit.openafs.org/4462
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-13 10:01:51 -07:00
Simon Wilkinson
b5bd42efb6 libuafs: Add afsd symlink to the clean rules
The libuafs Makefile creates a link to afsd in the libuafs build
directory. So, have the clean rule tidy it up after us.

Change-Id: I24a3be34bc04dfa7c9db9be2ace4ab32f3f5d5f7
Reviewed-on: http://gerrit.openafs.org/4461
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-12 15:52:13 -07:00
Simon Wilkinson
b59da7674e viced: Remove logging duplication
In lots of places in the fileserver we were doing
    ViceLog(0, (x))
    osi_Panic(x)

Remove this duplication by creating a new macro, ViceLogThenPanic,
which does both of these in one fell swoop.

Change-Id: Icea349d60298eba1cca4a45db790f21ba3e7b3c7
Reviewed-on: http://gerrit.openafs.org/4455
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-04-12 15:51:56 -07:00
Ken Dreyer
d5ded9afa1 fix manpage for udebug -servers
The proper option to udebug is "-server", not "-servers". Fix the manpage to line up with the binary.

Change-Id: I3ec83c028dcefb827bd05666401e4a667e29fb6a
Reviewed-on: http://gerrit.openafs.org/4457
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-11 17:44:09 -07:00
Jeffrey Altman
81e77fa923 roken: export tsearch, tdelete, tfind on windows
Change-Id: Ic862b65a8c1b37bc3ca3da8db77ba76fe8879296
Reviewed-on: http://gerrit.openafs.org/4456
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-11 08:23:42 -07:00
Derrick Brashear
d534981073 afscp: build for windows
attempt windows support for afscp

Change-Id: I61cb1349466f24558b320bc40e3fae42ce654810
Reviewed-on: http://gerrit.openafs.org/4424
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-11 08:23:07 -07:00
Andrew Deason
de0c72bf7c DAFS: Request salvage on detach for volser
When the volserver notices that a volume needs salvaging, mark
V_needsSalvaged. So when we VDetachVolume the volume, we can then just
request the salvage in the volume package.

Fix the VolClone salvaging code to do this as well, instead of using
the vol-private VRequestSalvage_r interface.

Change-Id: I9d48e4ea18fe4e3e2e1dc38593db4beb5ad79a84
Reviewed-on: http://gerrit.openafs.org/4452
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-10 20:50:40 -07:00
Andrew Deason
399655e3df volser: Avoid assert on ViceCreateRoot failure
If IH_CREATE fails in ViceCreateRoot, it may just be due to an on-disk
inconsistency. So, don't assert, but just return an error and detach
the volume.

Change-Id: I8acacff8c858b0d27234265fee5d7b49ebab5101
Reviewed-on: http://gerrit.openafs.org/4444
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-10 20:49:41 -07:00
Andrew Deason
316b0421a2 DAFS: Do not give back vol to viced after salvage
If we VRequestSalvage_r a volume successfully, and we are not the
fileserver, we will tell the fileserver to salvage a volume. So, we do
not need to give back the volume afterwards, since telling the
fileserver that a volume needs a salvage effectively gives it back (so
the salvager can take it).

So, clear needsPutBack so we don't try to also give back the volume,
and avoid the fileserver yelling at us for trying to give back a
volume that is checked out by someone else (or is not checked out at
all).

Change-Id: I168bcf7fe6dbc186064cdf38de1ddb287a26eff3
Reviewed-on: http://gerrit.openafs.org/4445
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-10 20:49:21 -07:00
Derrick Brashear
81c2416d8e add tsearch to Windows
roken now has tsearch for windows. add it.

Change-Id: I73f609d6285f52bb2b52f580b95ca4510204efa1
Reviewed-on: http://gerrit.openafs.org/4451
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-10 20:48:13 -07:00
Heimdal Developers
83bce75472 Import of code from heimdal
This commit updates the code imported from heimdal to
988355d9d0d1953e8c17c4b5c935938573efe4ba (switch-from-svn-to-git-2070-g988355d)

Upstream changes are:

Derrick Brashear (1):
      roken: Make tsearch build on windows

Change-Id: Ic0292c8cc7283c07ae56040c8e80b9b2cc99801f
Reviewed-on: http://gerrit.openafs.org/4454
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-04-10 20:47:57 -07:00
Andrew Deason
b3b0c67808 XDR: decouple from system XDR implementation
Since commit 7293ddf325 we have stopped
trying to use the system-provided XDR implementation, but the xdr_ops
structure was still structured to accomodate for the old limitations
of the system XDR. Change xdr_ops so it is just always one consistent
structure.

This removes:

 - The AFS_XDR_64BITOPS define and all related code, since we never
   call the 64-bit versions of getint and putint ourselves

 - The rearrangement of getint32/putint32 depending if we are in
   Solaris kernel-land or not

 - The .x_control field

Change-Id: I59b7579da1ea728eaba6b426011adbe4f7a331b6
Reviewed-on: http://gerrit.openafs.org/2503
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-10 06:15:21 -07:00
Simon Wilkinson
da3921e7c7 ptserver: Add cmdline options for config and log
Make it possible to set the location of the ptserver's configuration
directory, and the file that it logs to, from the command line. This
makes it possible to bring up a ptserver without requiring an
installation on the system for testing purposes.

Change-Id: I914eb842256eb74506490fcf5532b4138e6f3875
Reviewed-on: http://gerrit.openafs.org/4447
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-10 06:14:23 -07:00
Heimdal Developers
20f2f23be6 Import of code from heimdal
This commit updates the code imported from heimdal to
2a32bf67f0a7c77b6adf6e7c23ec8abe7937a9ea (switch-from-svn-to-git-2067-g2a32bf6)

Upstream changes are:

Derrick Brashear (1):
      Add tsearch and friends, and a test program

New files are:
	roken/search.hin
	roken/tsearch.c

Change-Id: Ie7ddb2da595797ca354e36776ce813a03b3d462c
Reviewed-on: http://gerrit.openafs.org/4453
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-04-10 06:14:00 -07:00
Derrick Brashear
7a9aeaee11 Import tsearch.c from roken
Add tsearch.c (and search.hin) to the files we import from heimdal

Change-Id: I6a7062b35177c6ecd4f78ae15d56d73600866d50
Reviewed-on: http://gerrit.openafs.org/4449
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-10 06:12:57 -07:00
Simon Wilkinson
470e3f06d4 tests: Remove spurious rxgk reference
A reference to the rxgk library crept into auth Makefile ahead of
time. Remove it so that tests can continue to work in trees without
rxgk.

Change-Id: Ic1392aebf657d458a55f2dcf685d0616f0573622
Reviewed-on: http://gerrit.openafs.org/4446
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-09 06:51:04 -07:00
Andrew Deason
325443e617 afsd: Trim trailing slashes on Linux mntent
When we write a mount entry on Linux when mounting /afs, trim trailing
slashes on the mount path. Otherwise, the umount utility can get
slightly confused, and leave the /afs mount entry in /etc/mtab after
it's been unmounted.

For full correctness we should probably completely canonicalize the
path like the mount utility does, but it's unlikely that anyone will
provide significantly weird paths for cacheMountDir, so don't bother.

Change-Id: Ie8330f08918d52eee319dff5f6ad275c30164c67
Reviewed-on: http://gerrit.openafs.org/4442
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-08 06:09:54 -07:00
Simon Wilkinson
f1e04bedb2 Windows: Use roken gettimeofday implementation
Use the gettimeofday implementation from roken, rather than brewing
our own on Windows.

Change-Id: I02fc1a7f0f6aded2e16e2ed53e04054546fc0535
Reviewed-on: http://gerrit.openafs.org/4433
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-04-08 05:21:12 -07:00
Heimdal Developers
21ed5186ae Import of code from heimdal
This commit updates the code imported from heimdal to
a597ccdde692709ab387cde21518f09eb501c5a1 (switch-from-svn-to-git-2063-ga597ccd)

Upstream changes are:

Simon Wilkinson (1):
      roken: Rename gettimeofday replacement

Change-Id: I1e1ec03d9ab1953c50a5ef47a6f3feb0db150f49
Reviewed-on: http://gerrit.openafs.org/4443
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-04-08 05:20:53 -07:00
Simon Wilkinson
222f8a5ea2 vlserver: Add options for config, log and db
Make it possible to set the location of the vlserver's configuration
directory, database file, and the file that it logs to, from the
command line. This makes it possible to bring up a vlserver without
requiring an installation on the system for testing purposes.

Change-Id: I0a3fcc4fd10274588c1530f8b4f3e9782084c58c
Reviewed-on: http://gerrit.openafs.org/4440
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-04-07 21:51:29 -07:00
Andrew Deason
f2ec107823 salvager: Do not AskDelete on GetInodeSummary fail
GetInodeSummary can fail due to a number of different reasons, not
just because the VG doesn't exist. If, for example, we just fail to
write the temporary inode file, we will return with an error, but we
should not AskDelete the volume in that instance.

GetInodeSummary already has code to delete the volumes in question
when no inodes are found, so remove the extra AskDelete after
GetInodeSummary returns.

Change-Id: I5df7a3ffed962b62409adbedfa1c1a0445dad2f8
Reviewed-on: http://gerrit.openafs.org/4438
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-06 08:20:16 -07:00
Andrew Deason
8084fc28a3 salvager: Error volumes on GetInodeSummary errors
When GetInodeSummary fails due to an internal failure (not from just
failing to find applicable inodes), currently it just returns an
error, and does not return the checked-out singleVolumeNumber back to
the fileserver.

When we fail to gather inodes, we should force the volume to an error
state, since we haven't salvaged the volume. But if we fail to find
any applicable inodes, we just want to VOL_DONE the volume, since the
header has possibly been destroyed, and the volume doesn't exist.

So, issue an FSYNC_VOL_FORCE_ERROR command when we encounter errors in
GetInodeSummary, except when we fail to find applicable inodes.

Change-Id: I4aed126ec09c4b93cfd8572abeba3d22bff0e6a5
Reviewed-on: http://gerrit.openafs.org/4439
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-06 08:20:00 -07:00
Marc Dionne
0b510fe30a ubik: don't rely on timeout value after select()
The value of timeout after a select() call should be considered
undefined; relying on its value is not portable.
Since IOMGR_Select doesn't modify the timeout it is given, the
intention of the code seems to be to wait for gradually increasing
timeout values, starting at 50ms.  At least under Linux, the
timeout gets set to 0 by select() if it waited for the full specified
time, resulting in a much shorter maximum possible wait period.

Initialize the timeout value for each loop according to the existing
logic, to get consistent behaviour between the lwp and pthreaded code.

Change-Id: I8d3e90fe4e94a378401dd0a6fb7d77266ec09e5a
Reviewed-on: http://gerrit.openafs.org/4441
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-06 08:16:54 -07:00
Rainer Toebbicke
843d705ca6 Atomically collect callbacks to be broken
Collect callbacks to be broken in one go, otherwise a file server may
lock out a client while new callbacks tickle in.

With revised multi_Rx, responses get handled early, taking away an argument for
issuing callbacks in small chunks -> crank up chunk size.

Change-Id: I6822256715d1388aa1a44049315813ea08009105
Reviewed-on: http://gerrit.openafs.org/3909
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-04-06 05:24:15 -07:00
Andrew Deason
2386f5741d Correct strftime callers
Some strftime callers were not using the resultant string
appropriately. Correct them to have the same behavior as when we were
using afs_ctime (which included a trailing newline).

Change-Id: I1d23a6a06460cae3d2a253c9f084c22324fc7542
Reviewed-on: http://gerrit.openafs.org/4437
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-05 13:38:49 -07:00
Marc Dionne
23984368f5 ubik: take DB lock in ubik_GetVersion
The lock is needed to copy the database version.
Note that this function is currently unused in OpenAFS.

Change-Id: I7938db18a6739d2a15ab27331dbf5945839127fc
Reviewed-on: http://gerrit.openafs.org/4264
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-05 11:24:46 -07:00
Marc Dionne
5ac037294e ubik: DB lock usage in ubik_Flush and ubik_Write
ubik_Flush and ubik_Write need to hold the DB lock to use iovec_info
or iovec_data

Change-Id: Iadc1ff0badc744aa5fdee433bb4b591217e4b453
Reviewed-on: http://gerrit.openafs.org/4263
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-05 11:24:02 -07:00
Marc Dionne
5548f65405 ubik: SVOTE_Beacon should hold the DB lock for CheckTid
Change-Id: Iab51bf4aea704870813a4f4c082110ed7cd1eb04
Reviewed-on: http://gerrit.openafs.org/4262
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-04-05 11:23:31 -07:00
Marc Dionne
1e2a0e46ea ubik: Document lock ordering
Document the required lock ordering for the new locks.
The text is adapated from Jeffrey Hutzelman's notes.

Change-Id: I72d0578f456eab133f36e00a3e99051b9a733020
Reviewed-on: http://gerrit.openafs.org/4174
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-05 11:22:08 -07:00
Marc Dionne
e4ac552ab7 ubik: Introduce version lock
The "version" lock is a new lock that protects the database version
information.  The goal is to allow the beacon thread to use the
protected values without blocking for an extended period of time,
which could occur if it was using the database lock.

Reading requires holding either lock, while writing requires holding
both locks.

The following values are protected:
	ubik_epochTime
	db->version
	db->flags
	db->tidCounter
	db->writeTidCounter

Based on analysis and design work from Jeffrey Hutzelman.

Change-Id: Ib6e67360807eed8c36e35ec27d1eb938ac899e22
Reviewed-on: http://gerrit.openafs.org/4158
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-05 11:21:45 -07:00
Marc Dionne
5ceea5bbc6 ubik: Introduce new address lock
Introduce a new lock to protect:
	ubik_server->addr[]
	ubik_server->disk_rxcid
	ubik_server->vote_rxcid
	ubikSecClass
	ubikSecIndex

Globals are put into a new addr_data structure along with the lock.

Based on analysis and design work from Jeffrey Hutzelman.

Change-Id: I33ef58a36e87a3925b310052f83bb3c6dd60d785
Reviewed-on: http://gerrit.openafs.org/4157
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-05 11:21:31 -07:00
Marc Dionne
2385d26293 ubik: Introduce new vote lock
Introduce a new lock to protect ubik data related to voting.
Specifically, it protects the following globals:
	ubik_lastYesTime
	lastYesHost
	lastYesClaim
	lastYesState
	lowestHost
	lowestTime
	syncHost
	syncTime
	ubik_dbVersion
	ubik_dbTid

Variables are grouped along with the lock in a new structure.

Also introduce a few helper functions to safely deal with ubik_dbVersion:
uvote_eq_dbVersion: Return true if the passed version is equal to the
current ubik_dbVersion
uvote_set_dbVersion: Set ubik_dbVersion to a specified value

Change-Id: I9bb248d0dfedc363181661ea723cac0af4928644
Reviewed-on: http://gerrit.openafs.org/4156
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-05 11:20:07 -07:00