]> git.michaelhowe.org Git - packages/o/openafs.git/log
packages/o/openafs.git
14 years agocache bypass: don't define iovecp for UKERNEL
Marc Dionne [Sat, 22 Oct 2011 13:32:33 +0000 (09:32 -0400)]
cache bypass: don't define iovecp for UKERNEL

iovecp is defined but not used for UKERNEL.  Define it conditionally
to avoid gcc warnings and --enable-checking failure.

Reviewed-on: http://gerrit.openafs.org/5650
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 547d94edd3affb5f377cd1b3db39c46ca0cf5aec)

Change-Id: I700b82173b5c2435a716aaf10541e1583f2655f5
Reviewed-on: http://gerrit.openafs.org/6316
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
14 years agorx: arrange for Finalize to really stop running calls
Derrick Brashear [Thu, 15 Sep 2011 17:48:31 +0000 (13:48 -0400)]
rx: arrange for Finalize to really stop running calls

previously rxi_ServerProc would happily error a call once
rx_tranquil was set, but keep calling ExecuteRequest.
Reorder code so kernel shutdown attempts are processed first;
then arrange if we are tranquil to not process the call further.

Issue discovered by Chaskiel Grundman.

Reviewed-on: http://gerrit.openafs.org/5447
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 6196abf3c864f8cc6ab1efc6e5625a5cc68158bd)

Change-Id: I00fad117ee8386fc29cd2423aa9fb7d89af55160
Reviewed-on: http://gerrit.openafs.org/6313
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
14 years agoRPM: Fix dkms support on Fedora 15
Todd Lewis [Sun, 11 Sep 2011 11:42:47 +0000 (12:42 +0100)]
RPM: Fix dkms support on Fedora 15

Newer dkms no longer uses or supplies a $kernelver_array variable;
instead it uses $kernelver. The attached patch uses both, one of
which will be empty, so the test will do the Right Thing regardless
of your dkms version.

Further, the "mv" command at the end of the MAKE[0]= line needs
lots of back-slashes on each of its parms. We need three to make it
all the way to the final dkms.conf file -- so that's six -- plus one
more to escape the '$'; that's seven in all.

In case there's any question (and with all the back-slashes involved,
there should be) about the intent here, the whole point of this
patch is to make the final dkms.conf MAKE[0]= line look like this
(module line breaks:

MAKE[0]="KMODNAME=openafs.ko; DSTKMOD=\".\"; [ \"\`echo
\"${kernelver_array[0]}${kernelver[0]}\" | sed -e
's/^\([0-9]*\.[0-9]*\)\..*/\1/'\`\" = \"2.4\" ] && KMODNAME=\"libafs-*\"
&& DSTKMOD=openafs.o; ./configure
--with-linux-kernel-headers=${kernel_source_dir}
--with-linux-kernel-packaging; make; mv src/libafs/MODLOAD-*/\\\$KMODNAME
\\\$DSTKMOD"

This is what was required to get "dkms build ..." to work on Fedora 15,
and as near as I can tell it shouldn't break 2.4 or other builds.

FIXES 130211

Reviewed-on: http://gerrit.openafs.org/5393
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 8e0aaae076f4cccfd2d6ed81ede4e355235b578e)

Change-Id: I47b0e24a0cbbd8402d5dd902e7e2af59ca1c30b7
Reviewed-on: http://gerrit.openafs.org/6312
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
14 years agoaklog: strlen(NULL) doesn't work
Derrick Brashear [Fri, 2 Sep 2011 17:35:24 +0000 (13:35 -0400)]
aklog: strlen(NULL) doesn't work

strlen(filepath) when !filepath isnt going to work very well. i believe
this to be the intent of the author of the original patch.

Reviewed-on: http://gerrit.openafs.org/5328
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit c3e82ee98bf66058636f11d7a98d3bebe3bac955)

Change-Id: I89911d2da314059db633c00c69c9c9ec2050bb86
Reviewed-on: http://gerrit.openafs.org/6311
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
14 years agoihandle: OPEN fdPs are not counted in ihP refcount
Andrew Deason [Mon, 29 Aug 2011 18:07:01 +0000 (13:07 -0500)]
ihandle: OPEN fdPs are not counted in ihP refcount

Just add a comment explaining that an OPEN FdHandle_t does not count
against the ref count for its parent IHandle_t. Recently I've seen
some confusion about this when discussing ihandle internals, and this
should make this abundantly clear.

Reviewed-on: http://gerrit.openafs.org/5317
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 0f4dfaed6b25ae4282298cc2ba4908ce9f36f043)

Change-Id: Icd0d5b368ccc679967e14b2460f47c814598c797
Reviewed-on: http://gerrit.openafs.org/6310
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoxserver lock order violation
Derrick Brashear [Tue, 23 Aug 2011 04:20:37 +0000 (00:20 -0400)]
xserver lock order violation

individual volume locks are pretty far down, well after afs_xserver.

afs_SetupVolume (with tv->lock)-> InstallUVolumeEntry-> afs_GetServer.

Install*Volume is careful to protect against recursing into the volume
lock via ResetVolumeInfo. Unfortunately, GetServer acquires xserver,
and then if it needs to call GetCapabilities, it drops and reacquires
xserver.

turns out the volume locks weren't protecting much. they also aren't
grabbed before xvolume is dropped. fine, so, restructure to do all the
work, then merge the result.

Reviewed-on: http://gerrit.openafs.org/5303
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 16dff61e148ce6893a68dda6e05e84f96fa753ac)

Change-Id: I7ca73fe9cf76e9a47cdccfc6cf0e9188fce9f5a6
Reviewed-on: http://gerrit.openafs.org/6309
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoxvcb lock order violation
Derrick Brashear [Mon, 22 Aug 2011 18:56:03 +0000 (14:56 -0400)]
xvcb lock order violation

afs_FlushVCBs(1) = xvcb, xserver (in that order)

afs_GetServer = xserver, xsrvAddr, (call afs_RemoveSrvAddr which calls
afs_FlushServer, which gets xvcb)

"nope". do a little dance to get xvcb, searching for a struct server to reuse
again if we had to block.

if you're curious:
Lock afs_xserver status: (reader_waitingwriter_waiting, write_locked(pid:1589 at:36), 3 waiters)
Lock afs_xvcb status: (none_waiting, write_locked(pid:0 at:273))
Lock afs_xsrvAddr status: (none_waiting, write_locked(pid:1589 at:116))

Reviewed-on: http://gerrit.openafs.org/5294
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 12fa5b859b857aaf0ab6975ebac0d4867d0ae0ff)

Change-Id: Ifee367fef4da44bcfd92cea6d26612977d6653a1
Reviewed-on: http://gerrit.openafs.org/6308
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoaklog: work around lion kerberos disaster
Derrick Brashear [Thu, 25 Aug 2011 00:40:38 +0000 (20:40 -0400)]
aklog: work around lion kerberos disaster

fine, so, instead of needing weak crypto enabled, use krb5 config
paths trick and ship a config to deal.

Reviewed-on: http://gerrit.openafs.org/5310
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 33bb5218ba8d6c5b5c5c4839fd31824ca90c062b)

Change-Id: I91a8a02638cadf6f55814763b16cc50d3c7334c5
Reviewed-on: http://gerrit.openafs.org/6307
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoihandle: Actually assert active fdPs are not AVAIL
Andrew Deason [Wed, 24 Aug 2011 17:30:00 +0000 (12:30 -0500)]
ihandle: Actually assert active fdPs are not AVAIL

FdHandle_t's that are on the linked list for an associated IHandle_t
should not be in the state FD_HANDLE_AVAIL. For the non-PIO case, we
assert that this is the case in ih_open (since we assert that if the
FdHandle_t is not in INUSE state, then it must be in OPEN state).
However, for the PIO case, we were just skipping over any FdHandle_t's
that were in the AVAIL state. These should never exist while on that
linked list, so assert for the PIO case, as well.

In the absence of bugs, there is no functional change here, but it
perhaps makes the ih_open loop easier to understand.

Reviewed-on: http://gerrit.openafs.org/5307
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 6d79cfb36165c33dd1fd9c4d7ca8436d9a78f7ff)

Change-Id: If9e74f6120b007368128aead8787d715a1b1f093
Reviewed-on: http://gerrit.openafs.org/6306
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoLINUX vcache lock ordering in afs_linux_readdir
Matt Benjamin [Wed, 24 Aug 2011 20:23:37 +0000 (16:23 -0400)]
LINUX  vcache lock ordering in afs_linux_readdir

Normalize shared and exclusive lock operations.  Take the lock
exclusive immediately, since the code assumes a write lock if
the vcache state is in flux or the entry is being fetched, releasing
-write- rather than shared, since we do not hold a shared lock.

Reviewed-on: http://gerrit.openafs.org/5309
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit fa97579a08cdf23fcff3c50a5845d72a785feeaf)

Change-Id: I282913fead10791751ebaf3c7c6b33e3fbd9a1f7
Reviewed-on: http://gerrit.openafs.org/6305
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agobutc: initialize startTime before it is used
Garrett Wollman [Sun, 7 Aug 2011 03:36:14 +0000 (23:36 -0400)]
butc: initialize startTime before it is used

In some unusual error situations, startTime may be used uninitialized.
Move the initialization up above the first such error condition.
(None of the intervening code can take measurably long to execute
so this should not make any difference in the non-error case.)

Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5165
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 34cc26a1b11bc8cf8f91996a019ac4b7d21dccd8)

Change-Id: I70e08b61fbc33857da88224a0577330a0d68d9a7
Reviewed-on: http://gerrit.openafs.org/6304
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoafsd: Fail gracefully on mtab open failure
Andrew Deason [Wed, 8 Jun 2011 18:19:59 +0000 (13:19 -0500)]
afsd: Fail gracefully on mtab open failure

On Linux and IRIX, fail gracefully when we fail to open /etc/mtab,
instead of segfaulting. Move strdup'ing cacheMountDir until after
opening /etc/mtab, to simplify the error handling.

Reviewed-on: http://gerrit.openafs.org/4825
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit b1f0bb472e237f5a6f88449db44f030c08a5a324)

Change-Id: Id12f6190eac15593dd32fd46db354e169d19dc2f
Reviewed-on: http://gerrit.openafs.org/6303
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agovos: Don't leak/overflow bulkaddrs
Simon Wilkinson [Tue, 31 May 2011 07:28:51 +0000 (08:28 +0100)]
vos: Don't leak/overflow bulkaddrs

The vos listaddrs command repeatedly reuses a bulkaddrs array. It
zeros it once (without freeing the allocated memory), and then
repeatedly uses it without zeroing in a loop. This means that the XDR
library assumes that a sufficiently large block is already allocated,
doesn't reallocate for the incoming data, or check limits.

This means that if the first call to VL_GetAddrsU returns a set of
addresses smaller than subsequent calls, we'll write past the end
of the array, causing memory corruption.

Fix this by freeing the arrays correctly with each pass of the call.

Reviewed-on: http://gerrit.openafs.org/4756
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit b6add117ad210665a811213fe17a30fabbda3a3c)

Change-Id: Ic3ae8f506e87d18fdc121ff21221f61c359e38aa
Reviewed-on: http://gerrit.openafs.org/6302
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agovolinfo: fix size totals when saving inodes
Michael Meffie [Fri, 20 May 2011 18:44:39 +0000 (14:44 -0400)]
volinfo: fix size totals when saving inodes

Fix the volume size calculation when volinfo is invoked with
both -sizeOnly and -saveinodes at the same time.

Reviewed-on: http://gerrit.openafs.org/4691
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ababc1ba4412ae94b29f8ba0832eac087a024af2)

Change-Id: I371a983078c12e09474051ba71f63cdeb57c3631
Reviewed-on: http://gerrit.openafs.org/6301
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agolibafs: Always use anonymous VL connections
Andrew Deason [Mon, 16 May 2011 18:45:49 +0000 (13:45 -0500)]
libafs: Always use anonymous VL connections

afs_NewVolumeByName was using the areq given by the caller for
afs_SetupVolume, which may represent authenticated credentials. Give
afs_SetupVolume &treq instead, which will be anonymous, so we don't
have to deal with rxkad for VL lookups.

Reviewed-on: http://gerrit.openafs.org/4666
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 4a82c0cc4167b729108813965bd39bf86ea15e6b)

Change-Id: Ic10e85b925176719c6c5dc708a1d1a315409d295
Reviewed-on: http://gerrit.openafs.org/6300
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoviced: Don't VTakeOffline_r without glock
Andrew Deason [Mon, 16 May 2011 20:16:30 +0000 (15:16 -0500)]
viced: Don't VTakeOffline_r without glock

We don't have the volume glock, so don't call _r functions.

Reviewed-on: http://gerrit.openafs.org/4669
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit ef0ac2fbb026385f2306189230c2cff8706dff06)

Change-Id: I3d7c2ca8a514d50c01d4830640e806cefac32af1
Reviewed-on: http://gerrit.openafs.org/6299
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoviced: Check vnode length on Rename and Link
Andrew Deason [Mon, 16 May 2011 20:02:14 +0000 (15:02 -0500)]
viced: Check vnode length on Rename and Link

Commit 2578555d7e08131bf2fe4cdd0aa4b32567a76eb2 added vnode length
checks when we create or remove vnodes, but not during Rename and Link
operations (when vnodes are neither created nor destroyed). Add the
check in Rename and Link.

Reviewed-on: http://gerrit.openafs.org/4668
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 6df5547a7b93af74bc49ec8d4678aafd646dda1b)

Change-Id: I795407a143a56f26c0679b929763ebdc9c633e7a
Reviewed-on: http://gerrit.openafs.org/6298
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoviced: Do not try to reuse deleted client
Andrew Deason [Wed, 27 Apr 2011 20:36:44 +0000 (15:36 -0500)]
viced: Do not try to reuse deleted client

When h_FindClient_r encounters a deleted client structure, it does not
try to find a different client structure to use. Force it to use a new
client structure by setting client to NULL when it detects a deleted
client.

This arguably reverts part of
4e55e30f5b2c149b350b6d6875793adf722fdc21, but the code paths in
h_FindClient_r are very different now, so that commit is probably not
too relevant.

Reviewed-on: http://gerrit.openafs.org/4582
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit b2c6a850738437256626e0dfe743a09224879ad4)

Change-Id: I5e3a12ee79847a915edeec732946b43270a35697
Reviewed-on: http://gerrit.openafs.org/6296
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agopam: Password is const in setcred
Andrew Deason [Mon, 25 Apr 2011 18:53:52 +0000 (13:53 -0500)]
pam: Password is const in setcred

afs_setcred.c gets the "password" pointer from pam_get_data, which
always gives a const pointer (unlike pam_get_item used in afs_auth.c
&c, which sometimes gives a const or not-const pointer, depending on
the PAM implementation).

So, declare password const, to get better type checking.

Reviewed-on: http://gerrit.openafs.org/4553
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 94a9b2afd82b6729ddceb7ef736ddeb039e0ae1b)

Change-Id: I3171babfbdf29e7aa543a17f7dd543deedc9b30c
Reviewed-on: http://gerrit.openafs.org/6294
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agopam: Use PAM_CONST more often
Andrew Deason [Wed, 13 Apr 2011 15:52:50 +0000 (10:52 -0500)]
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.

Reviewed-on: http://gerrit.openafs.org/4470
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 78d1f8d88334f711eaaf6555d3a962a504d3e80e)

Change-Id: I831fa52c238a6cf7ef211e8198815c4420ae7dce
Reviewed-on: http://gerrit.openafs.org/6291
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agopam: Check for null upwd from getpwnam_r
Andrew Deason [Wed, 13 Apr 2011 16:10:52 +0000 (11:10 -0500)]
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.

Reviewed-on: http://gerrit.openafs.org/4469
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit fbb4c6115b9af9c52ee06fa9c979a3f4195ad342)

Change-Id: I9a8bccba7b6ecbce393ea149270e5c61ebadd05c
Reviewed-on: http://gerrit.openafs.org/6290
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agopam: Use POSIX getpwnam_r on Solaris
Andrew Deason [Wed, 13 Apr 2011 16:08:09 +0000 (11:08 -0500)]
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.

Reviewed-on: http://gerrit.openafs.org/4468
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a7d4fbd36a120b16caaddcd9d1c7f550cb14aae5)

Change-Id: I2ce885da5018b250052852cb70c70eaecd521cc5
Reviewed-on: http://gerrit.openafs.org/6289
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agokernel upcall rx env should shut down event daemon
Derrick Brashear [Fri, 15 Apr 2011 12:02:22 +0000 (08:02 -0400)]
kernel upcall rx env should shut down event daemon

also shut down event daemon in upcall environment

Reviewed-on: http://gerrit.openafs.org/4473
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit f4776f0a4d51472ee6f2406174b074c03213f7da)

Change-Id: I7b362e0e0d1ac5f028718b522e56101f2bed297e
Reviewed-on: http://gerrit.openafs.org/6288
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoDAFS: Request salvage on detach for volser
Andrew Deason [Fri, 8 Apr 2011 18:00:15 +0000 (13:00 -0500)]
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.

Reviewed-on: http://gerrit.openafs.org/4452
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit de0c72bf7c7d284f4d15d99c79b39e0c97f1a122)

Change-Id: Id6f86368386a5e113a00aa0a496649d69875d283
Reviewed-on: http://gerrit.openafs.org/6286
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agovolser: Avoid assert on ViceCreateRoot failure
Andrew Deason [Thu, 7 Apr 2011 17:36:19 +0000 (12:36 -0500)]
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.

Reviewed-on: http://gerrit.openafs.org/4444
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 399655e3df3bf30d7878dec70402fc0021cae752)

Change-Id: Icbc934bfe59f6468771f37e5721341dae49ba460
Reviewed-on: http://gerrit.openafs.org/6285
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoDAFS: Do not give back vol to viced after salvage
Andrew Deason [Thu, 7 Apr 2011 18:51:14 +0000 (13:51 -0500)]
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).

Reviewed-on: http://gerrit.openafs.org/4445
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 316b0421a27a4a76298f60ecd62b1236c971e512)

Change-Id: I432abb4d65a738e0e1936a7ff2fff2eccf45834a
Reviewed-on: http://gerrit.openafs.org/6284
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoafsd: Trim trailing slashes on Linux mntent
Andrew Deason [Wed, 6 Apr 2011 21:56:22 +0000 (16:56 -0500)]
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.

Reviewed-on: http://gerrit.openafs.org/4442
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 325443e6178f9dcdba7326bdb675447ac72bd540)

Change-Id: I9832fad8a43278c5eb618e4148c71f8a9ef81e87
Reviewed-on: http://gerrit.openafs.org/6283
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoubik: don't rely on timeout value after select()
Marc Dionne [Wed, 6 Apr 2011 01:30:20 +0000 (21:30 -0400)]
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.

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>
(cherry picked from commit 0b510fe30afb34202342364e96bd9030052e1567)

Change-Id: I24eb4d4b1f758f33e3517671cb576ff23e641fb3
Reviewed-on: http://gerrit.openafs.org/6282
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoIrix: Supress some more warnings in kernel builds
Simon Wilkinson [Mon, 4 Apr 2011 10:02:17 +0000 (11:02 +0100)]
Irix: Supress some more warnings in kernel builds

Suppress the following warnings in kernel builds:
 *) The function "blah" was declared but never referenced (1174)
 *) The indicated trailing comma is non-standard (1201)
 *) The parameter "blah" was never referenced (3201)
 *) implicit conversion of a 64-bit integral type to a smaller
    integral type (3968)

Reviewed-on: http://gerrit.openafs.org/4419
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 353857e7685c9acfcf7474fabe57c928c70c778f)

Change-Id: I4a5b85ffc56a801e19a181f8d2661eba9c975dcc
Reviewed-on: http://gerrit.openafs.org/6281
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agofsprobe: Fix usage message
Marc Dionne [Sat, 2 Apr 2011 13:03:55 +0000 (09:03 -0400)]
fsprobe: Fix usage message

Fix the usage message to display the correct command name.

Reviewed-on: http://gerrit.openafs.org/4398
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a0389f5592c25afb19befb5bf62833a0b0bc59cc)

Change-Id: I6105eff9f4cfae56d85df40589bd4b175aa760d0
Reviewed-on: http://gerrit.openafs.org/6280
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agofsprobe: call RXAFS_GetTime directly
Marc Dionne [Sat, 2 Apr 2011 12:40:15 +0000 (08:40 -0400)]
fsprobe: call RXAFS_GetTime directly

Call RXAFS_GetTime directly instead of using ubik_Call which is
not prototyped and has logic that we don't need/want here since
we're targeting a specific server.

Reviewed-on: http://gerrit.openafs.org/4397
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ef105dcc4932da804750dea0c922d5814fc5bf15)

Change-Id: If4e430a55d36725f2cf8e5bf04a036062480cfac
Reviewed-on: http://gerrit.openafs.org/6279
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoLinux: Fix USE_UCONTEXT detection
Simon Wilkinson [Fri, 1 Apr 2011 15:37:32 +0000 (16:37 +0100)]
Linux: Fix USE_UCONTEXT detection

On Linux, afs/param.h determines whether to use the ucontext()
function based on the glibc version. However, the glibc version
macros aren't available until a C library header has been included.

There have been a couple of attempts to fix this. The first included
afs_sysnames.h before the C library check, but this wasn't sufficient
to pull in a header for all builds. The second included stdio.h before
including afs/param.h in process.c.

Whilst the second approach works, it has the drawback that it breaks
our convention that afsconfig.h and afs/param.h must always be the first
includes in a file. More seriously, it means that the behaviour of
afs/param.h is different depending on where it appears in the include
order - which is especially dangerous for 3rd party user.

So, this patch tries to resolve all of this by explicitly including
features.h before doing the glibc version checks. The only danger I
can see here is that Linux platforms without glibc may lack a
features.h, but I suspect we have trouble building on such platforms
in any case.

Reviewed-on: http://gerrit.openafs.org/4389
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit f5f0ce525a63264098cd0625769d642fe6f106ba)

Change-Id: Ia94487f35ad0fc3143faafd2fa12a6c71d40f116
Reviewed-on: http://gerrit.openafs.org/6278
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agovol: remove warning on use of DFlushVolume
Jeffrey Altman [Sat, 5 Mar 2011 19:29:38 +0000 (14:29 -0500)]
vol: remove warning on use of DFlushVolume

Include the afs/dir.h header on Windows to avoid
warnings caused by the missing prototype.

Reviewed-on: http://gerrit.openafs.org/4148
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit d69da816c6e961ef5e22df289ad5667cd8568b4c)

Change-Id: I1f128f676a6d099b2d9534e28c6302de78b0ff2d
Reviewed-on: http://gerrit.openafs.org/6273
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
14 years agovol: Move VOL_CV_TIMEDWAIT to volume_inline.h
Andrew Deason [Tue, 23 Nov 2010 03:23:02 +0000 (22:23 -0500)]
vol: Move VOL_CV_TIMEDWAIT to volume_inline.h

Some platforms will give errors for the vol package glock not being
defined in VOL_CV_TIMEDWAIT, since some utilities include volume.h
(with pthreaded ubik enabled) but do not have the vol glock. This
isn't a problem for the other CV_WAIT (et al) macros, since, being
macros, they are not expanded if never referenced. Since
VOL_CV_TIMEDWAIT is a static inline function, however, and at least
some platforms try to compile/link it even if it's not referenced.

So, move it to volume_inline.h, which is only used by the volume
package itself, where we will have the vol glock.

Reviewed-on: http://gerrit.openafs.org/3363
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit e4059c1b812410bd96481cc60c86c67f8733b66f)

Change-Id: Ic1d6286bb148f202b8da010edf48fff93a5a48fb
Reviewed-on: http://gerrit.openafs.org/6268
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agovol: Add timeouts to SYNC server select() calls
Andrew Deason [Tue, 29 Mar 2011 17:28:46 +0000 (12:28 -0500)]
vol: Add timeouts to SYNC server select() calls

Normally *SYNC server processes wait indefinitely for activity to
occur on one of the SYNC sockets. On some Linux kernels, there exists
a race condition where data can come in on a socket, but the select()
call continues to wait. To ensure that we do not hang forever in such
a scenario, add a timeout to the select() call, which will ensure we
notice the new data within 10 seconds. Raise the timeout on non-Linux
to reduce impact elsewhere.

The Linux kernel bug is tracked in
<https://bugzilla.redhat.com/show_bug.cgi?id=494404>, though that bug
report may not represent all affected kernels.

Reviewed-on: http://gerrit.openafs.org/4377
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 920a00e075b679f59e31b9fcbe7f5db15e345a95)

Change-Id: Iae4035bc952b66f88843d51ff341b0576f15163d
Reviewed-on: http://gerrit.openafs.org/6276
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agonamei: Log ListViceInodes write failures
Andrew Deason [Wed, 23 Mar 2011 20:19:03 +0000 (15:19 -0500)]
namei: Log ListViceInodes write failures

If we fail to write to the inodeFile given by ListViceInodes, we
should log the failure. Otherwise, no indication is given as to what
failed, when a salvage gathers the inode list.

Reviewed-on: http://gerrit.openafs.org/4294
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 22149d82d465f5defbe329b3f9b3c5040a6293e9)

Change-Id: I7fb56f0af99bb040e64cf54bf05e01306a609326
Reviewed-on: http://gerrit.openafs.org/6275
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agomacos: dont want bind 8 compat on leopard
Derrick Brashear [Tue, 15 Mar 2011 03:36:45 +0000 (23:36 -0400)]
macos: dont want bind 8 compat on leopard

we removed it for i386, kill it for ppc also.

Reviewed-on: http://gerrit.openafs.org/4229
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 4a72ebfe324874dd405d18561baf5eaacb007950)

Change-Id: I9e625f79c047b61fc3675e6732eaa7d2dd34214f
Reviewed-on: http://gerrit.openafs.org/6274
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoLINUX: afs_linux_put_link is void
Andrew Deason [Mon, 10 Jan 2011 18:11:22 +0000 (12:11 -0600)]
LINUX: afs_linux_put_link is void

The put_link callback doesn't return a value, so declare it as such.

Reviewed-on: http://gerrit.openafs.org/3636
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 336256c7a0e7d54495a070895c9d8c2057168839)

Change-Id: I5985316ea37f572039267ea117dfeae55ea96bc0
Reviewed-on: http://gerrit.openafs.org/6271
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoDAFS: listvol + unsalvagable volumes = intolerable delay
Derrick Brashear [Thu, 23 Dec 2010 18:20:42 +0000 (13:20 -0500)]
DAFS: listvol + unsalvagable volumes = intolerable delay

a non- inService volume (or more) plus vos listvol equals pain.
return Salvaging instead of waiting for it in the listvol case.

Reviewed-on: http://gerrit.openafs.org/3588
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit affc978be7ba3c36c9b7a6a94fb5e907beebed99)

Change-Id: If871ce0cdd3593250f22d74de184f92b046b5f6e
Reviewed-on: http://gerrit.openafs.org/6270
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoLINUX: Reduce stack depth on recursive symlink res
Andrew Deason [Fri, 3 Dec 2010 23:20:54 +0000 (17:20 -0600)]
LINUX: Reduce stack depth on recursive symlink res

Instead of calling vfs_follow_link inside afs_linux_follow_link
ourselves, we can just resolve the next step of the symlink resolution
and set the result in nd_set_link(), freeing the string in
.put_link().

For kernels without a usable symlink text cache, this reduces call
depth when resolving a path containing many symlinks by two frames per
layer of indirection, allowing for more deeply-nested symlink paths to
be usable.

Reviewed-on: http://gerrit.openafs.org/3433
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 2ce159fbf474b96ecd2a4224751d4655230bba51)

Change-Id: Idb91c2bb1a10b60d125dccbc98731ace63d4add8
Reviewed-on: http://gerrit.openafs.org/6269
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agorxgen: add *TranslateOpcode functions to XDR code
Felix Frank [Fri, 12 Nov 2010 23:10:31 +0000 (00:10 +0100)]
rxgen: add *TranslateOpcode functions to XDR code

Administrative commands and server binaries can benefit from the
ability to translate RPC OpCode numbers to proper function names.

For this purpose, rxgen now emits the function

char *PKGTranslateOpCode(int)

where PKG is replaced by the respective package prefix.

The function is generated in the exact same way that ExecuteRequest is.
This way, the right optimization (array storage vs. generated case
statement) according to the respective sparseness of OpCodes in the
different RX packages is maintained.

Reviewed-on: http://gerrit.openafs.org/3305
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 5c77a6ca2460c3e79125a614037824db35480905)

Change-Id: I23d7af2dd07e02255783de0523fce58dbe46d31e
Reviewed-on: http://gerrit.openafs.org/6267
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agovol: Add interfaces for registering RX calls
Andrew Deason [Fri, 29 Oct 2010 16:14:49 +0000 (11:14 -0500)]
vol: Add interfaces for registering RX calls

Add VGetVolumeWithCall and VPutVolumeWithCall, to associate RX calls
with volume heavyweight references. Also add the interrupt_rxcall
field to the volume package options structure.

This also adds the VIsGoingOffline function, so a caller can tell when
a volume is going offline.

Reviewed-on: http://gerrit.openafs.org/3215
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 33409b2c849d7fae3b10b3202bb15e338ae5b982)

Change-Id: Ib50a17b3479453bbbaef571711ede7115b17318e
Reviewed-on: http://gerrit.openafs.org/6265
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agovol: Add VGetVolumeTimed
Andrew Deason [Wed, 27 Oct 2010 22:34:40 +0000 (17:34 -0500)]
vol: Add VGetVolumeTimed

Replace the VGetVolumeNoWait interface with the more general
VGetVolumeTimed interface, which allows for waiting for offlining
volume for arbitrary amounts of time (instead of just "waiting
forever" or "not waiting at all"). Also add VOL_CV_TIMEDWAIT and
VTimedWaitStateChange_r as necessary to implement this.

Reviewed-on: http://gerrit.openafs.org/3214
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit db6ee95864a8fc5f33b7e95c19c8ff5058d37e92)

Change-Id: I6c7b3a0b9fe174ebffeb03153dda1c4705d7dac5
Reviewed-on: http://gerrit.openafs.org/6264
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agorx: Call rxgen_consts.h by its proper name
Simon Wilkinson [Sat, 11 Sep 2010 11:51:52 +0000 (12:51 +0100)]
rx: Call rxgen_consts.h by its proper name

rxgen_consts.h is actually in the afs/ directory. Include it from
their, rather than requiring that every user have $(TOP_INCDIR)/afs
in their search path.

Reviewed-on: http://gerrit.openafs.org/2750
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 34df5da39871ae5231048a416f191784c5c2d127)

Change-Id: I915cf9d975efbb7c73c1e57750227421362648c8
Reviewed-on: http://gerrit.openafs.org/6263
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoudebug: Always show tidCounter
Andrew Deason [Fri, 10 Sep 2010 16:17:40 +0000 (11:17 -0500)]
udebug: Always show tidCounter

If the queried site doesn't have an active write transaction,
currently udebug doesn't show the tidCounter. The tidCounter can still
be useful to know (especially since some sites will become buggy when
tidCounter rolls over), so always show it.

This adds the "The last trans I handled was" message to udebug.

Reviewed-on: http://gerrit.openafs.org/2730
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 51806bd21af5bcc70c27cda5787ae853fa3f495e)

Change-Id: I861804c4381a75626c5259a4896642f0e4064b7d
Reviewed-on: http://gerrit.openafs.org/6262
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agodoc: limitations of addsite on different partitions
Ken Dreyer [Mon, 31 Oct 2011 14:27:16 +0000 (08:27 -0600)]
doc: limitations of addsite on different partitions

A user on the openafs-info mailing list noted that the Admin Guide is
unclear about creating read-only replicas on different partitions on
the same fileserver. Clarify the rules here.

Reviewed-on: http://gerrit.openafs.org/5745
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit c59c07132ef17589ad3466ded418c1370539b7af)

Change-Id: I68898c21e2c1aa7d6828b475dff4c1cb6d14327c
Reviewed-on: http://gerrit.openafs.org/6317
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
14 years agoubik: add interface for reading during write locks
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.

Reviewed-on: http://gerrit.openafs.org/2592
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit fd7f7469bdbde24320c3ac8b4f7015d495b47bff)

Change-Id: I46cf35beeea6dc997976ea2c33e45c1a5f4904df
Reviewed-on: http://gerrit.openafs.org/6261
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoubik: Fix buffers for reading-during-writes
Andrew Deason [Tue, 22 Jun 2010 19:36:42 +0000 (14:36 -0500)]
ubik: Fix buffers for reading-during-writes

If we are reading while a write transaction is in progress, we can
encounter a buffer that is dirty if we're on the same site as the
writer. Ignore these buffers for readers, since they contain
uncommitted changes. Then, when the writer commits, invalidate the
resultant duplicate buffer, if one exists.

Reviewed-on: http://gerrit.openafs.org/2231
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 570236dd55e79e8886b45f19cef59ec3fa9d53f6)

Change-Id: If83e077b99a77339377a36f1d1bac9182ef26e4f
Reviewed-on: http://gerrit.openafs.org/6260
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoubik: Abstract buffer matching and pass trans ptrs
Andrew Deason [Tue, 22 Jun 2010 18:24:27 +0000 (13:24 -0500)]
ubik: Abstract buffer matching and pass trans ptrs

Abstract the code for matching buffers in DRead, and pass around
ubik_trans pointers instead of ubik_dbase pointers. This changes no
behavior, but makes changing ubik buffer code a bit easier.

Reviewed-on: http://gerrit.openafs.org/2230
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5c7297a6c76777aec6209aa191b067ddc73b1a87)

Change-Id: I6cc673d965b5e06361fff8ea259ba552446e3213
Reviewed-on: http://gerrit.openafs.org/6259
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
14 years agomacos: no more startupitems
Derrick Brashear [Fri, 1 Apr 2011 16:17:13 +0000 (12:17 -0400)]
macos: no more startupitems

if we're upgrading, a "cruft" startupitems script should just
be nuked.

FIXES 129601

Reviewed-on: http://gerrit.openafs.org/4387
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 841c8022e3978fffe1357f339d948e93c9db9d52)

Change-Id: Ibe2dde067df1fe22da1bb09039d07ebbc178af08
Reviewed-on: http://gerrit.openafs.org/6277
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
14 years agofix manpage for udebug -servers
Ken Dreyer [Mon, 11 Apr 2011 21:24:41 +0000 (17:24 -0400)]
fix manpage for udebug -servers

The proper option to udebug is "-server", not "-servers". Fix the manpage to line up with the binary.

Reviewed-on: http://gerrit.openafs.org/4457
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit d5ded9afa1764016977a17ef9346dc979bf70ca0)

Change-Id: I66bea4923717a6b7df5fbefa1dd93d469d96be3c
Reviewed-on: http://gerrit.openafs.org/6287
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
14 years agodoc: Add aklog_dynamic_auth manpage
Andrew Deason [Fri, 15 Apr 2011 19:18:57 +0000 (14:18 -0500)]
doc: Add aklog_dynamic_auth manpage

Add a manpage for the aklog_dynamic_auth LAM module.

Reviewed-on: http://gerrit.openafs.org/4485
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 24ddd06a0dc19ad7c0b2a2847d41a5ea69665b15)

Change-Id: Ib5f7463b75ee8d58ecc6b725f629fd7600c64792
Reviewed-on: http://gerrit.openafs.org/6297
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
14 years agoafs: prevent nat pings on destroyed connections
Jeffrey Altman [Mon, 5 Dec 2011 04:15:13 +0000 (23:15 -0500)]
afs: prevent nat pings on destroyed connections

If the connection is no longer in use, reset the nat keep alive
timer to 0 seconds.

Reviewed-on: http://gerrit.openafs.org/6230
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 7a93c827f353e2ad695d8019ab789b02a3596f2e)

Change-Id: I019bdce7a8f9f0123786b46d0563f42f7b26c14b
Reviewed-on: http://gerrit.openafs.org/6232
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
14 years agoFBSD: switch afsi_SetServerIPRank implementation
Ben Kaduk [Sat, 3 Dec 2011 19:37:09 +0000 (14:37 -0500)]
FBSD: switch afsi_SetServerIPRank implementation

Upstream has removed the ia_net{,mask} elements from
struct in_ifaddr, so we can no longer use them directly.
Switch to passing an rx_ifaddr_t (i.e. struct ifaddr*) in instead,
as that uses a slightly different codepath which still works
for our purposes.

We compile the kernel module with -Werror, so storing a pointer
(memcpy return value) in an int is forbidden, hence the conditional
declaration of 't'.

Reviewed-on: http://gerrit.openafs.org/6203
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 1ef8dc3dfbddcbe5610c276afc627c9fcfe30a65)

Change-Id: Icb338331c879dc4cbd69ae565b115de000e8d3d0
Reviewed-on: http://gerrit.openafs.org/6235
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoFBSD: cleanup dvp locking for ISDOTDOT
Ben Kaduk [Sun, 13 Nov 2011 18:12:50 +0000 (13:12 -0500)]
FBSD: cleanup dvp locking for ISDOTDOT

This is a more correct version of
c2ed2577f9c16df3088158fb593d7aab6e8690d0, which was reverted since
it caused build issues on some versions and kernel panics on others.

We do want to always unlock dvp before calling over the network
in the ISDOTDOT case, but be sure to use the proper spelling
for this operation (as the syntax has changed between FreeBSD versions).
This requires not unlocking dvp right after the afs_lookup() call if
it succeeds, letting us just lock the "child" vp (which is actually
the parent starting from '/') first, and then re-lock dvp.

The error case of afs_lookup() was already handled correctly in
this logic, which is to say that it was incorrect before this change,
attempting to recursively lock dvp which causes a panic.

Reviewed-on: http://gerrit.openafs.org/6127
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 8e14168c9c77850ce0603d56f8aa280f73cb3114)

Change-Id: I2d929875a9b008f0aa0b64bce7971932691d9956
Reviewed-on: http://gerrit.openafs.org/6234
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoFBSD: typo fix
Ben Kaduk [Sun, 23 Oct 2011 15:22:07 +0000 (11:22 -0400)]
FBSD: typo fix

Gerrit/5572 added conditionals on __FreeBSD_version >= 900044, which
is (approximately) when a bunch of kernel API renames happened.
(There has since been a dedicated version bump to 900045 a month
or two post-facto, but 900044 should be fine for now.)
However, 900044 is not 90004.

Reviewed-on: http://gerrit.openafs.org/5657
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit ca8ba7e7a41e61cc943b34196872b72a190432e3)

Change-Id: Ibacd6d037590df0696b8dab8107d36bca470785a
Reviewed-on: http://gerrit.openafs.org/6233
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoremove CopyOnWrite2 and unused vars
Derrick Brashear [Wed, 30 Nov 2011 21:20:23 +0000 (16:20 -0500)]
remove CopyOnWrite2 and unused vars

unused static functions make grumpy compilers grumpy.

(cherry picked from commit 7a6cf450babea4e706392cb8ad83586fa7f8e558)

Change-Id: Ib40be2b9458ca799ba2b808ed86a627c40cf6ec4
Reviewed-on: http://gerrit.openafs.org/6161
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
14 years agoviced: disable accelerated copyonwrite
Derrick Brashear [Sun, 27 Nov 2011 16:23:29 +0000 (11:23 -0500)]
viced: disable accelerated copyonwrite

don't do multistage CoW

FIXES 130295
(cherry picked from commit 97540f78aa333feefe9f567ee71695c1d6451f5c)

Change-Id: I1cd9d54ec9202aa4a11828cd443622413f195687
Reviewed-on: http://gerrit.openafs.org/6160
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
14 years agoUnix CM: Fix PutVolume in afs_BlackListOnce
Simon Wilkinson [Wed, 23 Nov 2011 16:30:55 +0000 (16:30 +0000)]
Unix CM: Fix PutVolume in afs_BlackListOnce

It isn't safe to keep accessing a structure once we have Put our
reference to it.

Reviewed-on: http://gerrit.openafs.org/6117
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 2373547a86c12f72261072971b8d47e6b7cdd4e6)

Change-Id: I013b5d6ecf7705745ab16c8736f32ca7750b933b
Reviewed-on: http://gerrit.openafs.org/6124
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoafs: Leave cellnum alone for explicit mtpt cell
Andrew Deason [Tue, 15 Nov 2011 19:18:48 +0000 (13:18 -0600)]
afs: Leave cellnum alone for explicit mtpt cell

When a mountpoint is given an explicit cell, don't alter cellnum.
Cellnum represents the cell for the parent, and is used for
determining whether or not we're crossing a cell boundary.

Previously, this code forced the mount point to always be treated as
foreign (for a mountpoint prefixed with a cell name), or to always be
treated as local (for a mountpoint prefixed with a cell number).

Reviewed-on: http://gerrit.openafs.org/6051
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit e14dec55e6600edb60ce5184b4ab1f646c68947b)

Change-Id: I8d2b378a95533aabd65e7121000ce34238d728b7
Reviewed-on: http://gerrit.openafs.org/6123
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agodafs: avoid null deref getting volume header
Derrick Brashear [Sun, 6 Nov 2011 21:28:27 +0000 (16:28 -0500)]
dafs: avoid null deref getting volume header

we don't assign hd before dereferencing. stop dereferencing
and just use the queue cursor.

Reviewed-on: http://gerrit.openafs.org/5814
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 00beae8c4e3b390637f20584e676cf86c817dadd)

Change-Id: Iec2dbbf84e4f08f02998c9e998d2ea899ce48a5d
Reviewed-on: http://gerrit.openafs.org/6122
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoLinux: 3: Update specfile to know about 3.* kernels.
Edward Z. Yang [Sun, 27 Nov 2011 00:32:51 +0000 (19:32 -0500)]
Linux: 3: Update specfile to know about 3.* kernels.

Update spec file to be consistent with acinclude.m4 with regards to
sysnames.  We don't bother updating the code inside the legacy kernel
build section, as it doesn't get triggered for 3.* kernels (it should
probably get cleaned up at some point.)

Also, fix a bug in error message printing of unrecognized kernel.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Reviewed-on: http://gerrit.openafs.org/6120
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 0f9214164ad56bfe74d0f2cec8775a312f5128dd)

Change-Id: Ie414751cf01c44a73bf9eaef67c593cced2680d9
Reviewed-on: http://gerrit.openafs.org/6121
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoLinux: make sure backing_dev_info is zeroed
Marc Dionne [Tue, 22 Nov 2011 02:27:06 +0000 (21:27 -0500)]
Linux: make sure backing_dev_info is zeroed

The afs backing_dev_info structure is allocated dynamically
without zeroing out the contents.  In particular there's no
guarantee that congested_fn is NULL, causing spurious oopses
when bdi_congested in the kernel tries to call it.

(adapted from commit 8e97cf6f215d5575c63d86eaec59031399f4beda)

Change-Id: I83755b6bb5ec2fada7e077c00d3d8edf8af1cae4
Reviewed-on: http://gerrit.openafs.org/6104
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoLinux: 3.1: adapt to fsync changes
Marc Dionne [Fri, 2 Sep 2011 21:56:58 +0000 (17:56 -0400)]
Linux: 3.1: adapt to fsync changes

The fsync file operation gets new arguments to specify a range.
Add a configure test to check for the API change.

The inode lock is also pushed down into the operation, so we need
to take it ourselves to keep the original behaviour.

Reviewed-on: http://gerrit.openafs.org/5332
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit cbaefa266d433af3b9a082a360e23a42f161d80f)

Change-Id: Idb6770204b014c62a8611548509240f8b5f950bc
Reviewed-on: http://gerrit.openafs.org/6098
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
14 years agoLinux: 3.2: Use set_nlink to update i_nlink
Anders Kaseorg [Mon, 21 Nov 2011 00:00:00 +0000 (19:00 -0500)]
Linux: 3.2: Use set_nlink to update i_nlink

As of v3.2-rc1~84^2~1, struct inode.i_nlink is now const to prevent
direct modification.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/6096
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit f1dd2d696fb9ab71b4192b156042e0c63019c58a)

Change-Id: I685aa6e8638e8fe864f1a6a7e428dfb6839ebcea
Reviewed-on: http://gerrit.openafs.org/6099
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoLinux: d_delete now takes a const argument
Marc Dionne [Sat, 3 Sep 2011 18:10:50 +0000 (14:10 -0400)]
Linux: d_delete now takes a const argument

The d_delete dentry operation now takes a const argument.  Test for
this and define our function accordingly to avoid warnings.

Reviewed-on: http://gerrit.openafs.org/5335
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit def00ae8ba774f4d7290c29208484dda756dc0e0)

Change-Id: I128a721587f4963849652cb389472a550d81d267
Reviewed-on: http://gerrit.openafs.org/6097
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoredhat: make rpms build on pre-f15 again
Derrick Brashear [Sat, 5 Nov 2011 15:24:43 +0000 (11:24 -0400)]
redhat: make rpms build on pre-f15 again

we don't have systemd everywhere. don't assume it

Reviewed-on: http://gerrit.openafs.org/5813
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 47b010d1e1d0e8bdbbcad73d5aedc19719d5d96a)

Change-Id: I200ca2306b0e6a22cdcb0515641977b2ea6d21a0
Reviewed-on: http://gerrit.openafs.org/6090
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agolinux: Update Packaging to build OpenAFS services for Fedora's systemd
Edward Z. Yang [Tue, 18 Oct 2011 03:16:15 +0000 (23:16 -0400)]
linux: Update Packaging to build OpenAFS services for Fedora's systemd

Fedora 15 now uses systemd (see http://fedoraproject.org/wiki/Systemd)
for the OS init system. While it currently has backwards
compatibility with older SysV-style init scripts, future versions of
Fedora may no longer support it, and OS startup tends to be faster
with the systemd service units. Also, systemd runs all the service's
processes within a linux kernel cgroup.
(see http://www.kernel.org/doc/Documentation/cgroups/cgroups.txt)

This change includes an openafs-client.service and
openafs-server.service unit files for the client and server packages
respectively.

Client
- Loading the openafs module was moved into
/etc/sysconfig/modules/openafs-client.modules. This causes the OS to
load the module on boot. This is the preferred way for modules to be
loaded with Fedora. (See
http://docs.fedoraproject.org/en-US/Fedora/15/html/Deployment_Guide/sec-Persistent_Module_Loading.html
for more details)
- The CellServDB file is generated with sed rather than cat.
This change was made because Systemd doesn't execute as a shell
script, but rather executes processes directly. Rather than invoking
a shell to concatenate the CellServDB.* files, they're written to the
CellServDB file using a sed oneliner.
- Do all of the proper kernel module loading and unloading.

Server
- Since systemd uses cgroups, when the service is shut down, all
processes in the openafs-server.service cgroup will be terminated.

The other changes are standard as per:
    http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd

Original version by Jonathan Billings <jsbillin@umich.edu>.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Reviewed-on: http://gerrit.openafs.org/5637
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Alex Chernyakhovsky <achernya@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 286ffa0d7c4d594ff107b70f9e930271c027a79e)

Change-Id: I653b211ef24fb9010f0a8ff0ad70c11703a64e82
Reviewed-on: http://gerrit.openafs.org/6089
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoLinux: 3.1: update RCU path walking detection in permission i_op
Marc Dionne [Sat, 29 Oct 2011 23:23:07 +0000 (19:23 -0400)]
Linux: 3.1: update RCU path walking detection in permission i_op

The permission() inode operation changed again with kernel 3.1,
back to the form it had before 2.6.38.  This compiles fine,
but is missing the new way of detecting when we get called in
RCU path walking mode, resulting in system hangs.

Reviewed-on: http://gerrit.openafs.org/5740
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 4952df3f0359531e4a660c99c94c51eb0b169f59)

Change-Id: Ibd497309e6699fb585cf70e618373e800b73cbb8
Reviewed-on: http://gerrit.openafs.org/6088
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoklog.krb5: enforce DES for rxkad
Jeffrey Altman [Fri, 14 Oct 2011 13:10:19 +0000 (08:10 -0500)]
klog.krb5: enforce DES for rxkad

0. Always request a TGT regardless of the state of
   writeTicketFile.

1. request des-cbc-crc when requesting a ticket for an
   rxkad service principal

2. check the returned key length to ensure that it matches
   the permitted length of an rxkad key.  If not, generate
   an error instead of overwriting memory and continuing.

FIXES 130278

Reviewed-on: http://gerrit.openafs.org/5619
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 3a9a5783cd1fd73902655f0876e2069b42688c94)

Change-Id: Ia162cb9fc1d67a38cde26e52b9077f5634a62c84
Reviewed-on: http://gerrit.openafs.org/6087
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoSolaris: Specify ARCHFLAGS in CFLAGS
Andrew Deason [Wed, 2 Nov 2011 16:35:42 +0000 (11:35 -0500)]
Solaris: Specify ARCHFLAGS in CFLAGS

Various autoconf tests which use the C compiler may yield different
results depending on whether or not we are compiling for x86 or amd64
on Solaris (different libraries are available, structures may be
different, et al). So, set CFLAGS depending on which arch we are
targeting, so the autoconf results are more consistent with the actual
compilation during the build.

Reviewed-on: http://gerrit.openafs.org/5786
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 5eba97a8960c49aeea957dc94408368e1324eff0)

Change-Id: Idd0f7d2220ae9762af60e96d087e7eb7ee8c0e63
Reviewed-on: http://gerrit.openafs.org/6086
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoDAFS: Deal with exclusive-state volume headers
Andrew Deason [Fri, 4 Nov 2011 17:42:33 +0000 (12:42 -0500)]
DAFS: Deal with exclusive-state volume headers

GetVolumeHeader assumes that headers on the LRU are not associated
with a volume in an exclusive state. This is known to not be true for
some cases when salvage requests are received over FSSYNC, and may be
true in other scenarios. It's easy to just skip such headers, so skip
them.

Reviewed-on: http://gerrit.openafs.org/5808
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit c2ee7b00ddfe8b1b8c296a99f0244eb33c726e8e)

Change-Id: I0eda511071114b01cd8984d30858b0aa9157727a
Reviewed-on: http://gerrit.openafs.org/6085
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoukernel: handle pioctl errors properly in ktc
Derrick Brashear [Fri, 4 Nov 2011 15:43:01 +0000 (11:43 -0400)]
ukernel: handle pioctl errors properly in ktc

the straight return from call_syscall isn't what we want. munge so
e.g. EDOM handling for ktc_GetToken does the right thing.

Reviewed-on: http://gerrit.openafs.org/5807
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit b06c700ee40ca70ef08259af819e2a6084137457)

Change-Id: I8929615940cb4f025bdd04139399f0ceb82955c9
Reviewed-on: http://gerrit.openafs.org/6084
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agosalvager: Implement AskDAFS via SYNC flags
Andrew Deason [Thu, 3 Nov 2011 18:17:33 +0000 (13:17 -0500)]
salvager: Implement AskDAFS via SYNC flags

Instead of probing the DAFS-ness of the fileserver by probing which
FSSYNC opcodes it supports, detect DAFS-ness by looking at the SYNC
response header flags, which explicitly state whether or not the
endpoint is DAFS. This avoids unnecessary "protocol mismatch" log
messages when the endpoint is not DAFS.

Reviewed-on: http://gerrit.openafs.org/5800
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 7fee28bae30c5a65898a2e3fd7149f07e8ca0df6)

Change-Id: I0643b0e61795f39b63783c937e88c4a74c3c8312
Reviewed-on: http://gerrit.openafs.org/6083
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoregen: Fail on failures
Andrew Deason [Tue, 8 Nov 2011 18:52:50 +0000 (12:52 -0600)]
regen: Fail on failures

If something fails, don't ignore the error.

Reviewed-on: http://gerrit.openafs.org/5817
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 6d519cf1234d54630dcfe48f6ecd393e2dfe71dd)

Change-Id: I5e5ac4d843b9dafce7b7f3acadfcdb0901aed214
Reviewed-on: http://gerrit.openafs.org/6082
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoviced: avoid bogus handle in rename
Derrick Brashear [Wed, 9 Nov 2011 15:34:10 +0000 (10:34 -0500)]
viced: avoid bogus handle in rename

because fileptr's handle can be reset during CopyOnWrite
we need to SetDirHandle after that call

FIXES 130215

Reviewed-on: http://gerrit.openafs.org/5818
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit a1669f3e37299c11bf29a458212e03d1bdb22334)

Change-Id: I57e084102048916b04e45aa32792dc91193e43d8
Reviewed-on: http://gerrit.openafs.org/6081
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agovolser: Preserve needsSalvaged during restore
Andrew Deason [Wed, 9 Nov 2011 23:04:09 +0000 (17:04 -0600)]
volser: Preserve needsSalvaged during restore

Some of the routines during a volume restore may set needsSalvaged, if
an inconsistency is detected while writing the given volume data.
However, after the data is read, we set the volume header information
to what was found in the dump stream, ignoring any needsSalvaged that
may have been set.

To ensure that inconsistent volumes in this situation actually get
demand-salvaged (for DAFS) or offlined (non-DAFS), keep the value of
needsSalvaged in the header, if it was set.

Reviewed-on: http://gerrit.openafs.org/5822
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 9ba891676a15512fa58915662cf599ea73eac430)

Change-Id: Iece9f5b03f0454b7f833e4f3e86da4478b4441fe
Reviewed-on: http://gerrit.openafs.org/6080
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agonamei: Remove extraneous rmdir
Andrew Deason [Thu, 10 Nov 2011 17:58:12 +0000 (11:58 -0600)]
namei: Remove extraneous rmdir

We just unlinked the file, so we know we won't be able to rmdir() the
same thing. Give a path one level higher to
namei_RemoveDataDirectories, so we start rmdir()ing at the parent dir.

Reviewed-on: http://gerrit.openafs.org/5833
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit b41e30a55c8aeb6d7f42d74f9eb090232032057f)

Change-Id: Ibd14490e2d85bd78522472203ad57120237bff22
Reviewed-on: http://gerrit.openafs.org/6079
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agonamei: tweak getlinkbyte error handling
Jeffrey Altman [Fri, 11 Nov 2011 16:00:47 +0000 (11:00 -0500)]
namei: tweak getlinkbyte error handling

in the event of a pread error, add the same error exit path
trigger that we have elsewhere

Reviewed-on: http://gerrit.openafs.org/5843
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 51f71e533b20cd875eec8adda71edea044a606da)

Change-Id: I05623d392e7e3446b7b41dcc1778c6aca986bca1
Reviewed-on: http://gerrit.openafs.org/6078
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
14 years agoWindows: Track active RPCs per scache_t
Jeffrey Altman [Sat, 12 Nov 2011 18:45:08 +0000 (13:45 -0500)]
Windows: Track active RPCs per scache_t

It has been noticed that multiple RPCs can be active on
a cm_scache_t object at the same time.  This is especially
true of directory objects with the redirector.  Track the
number of active RPCs and use that number in cm_MergeStatus
when deciding whether or not to discard the cached data for
the object.

Reviewed-on: http://gerrit.openafs.org/6001
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 090f6279c5496f648893606d298c698f376c7ae0)

Change-Id: Ic40b73ae44c47ad6077fcbbe41bf0d783ab776fc
Reviewed-on: http://gerrit.openafs.org/6045
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: Add Vista/Win7 Firewall Configuration
Jeffrey Altman [Sat, 5 Nov 2011 08:10:42 +0000 (04:10 -0400)]
Windows: Add Vista/Win7 Firewall Configuration

Make use of the INetFwPolicy2 COM interface to configure
the Vista/Win7 firewall for all network profile types.

Reviewed-on: http://gerrit.openafs.org/5812
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit b15b4b15822bee87720bb0d78c2ce54051180339)

Change-Id: I3022b2480c7c7273e819d0a10c092f22f4af3800
Reviewed-on: http://gerrit.openafs.org/6044
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: cm_Rename break in 9cf7a628c2ff178b2fa236d2c0a41ca9be315036
Jeffrey Altman [Fri, 28 Oct 2011 21:43:24 +0000 (17:43 -0400)]
Windows: cm_Rename break in 9cf7a628c2ff178b2fa236d2c0a41ca9be315036

9cf7a628c2ff178b2fa236d2c0a41ca9be315036 broke renaming of
a file to a name that does not exist.  Put back the code that
makes that possible with a comment.

Reviewed-on: http://gerrit.openafs.org/5735
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 7a426424b7fb45659f6000a564e8c71a9108a33c)

Change-Id: Ia82ddc46b303cb80380c342d44db437c490b8508
Reviewed-on: http://gerrit.openafs.org/6043
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: out of date version not in current chunk
Jeffrey Altman [Fri, 28 Oct 2011 15:36:10 +0000 (11:36 -0400)]
Windows: out of date version not in current chunk

In buf_GetNewLocked(), the comparision to decide whether a
cm_buf_t is a member of the current chunk must take the data
version into account.  If the data version is out of date, it
is not part of the current chunk and is an object that can be
safely recycled.

Reviewed-on: http://gerrit.openafs.org/5734
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 1dad690fc34fdd8d9df8a3be6d580441b7cae8bb)

Change-Id: I626562d2189182b434f8da0f4f0a6213c5b695fe
Reviewed-on: http://gerrit.openafs.org/6042
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: only flush buffers on shutdown if running
Jeffrey Altman [Thu, 27 Oct 2011 21:57:25 +0000 (17:57 -0400)]
Windows: only flush buffers on shutdown if running

If a service shutdown message is received prior to the
service entering the running state, do not attempt to
buf_CleanAndReset() because the required data structures
and locks are not initialized.

Reviewed-on: http://gerrit.openafs.org/5733
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 9743f5729d1a55513e861bb1334599a8e597de6b)

Change-Id: I2bda1c4a538c83595f2d60ad4661c7e6865c5fc3
Reviewed-on: http://gerrit.openafs.org/6041
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: Do not EEXIST exact match during rename
Jeffrey Altman [Tue, 25 Oct 2011 19:32:11 +0000 (15:32 -0400)]
Windows: Do not EEXIST exact match during rename

AFS Rename operations on the file server will delete a
target file if it exists.  Do not prevent renames because
an exact match of the target name exists in the target
directory.

Reviewed-on: http://gerrit.openafs.org/5731
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 9cf7a628c2ff178b2fa236d2c0a41ca9be315036)

Change-Id: I02c32fab18053e1a37811089812f402d351a6666
Reviewed-on: http://gerrit.openafs.org/6040
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: validate buffer hash tables in cm_MergeStatus
Jeffrey Altman [Wed, 14 Sep 2011 21:46:32 +0000 (17:46 -0400)]
Windows: validate buffer hash tables in cm_MergeStatus

Reviewed-on: http://gerrit.openafs.org/5425
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit cf57eb294f28084cbb138b1a06bc813e14e6d0ec)

Change-Id: Ia685aebdc443113b4ddb968155f306cc53680af9
Reviewed-on: http://gerrit.openafs.org/6039
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: record history of read lock threads
Jeffrey Altman [Sun, 21 Aug 2011 04:38:24 +0000 (00:38 -0400)]
Windows: record history of read lock threads

Maintance an array of up to 32 reader threads that have
acquired a rwlock.  Use it for debugging when things go bad.

Reviewed-on: http://gerrit.openafs.org/5411
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit c9d655b9a6edf02fd92455961445f239f4667821)

Change-Id: Icab5ffc36e4c6245b7d0699596eca66a66bc9538
Reviewed-on: http://gerrit.openafs.org/6038
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: ignore SYNCHRONIZE privilege in cm_CheckNTOpen
Jeffrey Altman [Fri, 9 Sep 2011 16:47:52 +0000 (12:47 -0400)]
Windows: ignore SYNCHRONIZE privilege in cm_CheckNTOpen

SYNCHRONIZE has not meaning for AFS so just ignore it.  Do not
deny an open request because it is set.

Reviewed-on: http://gerrit.openafs.org/5410
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 793fdd3360982c48bf60eefbd9c56b4a3c1e09f0)

Change-Id: Ice8758dcbd0b355c9fdfb5af293b6d670ec8c1e4
Reviewed-on: http://gerrit.openafs.org/6037
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: permit offline volume check to be disabled
Jeffrey Altman [Sun, 4 Sep 2011 18:58:23 +0000 (14:58 -0400)]
Windows: permit offline volume check to be disabled

Setting the registry value to 0 can now be used as a
method of disabling the offline volume check.

Reviewed-on: http://gerrit.openafs.org/5370
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 19a5b5e67c65f0a9109b0fb5410b5ba74ad85b41)

Change-Id: I50dfa3c5387ba8a1cbdd3ca80f9e8dc03e92c404
Reviewed-on: http://gerrit.openafs.org/6036
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: add clean rule to src/afs/NTMakefile
Jeffrey Altman [Tue, 6 Sep 2011 15:57:18 +0000 (11:57 -0400)]
Windows: add clean rule to src/afs/NTMakefile

Reviewed-on: http://gerrit.openafs.org/5368
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 4ec6fd003084b02c299466bcaeac3850be10f79c)

Change-Id: I0cadd04598e78f9b8a5c0774e0636af153a5030c
Reviewed-on: http://gerrit.openafs.org/6035
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: correct comments in cm_BkgStore
Jeffrey Altman [Wed, 7 Sep 2011 17:33:36 +0000 (13:33 -0400)]
Windows: correct comments in cm_BkgStore

Reviewed-on: http://gerrit.openafs.org/5369
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit b6e5493437b942d5550247761dac3311c6d73a86)

Change-Id: I73c2fcab9ccff73e4419d3edf3ffc7395230e6e5
Reviewed-on: http://gerrit.openafs.org/6034
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: remove CM_BUF_CMBKGFETCH flag
Jeffrey Altman [Mon, 14 Dec 2009 18:33:02 +0000 (13:33 -0500)]
Windows: remove CM_BUF_CMBKGFETCH flag

The processing of the CM_BUF_CMBKGFETCH flag adds more
overhead than it prevents.  Get rid of it.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/5359
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit b6f23864ffa380923f50d424063ad0804e407f4a)

Change-Id: I423aa105bad99c70942d6b967a1dde70216fb096
Reviewed-on: http://gerrit.openafs.org/6033
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: use lock conversion in cm_EndDirOp
Jeffrey Altman [Mon, 5 Sep 2011 14:11:09 +0000 (10:11 -0400)]
Windows: use lock conversion in cm_EndDirOp

Instead of dropping the lock for read and reacquiring for write
use lock_ConvertRToW() which will make the change atomicly if
it is possible or place the thread into the wait list if not.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/5360
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 33af0f92e9b8a50c5a6dd17a9065c0ef58597c28)

Change-Id: Id92298fa848becb4131139579fd31b0c5f98a4ad
Reviewed-on: http://gerrit.openafs.org/6032
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: cm_SymLink export created cm_scache_t
Jeffrey Altman [Fri, 2 Sep 2011 17:54:01 +0000 (13:54 -0400)]
Windows: cm_SymLink export created cm_scache_t

Permit the caller to request the cm_scache_t that represents
the created symlink or mount point object.

Reviewed-on: http://gerrit.openafs.org/5355
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 9b0cb614387403ff433cf39f84c13b626b1b9bdc)

Change-Id: I170059255e3bbc7e3ccbd59b66d7d8b11005a94f
Reviewed-on: http://gerrit.openafs.org/6031
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: correct cm_buf use of Head/Tail queues
Jeffrey Altman [Sun, 4 Sep 2011 01:07:13 +0000 (21:07 -0400)]
Windows: correct cm_buf use of Head/Tail queues

The buffer free list least recently used queue has both
head and tail points.  Use the proper versions of the queue
mgmt functions and do not handle edge cases as special cases.

Reviewed-on: http://gerrit.openafs.org/5354
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 537592f6bbda0c659c25ae7068f50504e2a5e116)

Change-Id: I0d5afaf59895f34ced739f4626a351fe41186008
Reviewed-on: http://gerrit.openafs.org/6030
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: remove dead code from cm_scache.c
Jeffrey Altman [Sun, 4 Sep 2011 00:22:19 +0000 (20:22 -0400)]
Windows: remove dead code from cm_scache.c

Reviewed-on: http://gerrit.openafs.org/5353
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 1e23761b7fadc260b32bebb0343a9b5b1de37cf4)

Change-Id: Ifd8cf9ec7b517da80b22853e0f90034586560e0d
Reviewed-on: http://gerrit.openafs.org/6029
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: add logging to smb_IoctlRead
Jeffrey Altman [Sun, 4 Sep 2011 00:06:21 +0000 (20:06 -0400)]
Windows: add logging to smb_IoctlRead

Reviewed-on: http://gerrit.openafs.org/5350
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 69463ac0cb367202485aac9977f8b4c47fb067f2)

Change-Id: I1f72db5148d2f596f4b0b58cb6788a244fd4fa44
Reviewed-on: http://gerrit.openafs.org/6028
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: remove potential data loss warning with cast
Jeffrey Altman [Sun, 4 Sep 2011 00:03:28 +0000 (20:03 -0400)]
Windows: remove potential data loss warning with cast

Reviewed-on: http://gerrit.openafs.org/5349
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 2588dd12478afb96a72f0cd788233ecf2145830f)

Change-Id: I02a87c4980c6ebe6ef671f90e2c6000ab2eeb60e
Reviewed-on: http://gerrit.openafs.org/6027
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agowindows: pass cm_req_t through background ops
Jeffrey Altman [Sat, 3 Sep 2011 23:14:11 +0000 (19:14 -0400)]
windows: pass cm_req_t through background ops

add cm_req_t object to background daemon operations in order to
permit request source to be propagated to the background daemon.

pass a cm_req_t into buf_SetDirty().

Reviewed-on: http://gerrit.openafs.org/5348
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 722843e2df533e8fcf245f2a3b10ef686992deb2)

Change-Id: I2fbc78cf765c534fc6fc673695634fcf946dca0b
Reviewed-on: http://gerrit.openafs.org/6026
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
14 years agoWindows: correct log message in buf_Sync()
Jeffrey Altman [Sat, 3 Sep 2011 23:03:05 +0000 (19:03 -0400)]
Windows: correct log message in buf_Sync()

Reviewed-on: http://gerrit.openafs.org/5347
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 20772897654b58da6f7d4cd0bd2caf169abddd50)

Change-Id: I676a919701c4edfbc130a04c94f4092676a1d53c
Reviewed-on: http://gerrit.openafs.org/6025
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>