Andrew Deason [Mon, 28 Jun 2010 15:43:55 +0000 (10:43 -0500)]
LINUX24: remove pagecopy and other 2.6-only code
The client background readahead code and 'readpages' implementation
were only written for 2.6 kernels and used 2.6-specific constructs.
Remove them, along with references to the 'pagecopy' code, and some
other 2.6-only cruft in osi_vnodeops.c.
Andrew Deason [Mon, 28 Jun 2010 16:17:50 +0000 (11:17 -0500)]
LINUX24: Remove BDI references
afs_backing_dev_info was still referenced in a couple of places in the
LINUX24 code. Although they are properly ifdef-guarded, these lines
were never getting built, so remove them.
Andrew Deason [Mon, 28 Jun 2010 15:33:38 +0000 (10:33 -0500)]
LINUX24: Remove group_info macros/functions
The LINUX24 code has a macro and a function abstracting
'struct group_info' access. But 'struct group_info' does not exist in
2.4, and nothing calls these, so get rid of them.
Rod Widdowson [Wed, 26 May 2010 15:18:26 +0000 (16:18 +0100)]
Make file offsets in vldb layout unsigned ints
vlserver.h has a few cases where links through the vldb are being
stored as afs_int32s. These are file offsets and should be unsigned.
This commit fixes just these declarations. The code still compiles
(because they are silently cast all over the shop), but it starts
the tidy effort.
Andrew Deason [Fri, 25 Jun 2010 18:52:16 +0000 (13:52 -0500)]
Use unsigned IP addresses in bu*
Use unsigned IP addresss in bubasics, bucoord, and butc code. This
alters the public tcdata.p.h, but stays away from wire RPCs or
variables used directly with those RPCs.
Marc Dionne [Fri, 25 Jun 2010 23:33:51 +0000 (19:33 -0400)]
Linux: remove some 2.6 specific code from 2.4
Remove some code that will never be compiled or used in the
afs/LINUX24 directory.
This includes code depending on AFS_LINUX26_ENV, and on
LINUX_USE_FH which is never set in 2.4 and is going away
soon anyway.
Simon Wilkinson [Sat, 26 Jun 2010 14:55:29 +0000 (15:55 +0100)]
RPM Packaging: All debug kernels are bad
We can't build against any of the recent Fedora debug kernels, because
they have options enabled that make criticial symbols GPL-only. Just
skip all debug kernel variants, rather than having to explicitly list
each new Fedora release as it comes out.
Andrew Deason [Fri, 25 Jun 2010 16:38:37 +0000 (11:38 -0500)]
ptserver: Remove IP_WILDCARDS symbol
ptserver defined the symbol IP_WILDCARDS to enable the use of
wildcarding in machine entries. It is always enabled, so just remove
the symbol and always use the wildcard code.
Andrew Deason [Fri, 25 Jun 2010 14:48:38 +0000 (09:48 -0500)]
rx: Use unsigned addresses
RX sometimes uses afs_int32 to represent IP addresses; make it use
afs_uint32. This alters some structures in rx.h and some prototypes in
rx_prototypes.h.
Andrew Deason [Thu, 24 Jun 2010 15:19:21 +0000 (10:19 -0500)]
volser: Use unsigned addresses and volume IDs
Fix code and header files in src/volser that use afs_int32 for server
IP addresses instead of afs_uint32 (the worst offenders being UV_*
functions). Also fix an instance of afs_int32 being used for a volume
ID, and remove 'struct volser_dest' instead of fixing it, since it is
completely unused.
Simon Wilkinson [Thu, 24 Jun 2010 15:00:22 +0000 (16:00 +0100)]
Linux: Check return code from VerifyVCache in mmap
afs_linux_mmap wasn't doing anything with the return code
from afs_linux_VerifyVCache. Change the code so that it matches
the other callers of afs_linux_VerifyVCache
Andrew Deason [Wed, 23 Jun 2010 22:42:30 +0000 (17:42 -0500)]
Remove stale warning suppressions
butc/dump.c and ubik/beacon.c have had their warnings fixed and their
suppressions removed. Remove the warning suppression for tbutc/dump.c
and tubik/beacon.c, as well.
Jeffrey Altman [Wed, 23 Jun 2010 16:56:17 +0000 (12:56 -0400)]
Windows: Cleanup of src/config/NTMakefile
src/config/NTMakefile had the following issues:
* duplicate entries for headers in $(INCFILES)
* no clean: rule for $(INCFILES)
* no clean: rule for $(DESTDIR)\util_cr.exe
* $(INCTOOLS) dependent upon $(INCFILES) but the order is reversed
in the install: rule
Change-Id: I2707009d60b303ab897ed25d9245d893fa342a8e
Reviewed-on: http://gerrit.openafs.org/2238 Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Tested-by: Jeffrey Altman <jaltman@openafs.org> Reviewed-by: Matt Benjamin <matt@linuxbox.com> Tested-by: Matt Benjamin <matt@linuxbox.com>
Matt Benjamin [Wed, 23 Jun 2010 14:26:12 +0000 (10:26 -0400)]
windows don't include assert.h (and afs support headers) in util_cr.c
Don't include afsconfig.h and afs/param.h in util_cr.c, nor
assert.h. The assert was included but was in fact not used in
the file, and can be ommitted, per jaltman. The OpenAFS
includes are then not needed. An incorrect cast is also changed,
due to jaltman.
Ben Kaduk [Fri, 18 Jun 2010 04:05:14 +0000 (00:05 -0400)]
Try to flush vnodes in FBSD's unmount, bailing if necessary
vflush() actually returns something! Check if we get EBUSY,
and don't continue if so. Also, actually call vflush on FBSD80_ENV.
Note that we currently leak refs on our root vnode, so this means
umount will fail unless it uses -f, for now.
Rainer Toebbicke [Mon, 21 Jun 2010 10:02:46 +0000 (12:02 +0200)]
Don't hold on to the afs_xvcache lock while creating a symlink
Holding the afs_xvcache lock over the RPC while creating a symlink is a
severe blow to performance as look-ups from other tasks likely
require the lock. Drop the lock and rely solely on the fileserver
to detect a clash with a same entry created simultaneously.
Andrew Deason [Wed, 23 Jun 2010 15:13:39 +0000 (10:13 -0500)]
vldb_check: Interpret VLOP_* vlentry flags
The flags for each vldb entry can have various VLOP_* bits set to show
that the entry is locked, and for what reason. In vldb_check, output
these bits symbolically instead of mentioning them in "errorflags".
Do not corrupt volume linktable when special file already exists
Upon volume creation, when a special file unexpectedly exists, e.g. due
to a failed cleanup, do not blindly assume that it is the link table.
Otherwise the latter's magic will get silently overwritten.
Andrew Deason [Fri, 27 Nov 2009 22:56:19 +0000 (17:56 -0500)]
Make ubik use unsigned addresses
The ubik code currently treats IPv4 addresses as both signed and
unsigned 32-bit ints. Make some instances use unsigned ints to make ubik
more consistent and squash a couple of warnings.
Note that this slightly alters the signatures of the public ubik
functions ubeacon_InitServerListByInfo, ubeacon_InitServerList,
ubik_ServerInitByInfo, ubik_ServerInit, ubik_ParseClientList, and
ubik_ParseServerList, to use unsigned addresses.
Andrew Deason [Mon, 17 May 2010 20:44:50 +0000 (15:44 -0500)]
Mention that -fakestat fakes local cellular mounts
The afsd man page says that -fakestat only fakes stat information for
cross-cell mount points. Technically it fakes stat information for all
cellular mount points, local or foreign. Most people shouldn't care,
but note the difference, since some places do have local cellular
mount points.
Davor Ocelic [Sun, 20 Jun 2010 13:38:14 +0000 (15:38 +0200)]
Provide manpage for fssync-debug and most subcmds
This is another patch in the series to provide manpages for
dafs-related commands.
Most (if not all) documentation is coming from source
documentation and DAFS articles/presentations.
The primary motivation behind this is to comply with Debian
guidelines requiring all binaries to have respective manpages.
This patch has been sitting here for months, so it's good time
to finally submit it.
Note that fssync-debug also supports some vcg* commands, for
which I was not able to find any documentation I could use.
So, they are still left to be documented.
Andrew Deason [Fri, 11 Jun 2010 22:40:18 +0000 (17:40 -0500)]
vol: break callbacks when needsCallback is set
The needsCallback vol header field indicates that a volume has been
altered by a non-fileserver program somehow, and that callbacks for
the volume should be broken. So, when we attach a volume that has this
flag set, break callbacks if we can. If we are not the fileserver,
tell the fileserver over FSSYNC to break callbacks if we can.
Derrick Brashear [Sat, 19 Jun 2010 15:26:49 +0000 (11:26 -0400)]
afsd -dynroot-sparse mode for hushed cells
if an admin specifies -dynroot-sparse (instead of dynroot) come up
with just local cell and cell aliases showing. cell list
is configured as normal. fs newcell works as normal.
Andrew Deason [Fri, 11 Jun 2010 22:39:32 +0000 (17:39 -0500)]
salvaged: Break volume callbacks on vol change
The salvager code can change a volume in many ways as it fixes errors.
We should break callbacks on the volume whenever we change it, as
clients may have callbacks on whatever we changed. So, for the
salvageserver, send an FSSYNC command to the fileserver to tell it to
break callbacks for that volume.
Ben Kaduk [Sun, 20 Jun 2010 22:54:26 +0000 (18:54 -0400)]
Simplify preprocessor logic in afs_pioctl
We had identical code in two branches of an if/elif/else path.
Merge them together.
This allows two DARWIN80_ENV blocks to be coalesced; reindent
them correctly while we're here.
Andrew Deason [Mon, 21 Jun 2010 22:28:10 +0000 (17:28 -0500)]
vldb_check: ntohs ubik header size
The 'size' field in the ubik header is only 16-bits wide. So, we must
use ntohs to convert it, not ntohl. Without this, vldb_check would
emit false-positive "Ubik header size is 0" warnings.
Andrew Deason [Mon, 21 Jun 2010 20:47:06 +0000 (15:47 -0500)]
ubik: Do not hide ReplayLog errors
For some reason, the ReplayLog code was printing encountered errors in
the replay log as debug messages. Print them out as regular log
messages instead, since these are errors that at least warrant
visibility, if not more action.
Andrew Deason [Fri, 18 Jun 2010 22:20:22 +0000 (17:20 -0500)]
ubik: ntohl on reading the replay log
When attempting to read the replay log, ubik was not ntohl'ing all
integers that were read in from the log, causing the log to appear
invalid on little-endian systems. Fix it.
This problem manifests as apparent corruption in the database on top
of ubik when a commit is occurring when we are shut down, or a disk
error is encountered during a commit.
Ben Kaduk [Thu, 17 Jun 2010 04:27:51 +0000 (00:27 -0400)]
Fix aklog segfault
In auth_to_cell(), we only strdup() into the linkedcell argument
if there is a linkedCell in the current cellconf. However, in
main(), we free linkedcell if it is non-NULL, but it is allocated
on the stack and could contain garbage. free() chokes on such
garbage, causing aklog to abort().
If we copy nothing into linkedcell, set it to NULL so that we
do not attempt to free the bogus pointer.
Russ Allbery [Wed, 16 Jun 2010 01:59:22 +0000 (18:59 -0700)]
Remove configure remnants of Digital UNIX / Tru64 client
Remove the configure flag to specify the location of the Digital
UNIX kernel headers and some setup for the kernel module build.
Note in README that Digital UNIX / Tru64 is supported for servers
only.
Chaz Chandler [Mon, 14 Jun 2010 04:21:50 +0000 (00:21 -0400)]
IRIX: Implement makesname()
makesname() make a semaphore name for use in <sys/sema.h>-type routines on
IRIX. It takes as input a pointer to an allocated string buffer (sname) of
size METER_NAMSZ, a string prefix (prefix), and a vnode number (v_number).
When complete, sname is returned, pointing to the beginning of a
NULL-terminated string containing the new name, with a maximum of
(METER_NAMSZ-1) characters plus the NULL. The name is a concatenation of
the string at 'prefix' and the ASCII representation of the number in
'v_number'.
Note: Due to IRIX's use of uint64 to represent vnumber_t and a maximum
semaphore name length of 15 (METER_NAMSZ-1), this function cannot be
guaranteed to produce a name which uniquely describes a vnode.
makesname() is already called from afs_vcache.c but not (or no longer)
available / implemented elsewhere.
Andrew Deason [Tue, 15 Jun 2010 17:19:25 +0000 (12:19 -0500)]
Do not assume non-valid addrs in addr hash table
As part of host state verification, we were calling
h_stateVerifyAddrHash to verify that all addresses for a host were in
the address hash table. The problem with this is that interface
addresses that are not marked as 'valid' are intentionally not in the
addr hash table. So, any time there was a non-'valid' interface
address in the host state, we stood a very good chance to fail to
verify the state.
Instead, if we have a non-'valid' address, try to verify that it is
_not_ in the addr hash table (or at least, is not pointing at the host
with the non-'valid' interface addr), since they're not supposed to be
in there.
Andrew Deason [Tue, 15 Jun 2010 15:58:58 +0000 (10:58 -0500)]
Make h_stateVerifyAddrHash log port on errors
When h_stateVerifyAddrHash logs that an error in state verification
occurs, it was only logging the address of the host causing the
problem. Log the port, too, since there could be multiple hosts with
the same address.
Russ Allbery [Fri, 4 Jun 2010 02:50:14 +0000 (19:50 -0700)]
Fix aklog warnings when building with Heimdal
Fix various warnings in the aklog and klog code when building with
Heimdal. Use krb5_get_init_creds_opt_alloc if it's available rather
than allocating the struct off the stack, since the _opt_init
function is deprecated.
Russ Allbery [Wed, 26 May 2010 03:19:14 +0000 (22:19 -0500)]
Rework the Kerberos Autoconf probes
Previously, building with Kerberos support required either passing a
flag to configure giving the location of a krb5-config script, or
manually setting variables specifying the Kerberos libraries and
header path. Replace that code with code that checks for Kerberos
libraries automatically and builds the Kerberos code if any were
found, with support for doing direct library probing if there is no
krb5-config script.
Add several platform-specific overrides directly into the configure
support, so we should be able to build out of the box on Mac OS X 10.3,
HP-UX, and AIX Kerberos with the new probes.
The Kerberos Autoconf macros are now the versions that come with
rra-c-util and are tested with multiple other packages, so both
OpenAFS and those packages will be able to benefit from further
portability improvements.
Update README for the new building instructions, documenting how to
configure the Kerberos probes if they can't automatically figure out
the location and flags for Kerberos on your system.
Andrew Deason [Tue, 8 Jun 2010 22:28:39 +0000 (17:28 -0500)]
GetVolume: do not wait for offlining volumes
In non-DAFS GetVolume, previously we waited for a volume with
vp->goingOffline set to go offline before we return. However, the
fileserver afsfileprocs.c case can treat the "going offline" case and
the "is offline" case identically, so there is no reason to wait. So
make the fileserver call a new GetVolume variant that does not wait.
Without this, all of the threads in the fileserver can potentially be
tied up by waiting for a volume to go offline, if the volume is taking
a long time to go offline due to an offline request following a client
slowly accessing the volume.
Change-Id: I58ae11e585852130154389d8df0567432cd0c2df
Reviewed-on: http://gerrit.openafs.org/2124 Reviewed-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Tom Keiser <tkeiser@sinenomine.net> Tested-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Tue, 15 Jun 2010 17:33:48 +0000 (12:33 -0500)]
afscp: Correctly advertise local addresses
afscp was reporting its local address list in net-byte order, and then
giving that list as a response to RXAFSCB_WhoAreYou. Instead, convert
the addresses to host-byte order, since XDR takes care of endianness
foo.
Andrew Deason [Mon, 14 Jun 2010 18:28:37 +0000 (13:28 -0500)]
Fix tptserver and tvlserver install rules
Commit 00c37e8634b97dba3431804cea467a046be525d5 introduced a few
usages of 'ifeq' in cross-platform Makefiles, breaking the build when
not using GNU make. Fix this by making the tptserver and tvlserver
'install' and 'dest' targets behave more like the 'ptserver' and
'vlserver' ones, and correct the ptserver 'install' target while we
are here.
Change-Id: Ia3fd9149c0f18a96a9899a5dfde41e53a45102b7
Reviewed-on: http://gerrit.openafs.org/2160 Tested-by: Andrew Deason <adeason@sinenomine.net> Tested-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Russ Allbery [Mon, 14 Jun 2010 22:28:20 +0000 (15:28 -0700)]
Build util tests properly with make check
If one runs make check without previously running make at the top
level first, it didn't build the util test programs properly.
Recurse into subdirectories for make check as well, and add the
check, test, and tests targets to tests/util/Makefile.in
Andrew Deason [Thu, 20 May 2010 20:22:11 +0000 (15:22 -0500)]
ubik: add interface for reading during write locks
Add ubik_BeginTransReadAnyWrite, which allows for reading from the
database, even while there is a conflicting ubik write lock. Reads are
still blocked while the local database is updating due to a write
transaction commit.
Derrick Brashear [Thu, 10 Jun 2010 18:37:39 +0000 (14:37 -0400)]
rx mtu ping handling
engage mtu pings. only occur while a call is active but results are
cached per-peer. requires idle dead time to be in use, or does not
activate. (needed to time out the call, otherwise, keepalives will
succeed and the call will thus not hit regular "down server" timeout)
Derrick Brashear [Thu, 10 Jun 2010 15:41:23 +0000 (11:41 -0400)]
path mtu don't track nonsequenced packets
for the purpose of mtu discovery, we need a sequence number to
correlate if a large packet is acked. don't track sequence number
0 packets. a later change adds the mechanics needed for MTU pings
Simon Wilkinson [Sat, 12 Jun 2010 09:42:43 +0000 (10:42 +0100)]
libadmin: Don't dereference NULL pointer in cmd
If DoBosHostList ends up being called without the -server argument
in its command structure, then a printf will attempt to dereference
a NULL pointer to the -server field.
Simon Wilkinson [Sat, 12 Jun 2010 09:35:34 +0000 (10:35 +0100)]
fs: Can't use store behind data if pioctl errored
If the call to a pioctl returns an error, it's possible to reach
the end of the storebehind function and try and print an old, or
bogus, value from the pioctl data block.
Simon Wilkinson [Sat, 12 Jun 2010 09:26:09 +0000 (10:26 +0100)]
viced: CopyOnWrite2 shouldn't return undefined val
Unless CopyOnWrite2 encounters the condition where
(rdlen != length) || (wrlen !=length) it will never set a value
for the 'rc' return code, and so return with an undefined value.
Looking at the code, it looks like rc should be 0 in all other
situations, so this patch provides a default value.
Simon Wilkinson [Fri, 11 Jun 2010 23:23:22 +0000 (00:23 +0100)]
vol: open() needs mode if called with O_CREAT
If open() is called with a the O_CREAT flag, then it requires a
3rd argument, containing the mode with which to create the file.
On DARWIN (when we always use O_CREAT), and on other platforms
where the first call to open returned E_NOENT, we weren't doing this,
and so were presumably getting a random mode of whatever garbage was
on the stack.
Russ Allbery [Sat, 12 Jun 2010 23:07:52 +0000 (16:07 -0700)]
Avoid off-by-one error when saving the password in klog
When klog saved the password entered by the user to allow attempts
at multiple AFS principals without reprompting, it copied the whole
buffer according to the declared reply length into local storage.
This was done without regard to the local allocated storage size,
and was then nul-terminated without regard to the allocated storage
size. Both klog and Heimdal use a size of BUFSIZ for the reply
buffer by default, which meant that klog on Heimdal was writing past
the end of the allocated structure when nul-terminating the password.
Store our allocated buffer size in the struct and only copy at most
one fewer than that many characters, and then nul-terminate
accordingly.
(The assumption that BUFSIZ is always long enough is still bogus,
but that's larger surgery.)
Marc Dionne [Sun, 13 Jun 2010 00:43:25 +0000 (20:43 -0400)]
Linux s390x: replace AFS_64BIT_KERNEL with AFS_LINUX_64BIT_KERNEL
The s390x param.h file defines AFS_64BIT_KERNEL, but this looks to
be AIX specific, and some Linux headers expect AFS_LINUX_64BIT_KERNEL.
This causes many errors because we end up trying to use struct flock64
instead of struct flock.
Simon Wilkinson [Sun, 13 Jun 2010 00:44:27 +0000 (01:44 +0100)]
bucoord: Use mkstemp properly
Use mkstemp wherever we have it available, to silence warnings
about mktemp's safety.
When we do use mkstemp, use it properly. It doesn't return void,
it returns an open filehandle. Convert this filehandle into a FILE *,
rather than throwing it away, and leaking an open file descriptor.