7746 Commits

Author SHA1 Message Date
Simon Wilkinson
35293ae270 rxkad: Make the test suite build again
Make the rxkad stress test suite build again.

Reviewed-on: http://gerrit.openafs.org/2832
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit d17adc30027d795068504dc736dac849ed42a884)
Change-Id: I388a7bf87f402cee02695aab4c8d309589995648
Reviewed-on: http://gerrit.openafs.org/2915
2010-10-05 11:52:58 -07:00
Jeffrey Altman
8815bf3992 Rx: Permit MakeDebugCall() be be compiled when RXDEBUG is undefined
If MAKEDEBUGCALL is defined, build MakeDebugCall() even if RXDEBUG
is not defined.

Change-Id: I98d3216e8bf1e1f3b6b62c962d33db316d0f51ac
Reviewed-on: http://gerrit.openafs.org/2818
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ed25a920232cb659c2997c91c5bc92a659ff163a)
Reviewed-on: http://gerrit.openafs.org/2823
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-10-05 07:23:13 -07:00
Jeffrey Altman
a6e4aac08f Rx: Change minimum peer timeout to 2ms
The previous value, 350ms, is historical.  Now that networks are
so much faster, an artificially high timeout value when backed off
results in an extremely long delay before communication can resume.

Change-Id: I6207fb3e5c26a36704abc1f9210af53e0ff1fae6
Reviewed-on: http://gerrit.openafs.org/2815
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c77f2f1369fead87acb440134213ebf6d23f8fd7)
Reviewed-on: http://gerrit.openafs.org/2824
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-09-27 08:32:40 -07:00
Jeffrey Altman
e57578c1d4 Rx: Do not hold call lock across memcpy in rx_ReadProc/rx_WriteProc
1.4.x does not hold the call lock across memcpy operations in
rx_ReadProc, rx_ReadProc32, rx_WriteProc, rx_WriteProc32.  The
claim is that the call curpos, curlen, and nLeft fields which
refer to the current packet being processed will not be touched
by any other thread.  Therefore it is safe to drop the call lock
to permit another thread to add packets to the call while the memcpy
is performed in parallel.

This patchset continues to hold the call lock longer than the
original implementation but does drop it for the length of time
it takes to copy data from the packet buffer to the application
buffer.

Change-Id: I87dacdf541ba50db80ab55e500b38edab5126dc2
Reviewed-on: http://gerrit.openafs.org/2817
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e197c19cedaafa0d2bb59212fb171083f2140041)
Reviewed-on: http://gerrit.openafs.org/2822
2010-09-27 08:32:12 -07:00
Jeffrey Altman
2373bef5cc Rx: Permit udp buffer size to be set in rxperf
Change-Id: I4680e038e2965ca8bc13f76955b85e924435c6af
Reviewed-on: http://gerrit.openafs.org/2816
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 7b9607639816b19fdf1b70b4c04ba984f9bf3613)
Reviewed-on: http://gerrit.openafs.org/2821
2010-09-27 08:32:03 -07:00
Jeffrey Altman
25a0b9f292 Windows: Export additional RX debugging variables from afsrpc.dll
Export

   rxi_nRecvFrags                          @2008 DATA
   rxi_nSendFrags                          @2009 DATA
   rx_initReceiveWindow                    @2010 DATA
   rx_initSendWindow                       @2011 DATA
   rx_intentionallyDroppedPacketsPer100    @2012 DATA
   rx_intentionallyDroppedOnReadPer100     @2013 DATA

so they can be referenced from pthreaded builds of src/rx/test tools.
Exported variables must be present in both FREE and CHECKED builds.

Change-Id: Ia7f3ee0143679bab1ce74f71dc3a996cda1f18a8
Reviewed-on: http://gerrit.openafs.org/2779
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 7ee80a853cebc472d9d9664dbfcccadd1d49d5fc)
Reviewed-on: http://gerrit.openafs.org/2814
2010-09-27 08:31:41 -07:00
Jeffrey Altman
bd9f7b125f Rx: PrintTheseStats should not be dependent on RXDEBUG
When RXDEBUG is not defined, PrintTheseStats generates an error
even though the statistics are in fact available.  The global
variable rx_packetTypes was not being defined without RXDEBUG.

Make rx_packetTypes defined always and permit statistics to
always be printed.

Change-Id: Ife708d34b5d56374c8aff9aa7c941d39b37ca4a1
Reviewed-on: http://gerrit.openafs.org/2778
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit f1183f16285be040b7150414c9563a9bceb53210)
Reviewed-on: http://gerrit.openafs.org/2813
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
2010-09-27 08:31:31 -07:00
Jeffrey Altman
e7bd67e5bd Rx: move TSFPQ prototypes from rx_globals.h to rx_protoypes.h
Function prototypes belong in rx_prototypes.h not in rx_globals.h.

Remove EXT macro from function prototypes as functions do not
require special treatment in order to be exported by a DLL on Windows.

Change-Id: Ieb617db634f2cfa57410e77e276c703311304547
Reviewed-on: http://gerrit.openafs.org/2777
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 00afdbed0ff474aaf45a49b157843af9cb8483ad)
Reviewed-on: http://gerrit.openafs.org/2812
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
2010-09-27 08:31:20 -07:00
Jeffrey Altman
36ce1b03e4 Rx: properly compute dataPacketsReSent statistic
The global dataPacketsReSent statistic should be the sum of all
peer->reSends and dataPacketsSent should not include the count of
resent packets.  Prior to this patchset, dataPacketsSent included
the resent packets and dataPacketsReSent was computed as the number
of requests for Ack instead of the number of packets resent.

Change-Id: I969003f7ec1805d09c14ac342453f86fdb5df99a
Reviewed-on: http://gerrit.openafs.org/2776
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8549ebe0a81ac9a526d13f96ba63e048d8b77aa7)
Reviewed-on: http://gerrit.openafs.org/2811
2010-09-27 08:31:10 -07:00
Jeffrey Altman
88168412f3 Rx: always use tservice variable in rxi_ServerProc
Since tservice has been assigned to call->conn->service,
use it instead of call->conn->service when calling
executeRequestProc(call)

Change-Id: Id26c4c63f054bcd1e3ef5349900c910e3c9cf2be
Reviewed-on: http://gerrit.openafs.org/2775
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 72cadfd86a0efc0079639671d613005ff403ccc4)
Reviewed-on: http://gerrit.openafs.org/2810
2010-09-27 08:31:02 -07:00
Jeffrey Altman
ffaf0a53ad Windows: Release builds of Rx should be lean and mean
Only build checked builds of Rx with
-DRXDEBUG -DRXDEBUG_PACKET -DRX_TRACK_PACKETS -DRX_REFCOUNT_CHECK

Change-Id: Ib4666d30b1e48eca172331353d9e376b2516f183
Reviewed-on: http://gerrit.openafs.org/2774
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e77c7be7537cbcbee77a297b5b52a6287462462f)
Reviewed-on: http://gerrit.openafs.org/2809
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-09-27 08:30:09 -07:00
Jeffrey Altman
e1f1286dc2 Rx: Only backoff the peer timeout once
If a packet is missing, the peer timeout is backed off to provide
a new starting point for timeout computation.  The backoff state
must be stored in the peer object to ensure that multiple failures
do not result in more than one backoff before a successfully received
packet is available for recomputation.

Change-Id: I6794b3a020801ff421e4ed776afb581962b111a9
Reviewed-on: http://gerrit.openafs.org/2787
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 3b4cad3b78ec5df7253067c70e19c066552d7145)
Reviewed-on: http://gerrit.openafs.org/2808
2010-09-27 08:29:48 -07:00
Jeffrey Altman
6a8e622bbe Rx: only compute peer bytes sent and received if rx_stats_active
Computing the bytes sent and received is an expensive operation.
If rx statistics collection has been disabled we should not collect
the peer data.  The most expensive operation is the rx_FindPeer()
call that is performed during rxi_ReadPacket().  rxi_ReadPacket()
is processed by the rx listener thread which must be as fast as
possible.

Change-Id: I5403c88aa85f9049fe50a9c1f3dbaad7d8b802bd
Reviewed-on: http://gerrit.openafs.org/2782
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 7d16c8b84ac8cc0251231819bfb0eefc2040322a)
Reviewed-on: http://gerrit.openafs.org/2807
2010-09-27 08:29:39 -07:00
Jeffrey Altman
ada57bb70e Rx: avoid lock churn in rxi_ReceiveAckPacket
rxi_ReceiveAckPacket can acquire and drop the conn_data_lock several
times and acquires and drops the peer_lock unnecessarily.  This patchset
adds a variable to track whether the conn_data_lock is held in order
to avoid the need to drop it and reacquire it based upon conditional
operations.  It also relocates the peer->maxPacketSize computations
in order to consolidate the work performed under the peer_lock.

Change-Id: I0bc9e42e8ef198a04315f9f2df529073ce9dfd03
Reviewed-on: http://gerrit.openafs.org/2781
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c59ce29602086f795d5fbaef6a5f88fae9dd2dea)
Reviewed-on: http://gerrit.openafs.org/2806
2010-09-27 08:29:28 -07:00
Jeffrey Altman
16ab9e7192 Rx: Build rxperf test application on Windows
rxperf made assumptions that it was built against LWP, used buffer
sizes for read/write that were too small, made use of non-portable
types, and set signal handlers that are unsupported.

Change-Id: I55515cac0f441116df7fd0aaf100fb3ae99b220f
Reviewed-on: http://gerrit.openafs.org/2773
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 449976acd54ff46fd6cdb9a6e12acf3789665bcf)
Reviewed-on: http://gerrit.openafs.org/2805
2010-09-27 08:29:18 -07:00
Jeffrey Altman
d36d8cb425 Rx: Move rxperf test application to src/rx/tests
rxperf is a test application.  Move it to the tests directory

Change-Id: I946a8026760d860667ea5707d8a3e0d3b895d908
Reviewed-on: http://gerrit.openafs.org/2772
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5c3a1ed88de16db4c2081bbf1a4e397ce459bcf3)
Reviewed-on: http://gerrit.openafs.org/2804
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-09-27 08:29:08 -07:00
Jeffrey Altman
430cefbeac Rx: cleanup testclient and testserver test applications
Permit testclient and testserver to be built on Windows as
pthreaded applications.

Remove warnings.  Fix prototypes.  Remove variable declarations
for rx library variables defined in rx_globals.h.

Increase the buffer sizes.  Disable use of packet dropping when
the library is built without RXDEBUG.

Change-Id: Ic8483eb64cbed4958baf8fd054e01c7c40832599
Reviewed-on: http://gerrit.openafs.org/2780
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 7ded3209a2fbd8d0108f9322d708551e93b6ef76)
Reviewed-on: http://gerrit.openafs.org/2803
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-09-27 08:28:56 -07:00
Simon Wilkinson
ade14eedf3 Linux: print after BUG() is pretty useless
Calling BUG() panics the machine, so having a print statement with
further debugging information after it doesn't help much.

Swap the ordering, so we at least see the message.

Change-Id: I3aa3b8ba5faaa40cef7bb046093b322212eea2b8
Reviewed-on: http://gerrit.openafs.org/2754
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ff100901e0da8d236c7ae8b4d478600146d8f182)
Reviewed-on: http://gerrit.openafs.org/2802
2010-09-27 08:28:47 -07:00
Andrew Deason
1ac380b0d3 libafs: Fix pioctl get/putInt alignment issues
We don't know if the buffer for pioctl data is aligned to anything, so
we can't just dereference the given pointer as an int or anything
else. So, just memcpy the data in for ints and such; conveniently,
afs_pd_getBytes and afs_pd_putBytes can do this for us, so just use
that.

Change-Id: Id1abdae55308db6fe1e13f541a5d776daa6af934
Reviewed-on: http://gerrit.openafs.org/2763
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8fd83543b60aefb4b7c5a0116d1538a89f58bbb3)
Reviewed-on: http://gerrit.openafs.org/2801
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-09-27 08:28:34 -07:00
Marc Dionne
cb978ebcb6 vlserver: Set but not used variables
Remove some variables that are set but never used in the vlserver
directory:
- n1,n2,n3 and n4 in vlclient.c appear to have never been used even
in the original IBM code
- some variables in vldb_check.c that are no longer used after some
recent changes

Spotted by gcc 4.6

Change-Id: Icd9e7da151b3a485c917ed5bd99eb26998dfa818
Reviewed-on: http://gerrit.openafs.org/2784
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ee3538218d342bb74ab849763421b9ec075251b3)
Reviewed-on: http://gerrit.openafs.org/2800
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-09-27 08:28:24 -07:00
Andrew Deason
3bbcfde65e volser: Delete timed-out temporary volumes
When a transaction times out on a volume, delete the volume if it is a
temporary volume (destroyMe is set). This prevents half-created
volumes from accumulating, which can take up space and screw up
certain vol ops in some versions.

Change-Id: I94e9adc767b84a2a32d980f508af33b823560950
Reviewed-on: http://gerrit.openafs.org/2760
Tested-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 bc56f5cc97a982ee29219e6f258b372dbfe1a020)
Reviewed-on: http://gerrit.openafs.org/2799
2010-09-27 08:28:13 -07:00
Marc Dionne
3313954731 butc: Set but unused variables
Remove unused variable taskId

writeData() systematically returns 0, so make it void and adapt
call sites that assigned the return value but never used it.
Also move the function up in the file to avoid the need for a
forward declaration, and make it static since it's only used here.

Spotted by gcc 4.6

Change-Id: I2f61c0395796498175f2cb9131066b00657f99a7
Reviewed-on: http://gerrit.openafs.org/2785
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit f1796b0f4ad0202ad32e06bb849f443984cf22b5)
Reviewed-on: http://gerrit.openafs.org/2798
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-09-27 08:28:01 -07:00
Marc Dionne
bfd269535f Linux: normalize error return for emulated syscalls
pagsh and other code expect setpag() and pioctl() to behave like
a regular syscall or pioctl, that is to return -1 on error, with
errno set to the specific error code.
On Linux, the underlying emulation does a straight return of any
error code it gets from the ioctl, and errors are not properly
caught by the callers.

As an example, pagsh won't detect an error from setpag such as
exceeding a keyring quota limit.  With this patch, the user
will see this:

$ pagsh
setpag: Disk quota exceeded
sh-4.1$

The code in proc_afs_syscall is modified to set errno to the error
code and to set errorcode to -1 in case of error.

proc_afs_sycall is reindented while we're changing code there.

FIXES 126230

Change-Id: I945f2d28eb0ae26c7f42502c90eb2e6e95c29a58
Reviewed-on: http://gerrit.openafs.org/2770
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 0bc837f68a72ba1f75d940cc5dd057774d9f36bb)
Reviewed-on: http://gerrit.openafs.org/2797
2010-09-27 08:27:39 -07:00
Derrick Brashear
b83ceefb2d disable Rx packet tracking
minimize the impact of Rx packet tracking. in particular, do no
extra queue scans, which means the rest of the state which tracks
where a packet is now isn't of use. make it possible to re-enable.

Change-Id: I5b9ed039a0394edcea48bb46729cd2ce2f71d4b9
Reviewed-on: http://gerrit.openafs.org/2762
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 4bbf0dae237e01127f4d1a4d913f00e8dad859a3)
Reviewed-on: http://gerrit.openafs.org/2796
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-09-27 08:27:20 -07:00
Marc Dionne
e18a8f6206 Always check return code from iod_Write
The return code from iod_Write is checked at every call site
in the file, except this one.  Check it, and return VOLSERDUMPERROR
if appropriate.

Spotted by a set but unused warning from gcc 4.6

Change-Id: I84f38a4b3b1e37c25be9c76702b0d2818058454e
Reviewed-on: http://gerrit.openafs.org/2733
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e0708617b8f5df625b6ad62920665e704f1374f7)
Reviewed-on: http://gerrit.openafs.org/2795
2010-09-27 08:27:09 -07:00
Marc Dionne
db86d1a976 rx: Set but not used variables
Remove some unused variables in the rx code.
These generate warnings with gcc 4.6.

Change-Id: I1e19c82cd05bcd47a65d77079019f1f0b6704826
Reviewed-on: http://gerrit.openafs.org/2732
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a8cf472fd1723fa0e5f4edc34e470443c941f017)
Reviewed-on: http://gerrit.openafs.org/2794
2010-09-27 08:26:48 -07:00
Simon Wilkinson
0b80be05c2 Ignore *.dSYM files in working directory
Failed Mac OS X debugging builds leave *.dSYM directories lying
around the tree, which just litter the contents of "git status".

So, ignore them.

Change-Id: Ic2b79f299d724b770bf83cb24f2aac7c4063efdb
Reviewed-on: http://gerrit.openafs.org/2744
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 290204c6e92d61c5b12b90d09e8202731caa0400)
Reviewed-on: http://gerrit.openafs.org/2793
2010-09-27 08:26:37 -07:00
Simon Wilkinson
02f39f7b16 Add config.log to gitignore globally
When you end up explicitly regenerating chosen Makefiles by
running ../../config.status Makefile, the working tree ends up littered
with config.log files.

Currently, we only ignore config.log in the top directory - extend this
so that it's ignored across the tree.

Change-Id: If3cfec82fbf78e97ee769b36315ba23dcfe8a950
Reviewed-on: http://gerrit.openafs.org/2743
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 4a353545c3f0e91cc85d7feb379997a1eda9f6e3)
Reviewed-on: http://gerrit.openafs.org/2792
2010-09-27 08:26:25 -07:00
Simon Wilkinson
3eb6260147 RX: Make the sample client and server build
Make the RX sample client and server build again

Change-Id: I81ce12eadcb4150dd503e41f9a7fd1a850d31a11
Reviewed-on: http://gerrit.openafs.org/2737
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 71171262602d7f261adbffd5047266e94c4a6f92)
Reviewed-on: http://gerrit.openafs.org/2791
2010-09-27 08:26:14 -07:00
Simon Wilkinson
e106ac54b7 vlserver: Use com_err for Ubik error messages
Use com_err to return a sensible string, rather than just an error code,
for errors with Ubik initialisation.

This has the specific benefit that the error when the database directory
doesn't exist, or isn't readable, becomes

    Ubik init failed: file not found when processing dbase"
rather than
    Ubik init failed with code 5382

Change-Id: I5f770377668a7f545cad7e422f28afd7c9f9888d
Reviewed-on: http://gerrit.openafs.org/2735
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 6380213d296c138349c77fa4a51655fac23cfeea)
Reviewed-on: http://gerrit.openafs.org/2790
2010-09-27 08:26:03 -07:00
Marc Dionne
fb5c2b4c1f Warning fix for gcc 4.5 "operation may be undefined" warnings
The inc_header_word and set_header_word macros make repeated use of their
argument, which triggers many (~30) warnings with gcc 4.5, like this one:

./ptutils.c:473:6: warning: operation on ‘cheader.foreigncount’ may be undefined

Removing the cast to afs_int32 in the macros gets rid of the warning,
and should be safe since we're just getting a small positive integer value
- the offset of the member in the structure - and passing it to the
pr_Write function which expects an afs_int32.

Change-Id: Ie493520f874cddbb4b7f9f7ebe4b3922a848d0d0
Reviewed-on: http://gerrit.openafs.org/2729
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit d69914a5f0580f8048072d3b734558ea5b7b2df5)
Reviewed-on: http://gerrit.openafs.org/2789
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-09-27 08:25:53 -07:00
Michael Meffie
a16b1119b8 manpage correction for restorevol -file option
The restorevol -file option specifies which file to read.

Change-Id: I5c03eaaf8bf82fc6d3fb83ff08e8278257e7b65f
Reviewed-on: http://gerrit.openafs.org/2728
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 92ff0028f2e6a2f24dd5369f9b31e9852bf92abc)
Reviewed-on: http://gerrit.openafs.org/2788
2010-09-27 08:25:46 -07:00
Russ Allbery
e36b4e0068 Update bos create man page for new naming of demand-attach binaries
The demand-attach fileserver binaries now have a "da" prefix.  Adjust
the documentation in the man page for bos create accordingly, and add
the new binaries to SEE ALSO.

Change-Id: Ib70bad87aaf8bfc483ffbfe402db01c178e6c4e4
Reviewed-on: http://gerrit.openafs.org/2830
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 82b7327b5ba66c6ddbc898ad383b4e5f2b08ec38)
Reviewed-on: http://gerrit.openafs.org/2845
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-09-24 17:04:12 -07:00
Russ Allbery
a2cf6b8d9f Fix POD errors in fileserver and dasalvager
Fix missing newlines before =back commands.

Change-Id: If8e65c94f48c271c37c1b4bbec1b17d383c8375d
Reviewed-on: http://gerrit.openafs.org/2831
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 10281b5be240707ed2eb75bdb68d9d23ff0011c8)
Reviewed-on: http://gerrit.openafs.org/2846
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-09-24 17:00:12 -07:00
Russ Allbery
f7f366d0ee Link dafssync-debug(8) to fssync-debug(8)
The two commands are documented identically for right now, so just link
the dafssync-debug man page to the fssync-debug man page.  Remove the
incorrect statement in the man page that fssync-debug only works with
demand-attach.

FIXES 128166

Change-Id: I812641ad7a345c7f5412c3c97ed1ba393e981639
Reviewed-on: http://gerrit.openafs.org/2836
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 68d074d8aa98e76fb85289c69300d17695b98d0b)
Reviewed-on: http://gerrit.openafs.org/2847
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-09-24 16:59:41 -07:00
Simon Wilkinson
ca2a73638f libuafs: Don't #define user
libuafs used to #define user to usr_user, so that any references to
'struct user' would become 'struct usr_user'. However, none of the
kernel code uses struct user, and this #define conflicts with the
definitions in sys/user.h on Linux.

So, just remove it.

Thanks to Russ Allbery for the original problem report.

Change-Id: I7868c8ddade2df626f5ecae597144641dfc551b7
Reviewed-on: http://gerrit.openafs.org/2838
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 200a9947f548eb7158e92de62ddaa76fcfe4ba46)
Reviewed-on: http://gerrit.openafs.org/2839
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-09-24 16:57:51 -07:00
Russ Allbery
c12a6ec003 Add NEWS entries for OpenAFS 1.5.77 and 1.5.76
Based on the public announcement for 1.5.77.

Change-Id: Ic368e16e16b03a79de6196a2e355eca0f420de77
Reviewed-on: http://gerrit.openafs.org/2819
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 0a9e57c45e4412d9dac7050d693a22044ddc1d0f)
Reviewed-on: http://gerrit.openafs.org/2820
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-09-21 13:37:36 -07:00
Steve Simmons
9faff2047e Add new file src/venus/cacheout to things that should be ignored.
Reviewed-on: http://gerrit.openafs.org/2719
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 41acfb91fa7fefae1f9a69aadc187a1403ec5827)
Change-Id: I0d95c9f63a20814fbb882db0b8c063e179d62b9c
Reviewed-on: http://gerrit.openafs.org/2722
2010-09-08 08:42:04 -07:00
Derrick Brashear
dbd2e6c120 openafs 1.5.77
make 1.5.77 in various places we need it

Change-Id: Ic7e487ce76f86f50d2565e75a3b2f7642ecadd87
Reviewed-on: http://gerrit.openafs.org/2713
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
openafs-devel-1_5_77
2010-09-07 21:01:04 -07:00
Derrick Brashear
fba7087c98 ubik recovery and remote use correct file number
the file propagation "out of band" changes should not hardcode recovery
on file 0, but instead work on any file the interface is acting on.
use the provided file number.

Reviewed-on: http://gerrit.openafs.org/2715
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit f8ff458ef02d5ef49bc467304e40571d871385c8)
Change-Id: I2cf324c9759f9878c5b37603480a9c803c041641
Reviewed-on: http://gerrit.openafs.org/2717
2010-09-07 21:00:40 -07:00
Jeffrey Altman
fce40951d4 Windows: 1.5.77 Change Log summary
Change-Id: Ic0362956470ddb76fac64d21927b3e51b7980ea6
Reviewed-on: http://gerrit.openafs.org/2710
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 99811e3e5faf5917975d7ec3c3d16e2ed9a5bf50)
Reviewed-on: http://gerrit.openafs.org/2712
2010-09-07 20:48:29 -07:00
Jeffrey Altman
cb498f02f7 Windows: revise NTSTATUS response for ALLBUSY, ALLOFFLINE, and ALLDOWN
Replace STATUS_IO_TIMEOUT with RPC_NT_SERVER_TOO_BUSY for CM_ERROR_ALLBUSY.

Replace STATUS_PATH_NOT_FOUND with RPC_NT_SERVER_UNAVAILABLE for
CM_ERROR_ALLOFFLINE and CM_ERROR_ALLBUSY.

These errors provide a more meaningful message to end users when
a failure occurs.

LICENSE MIT

Change-Id: I34483f8f696285477fa0f8a8dac3b0ff33dee6b4
Reviewed-on: http://gerrit.openafs.org/2663
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit de441ba420b8fc38ce1b36bee06097f21cc6514b)
Reviewed-on: http://gerrit.openafs.org/2714
2010-09-07 20:48:08 -07:00
Jeffrey Altman
fcca1f7bbe Windows: Improve SMB detection of Local System account
Depending on the authentication method, the smb session authenticated
name for the "local system" account may be the nul string.  In this
case it is impossible to use the name to determine if the authenticated
entity is the "local system" account as required by smb_SetToken.
To work around this problem, smb_AuthenticateUserExt() will now obtain
the Security Identifier (SID) for the authenticated account.  The string
representation of the SID will be used in place of the name by
smb_ReceiveV3SessionSetupX() when constructing the smb_user_t object.
A new flag, SMB_USERNAMEFLAG_SID, indicates when the name is in fact
a SID.

smb_userIsLocalSystem() checks for the SMB_USERNAMEFLAG_SID flag and
performs a SID comparison when it is set.

smb_SetToken() will accept either MACHINE\user or a SID string as
the smbname.  It will obtain the SID if possible and create a SID-based
smb_user_t.

It is possible that a SYSTEM service will use an anonymous (S-1-5-7)
SMB connection.  In that case, we also check the RPC Impersonation
SID to see if it is SYSTEM.  If so, the RPC identity supercedes the
SMB identity for SetToken.

smb_IoctlRead, smb_IoctlV3Read and smb_IoctlRawRead are now all
consistent with regards to name processing.

Fixed a couple of comments as well.

FIXES 128022

LICENSE MIT

Change-Id: I8f9ccd4a4dddea52d151288855c7e129e2f31b28
Reviewed-on: http://gerrit.openafs.org/2709
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 19f50c13b4542cc84c33eaca4b2cc6ac0b75eb98)
Reviewed-on: http://gerrit.openafs.org/2711
2010-09-07 20:47:44 -07:00
Jeffrey Altman
81e9b15f56 Windows: Modify signature of buf_CleanAsync and buf_CleanAsyncLocked
The buf_CleanAsync() and buf_CleanAsyncLocked() signature does
not include a cm_scache_t pointer even though buf_CleanAsyncLocked()
needs a pointer to the matching cm_scache_t object.  There are
some calls when the cm_scache_t object is already known.  For those
cases it is more efficient to avoid the additional lookup especially
when buf_CleanAsync*() is being called on every buffer associated
with the cm_scache_t object.

At the same time add a flags field and a constant
CM_BUF_WRITE_SCP_LOCKED to permit the lock state of the cm_scache_t
to be passed in.

Finally, fix up the usage in buf_FlushCleanPages() which gains
the most from these changes.

LICENSE MIT

Change-Id: I3726441ff83a89e24d790174ca71396d633f1be6
Reviewed-on: http://gerrit.openafs.org/2662
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 1ef135110b7d850e2c40bbbb6b7de69c76872fa9)
Reviewed-on: http://gerrit.openafs.org/2708
2010-09-07 20:47:21 -07:00
Jeffrey Altman
a7e9c83167 Windows: Permit cm_scache rwlock to be dropped when "Stablized"
The cm_buf_opts_t cm_BufStabilize() function was implemented
such that holding the cm_scache_t.rw lock had to be exclusively
held until cm_BufUnstablize() was called.  Unfortunately, this
prevents using Stabilize/Unstabilize to protect the cm_scache_t
during Flush operations as the cm_scache_t.rw lock must be
acquired after the cm_buf_t mutex and not before it.

This patchset reimplements the synchronization logic using
the new CM_SCACHEFLAG_SIZESETTING flag and cm_SyncOp().

LICENSE MIT

Change-Id: Iaada83f7f3b75bb3b213b33b2399e900e48a2fbc
Reviewed-on: http://gerrit.openafs.org/2661
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit fa961c02fbb7dc54fa4c02c38dfd07c44eb696d3)
Reviewed-on: http://gerrit.openafs.org/2707
2010-09-07 20:46:53 -07:00
Jeffrey Altman
da0a17c9fc Windows: fail cm_CheckNTOpen if READ|DELETE for readonly file
If the readonly file attribute is set (stored as a unix mode)
then a CreateFile operation should fail if the file is opened
for DELETE in combination with any other privilege.

LICENSE MIT

Change-Id: Ie8ebb6d230cf65d9ce2411bab2fcc4e561081505
Reviewed-on: http://gerrit.openafs.org/2660
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit ee26ce51f67c7a91d843184374240bbc29e1660b)
Reviewed-on: http://gerrit.openafs.org/2706
2010-09-07 20:46:33 -07:00
Jeffrey Altman
695fc9ba01 Windows: Add validation for directory buffer contents
If the directory buffer contents are garbage we can crash
the service.  Add some simple validation checks to ensure
that cm_dirEntry_t objects have the correct flag value and
that the name strings are not too long.

LICENSE BSD

Change-Id: If4a276007ff7a21a641825037a1035ea20db79c5
Reviewed-on: http://gerrit.openafs.org/2658
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 72584be7fb0b6eb01ca5cb9c0703e9bc1b92f547)
Reviewed-on: http://gerrit.openafs.org/2705
2010-09-07 20:46:15 -07:00
Jeffrey Altman
8c4d5075c3 Windows: cm_TryBulkStatRPC must process VIO errors
If the bulkStat errorCode indicates that a particular object
is inaccessible due to a VIO error, we must update the server
status appropriately in order to permit failover.

LICENSE MIT

Change-Id: I19ce3d2c5b138d519fb1c437f6d5109d7d8b1310
Reviewed-on: http://gerrit.openafs.org/2657
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 3f69933c4243d6861d5cce701c28f2dee088e6c2)
Reviewed-on: http://gerrit.openafs.org/2704
2010-09-07 20:45:52 -07:00
Jeffrey Altman
0ed1eca089 Windows: better handle RX_MSGSIZE errors
An RX_MSGSIZE error is returned by the new PMTU detection
code.  It is critical that such an error result in a retry of
the operation that failed.  Otherwise, the PMTU detection can't
work and the server will be marked down.

Secondly, it is important that such errors not leak to the
application layer.  Map them to CM_ERROR_RETRY in all cases.

LICENSE MIT

Change-Id: I966fe259080bd31ec60fdb6715f54e18e190c790
Reviewed-on: http://gerrit.openafs.org/2656
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit b11ff643b5665ec252ca96dc19af1446fb72481f)
Reviewed-on: http://gerrit.openafs.org/2703
2010-09-07 20:45:28 -07:00
Jeffrey Altman
5010d19abc Windows: print the value of cm_OfflineROIsValid to afsd_init.log
If we say we are printing the value of cm_OfflineROIsValid,
do so and not cm_deleteReadOnly.

LICENSE MIT

Change-Id: I8b0bc73798feea413f8ce79f9965664fc050ef76
Reviewed-on: http://gerrit.openafs.org/2655
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 874c5ca8359d49703f1f37d7fb70204c182d0f86)
Reviewed-on: http://gerrit.openafs.org/2702
2010-09-07 20:44:09 -07:00