Commit Graph

8710 Commits

Author SHA1 Message Date
Jeffrey Altman
070383939d Windows: Make use of SMB interface a runtime decision
Add 'smb_Enabled' and 'RDR_Initialized' flag variables.
Default smb_Enabled to true and RDR_Initialized to false.

Add registry value "SMBInterfaceEnabled" to permit disabling
the SMB interface.

If the redirector interface is initialized (a future set of
patchsets will add it) disable the SMB interface at runtime.

Change-Id: I354e121001d942421aa98490b62b710ac175051f
Reviewed-on: http://gerrit.openafs.org/5337
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-04 08:49:45 -07:00
Jeffrey Altman
f7d0e800eb Windows: pioctl path retrying with \\afs\all
When the redirector is in use, \\AFS is identified as being an AFS path.
With the SMB redirector, \\AFS was not considered a valid path.  In order
to simulate the notion of \\AFS being the root volume, failover logic
was added to the symlink and fs modules being triggered that
would retry a request for \\afs\foo as \\afs\all\foo.

The VIOC_SYMLINK and VIOC_AFS_CREATE_MT_PT pioctls are broken.  The
'path' parameter that is passed in contains the directory entry that
is to be created.  Since the AFS redirector maps \\afs to the root.afs
volume the "foo" in \\afs\foo must exist in order for the
_._AFS_IOCTL_._ special file to be opened.

This patch implements an alternative to the failover.  If the opcode
is one of the two listed above and the input path is a UNC path,
then the path is re-written as \\AFS\all.  This is necessary because
the repeated attempts to open a UNC path through the SMB redirector
with different usernames can result in the smb session becoming
disconnected.  If this is done when the SYSTEM account is in use,
the tokens associated with the connection can be lost.

LICENSE MIT

Change-Id: I2c2f6c08c7ca5c137062d34e1353731b6f78f633
Reviewed-on: http://gerrit.openafs.org/5336
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-03 15:46:15 -07:00
Jeffrey Altman
2271d481d3 Windows: remove MULTIHOMED ifdef
All builds include the MULTIHOMED functionality.
Get rid of the #ifdef MULTIHOMED.

Change-Id: Ib9ea4597fcda47aa9dce0fbf92675a6606e2ec6e
Reviewed-on: http://gerrit.openafs.org/5333
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-02 21:43:54 -07:00
Jeffrey Altman
8127e9332b Windows: missing ! in update volume location
The check to see if the volume name is numeric or not was
missing a ! in order to perform the correct test.  Add it.

Change-Id: I4626f4bdcf601cd1b421dd3d373edd634cc78527
Reviewed-on: http://gerrit.openafs.org/5331
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-02 21:43:36 -07:00
Jeffrey Altman
f37b6dfaf0 Windows: improve handling of volume rename
The windows cache manager tracks volumes by volume group.
Up to this point all volume location updates have been performed
by the volume name.  What if the volume name was altered?  In this
case the volume location information for the in use volume ids will
fail until a mount point to the new name is queried.  Before
marking the volume group as non-existent attempt to perform a
lookup using either the volume id for the readwrite or readonly
volume.

Change-Id: I51b383150b0186867e1c51a28b01e8483ee470f2
Reviewed-on: http://gerrit.openafs.org/5330
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-02 21:43:13 -07:00
Jeffrey Altman
9563dd68fc Windows: refactor volume location updates
Break out the VL_GetEntryByName RPC calls into support
functions so we can reduce the amount of duplicated code.

Change-Id: If4a26514959d3fd82e4b583a993ccea393267fdd
Reviewed-on: http://gerrit.openafs.org/5329
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-02 21:42:56 -07:00
Derrick Brashear
85f917d076 macos: update 32 bit kernel build flags
this is what the current xcode uses. do the same.

Change-Id: I3ea2f3df6e0f39aafb421f6b0854af5d85659742
Reviewed-on: http://gerrit.openafs.org/5205
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-02 05:48:12 -07:00
Derrick Brashear
16dff61e14 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.

Change-Id: I648900849a5a7349adc686658872706bd7024c90
Reviewed-on: http://gerrit.openafs.org/5303
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-31 11:37:54 -07:00
Derrick Brashear
12fa5b859b 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))

Change-Id: If295d0b9ce347c1cc24df12cd9934a30dce2a3c6
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>
2011-08-31 11:37:21 -07:00
Derrick Brashear
24287ff015 redhat: mockbuild updates for repoquery
for starters, mock should be careful not to use parent yum cache
when running repoquery, the host runs it, we want the guests's
yum cache. be careful to not attempt to use the parent's yum cache
(in the default config).

additionally, we need to not try to build 64 bit kernel modules in
32 bit chroots. expand the list of rpms while ejecting any which are
64 bit if we're 32.

additionally, blacklist kernels which are the wrong osver.

Change-Id: Id2a68cf66ddae57458c9f97314cd492e7b5132a8
Reviewed-on: http://gerrit.openafs.org/5322
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2011-08-30 18:33:41 -07:00
Jeffrey Altman
8d4f65c302 Windows: correct CheckOfflineVolumeState logic
Do not blindly set the return 'online' state to TRUE if
the state has not in fact changed.

Do not blindly clear the 'alldown' flag without checking the
actual 'down' state of the file server.

Change-Id: Iaad401be067513e2bf42609f0b0d407ba5c6302d
Reviewed-on: http://gerrit.openafs.org/5323
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-30 08:30:13 -07:00
Michael Meffie
130144850c xstat: cm xstat time values are 32 bit
The kernel space cm xstat time structures are implemented as 32
bit values in memory and on the wire.  Define the client side
xstat userspace structures as 32 bit time values as well to avoid
size mismatches on systems with native 64 bit time values.

Change-Id: I857ea48bf8e12ec006ef24affb2e65a105ce27bb
Reviewed-on: http://gerrit.openafs.org/5237
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-29 14:17:19 -07:00
Derrick Brashear
33bb5218ba 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.

Change-Id: I6e9635dfe1fe6d4633486acf1e9cc35a96f33cd6
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>
2011-08-29 14:09:27 -07:00
Jeffrey Altman
3d4e111dd6 Windows: afslogon network provider debug registry value
create a new TransarcAFSDaemon\NetworkProvider "Debug" value
to be used for activating the network provider debugging.
The overlapping use of TransarcAFSDaemon\Parameters "TraceOption"
is just too confusing.

Permit both methods to be used.

Change-Id: I4ba233b38bda547af35aa4b363edc819bcc3792c
Reviewed-on: http://gerrit.openafs.org/5316
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-29 14:04:08 -07:00
Jeffrey Altman
971a103cd0 Windows: afslogon NPLogonNotify exit on KTC_NOCM
If the service has started but is not responding to pioctls,
permit the NPLogonNotify() routine to exit.

Change-Id: I1ed4ac7a7fed5d86d607ecfd5e027f62ec26a82f
Reviewed-on: http://gerrit.openafs.org/5315
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-29 13:26:53 -07:00
Jeffrey Altman
9052974812 Windows: afslogon.dll is not a file system interface
Do not return a file system network type that corresponds
to a real file system inter since afslogon is in fact not
associated with a file system interface.  We can't return
WNNC_NET_NONE (0) because that prevents NPLogonNotify()
from being executed.  However, if we return an in use
file system value that can confuse the system when the
actual file system's network provider is also installed.

Change-Id: I845bc633f17f21946ce7de796d66c0bb429005cd
Reviewed-on: http://gerrit.openafs.org/5313
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-29 13:26:15 -07:00
Jeffrey Altman
209d59a61b Windows: torture error reporting
When LeaveThread() is called and GetLastError() has already
been called, pass the last error value to LeaveThread().  Otherwise,
the GetLastError() call in LeaveThread() may return an inaccurrate
result.

Change-Id: Ia8ac1fd827ab8fb47aea0b527acd3c7f7070e873
Reviewed-on: http://gerrit.openafs.org/5312
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-29 13:24:01 -07:00
Garrett Wollman
40c9163aa9 libafs: crash in a more useful way if nchunks is zero
In afs_CacheStoreDCaches(), if the parameter nchunks is zero, the
main loop will not execute, leaving the XSTATS pointer unchanged,
which will result in a null dereference in XSTATS_END_TIME.  Instead
assert that nchunks is nonzero, which will help the static analyzer
and will also generate a more useful panic message should this
error ever be encountered in operation.

There is presently only one call site, and it may be the case that this
condition can never be triggered.

(While in the neighborhood, also avoid dereferencing tdc immediately
before testing whether it is null.)

Change-Id: Idf68f1306d3e09771425c62df139c1de11806c22
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5179
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-08-28 20:46:33 -07:00
Garrett Wollman
edbe891abf libafs: FillStoreStats doesn't need to be global; avoid pass-by-pointer
FillStoreStats is only used in afs_fetchstore.c, so make it static.
Parameter xferStartTime is an osi_timeval, which should be small
enough to pass by value, so do so.

Change-Id: Ic47eae8babb3b7cadbbbca2f10e2e070e2457590
Reviewed-on: http://gerrit.openafs.org/5199
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-25 12:58:40 -07:00
Andrew Deason
597de25969 ihandle: Fix IH_REALLYCLOSE for positional I/O
Currently, ih_fdclose (which is called by IH_REALLYCLOSE), goes
through every FD_HANDLE_OPEN FdHandle_t and closes it. If it finds
handles that are FD_HANDLE_INUSE, it skips those and sets a flag on
the parent IHandle_t. For non-positional I/O, any future opens cannot
use these _INUSE handles, since _INUSE handles cannot be reused, and
the handle will be actually closed when it is FDH_CLOSE'd.

For positional I/O, the situation is different. Multiple threads can
use the same _INUSE FdHandle_t, and so there is nothing currently
stopping a thread from IH_OPEN'ing an ihandle that has been
IH_REALLYCLOSE'd, and getting back an FdHandle_t that existed before
the IH_REALLYCLOSE was issued. This is important, since IH_REALLYCLOSE
is used on files that are deleted, and future IH_OPENs for the same
inode must not use the cached file descriptor. Getting this wrong can
cause data loss, since it can cause us to read from or write to a file
descriptor referring to a deleted file, when we instead should open a
new copy of that file.

To fix this, we create a new FdHandle_t state called
FD_HANDLE_CLOSING, which is set in IH_REALLYCLOSE if we encounter an
FD_HANDLE_INUSE FdHandle_t. In IH_OPEN, we always skip
FD_HANDLE_CLOSING handles, so we can never get back a cached file
descriptor from before an IH_REALLYCLOSE call.

Change-Id: I3188a18f7833950cf5454b3ffe4a4ce0c69e234f
Reviewed-on: http://gerrit.openafs.org/5308
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-25 12:53:05 -07:00
Andrew Deason
6d79cfb361 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.

Change-Id: I4e3b3319ae14b7e68a87f5fe172419f5ebf9d2c9
Reviewed-on: http://gerrit.openafs.org/5307
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-08-25 12:52:53 -07:00
Matt Benjamin
fa97579a08 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.

Change-Id: Icbffdf21c6fc7929483589e87ffe9131834c79b4
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>
2011-08-25 10:11:26 -07:00
Derrick Brashear
2dbdcc5fde roken: no strcasecmp
we don't provide it, don't map it.

Change-Id: Ifcbb1ec66c374ef8cd6eaddf1954dcd688ae3e9b
Reviewed-on: http://gerrit.openafs.org/5311
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2011-08-24 20:10:35 -07:00
Jeffrey Altman
c23b27a693 Windows: change buf_Find*() signature to accept cm_fid_t
The buf_Find*() functions require a cm_fid_t to match with the
cm_buf_t objects not a cm_scache_t.  Change the signature so
that the cm_scache_t is not required.  It should be possible to
search for a buffer even if the cm_scache_t is not present in
the cache.

Change-Id: I38835ee86405c4f3f798ad6be8626e6da507109f
Reviewed-on: http://gerrit.openafs.org/5304
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-23 20:54:51 -07:00
Jeffrey Altman
b804e027f1 Windows: do not drop lock unnecessarily
do not drop cm_serverLock for a cm_PutServer call since
it will only reacquire it.  use cm_PutServerNoLock() instead.

Change-Id: I0e22f8d547a8fa0067cfc918f578b8fe11cc781a
Reviewed-on: http://gerrit.openafs.org/5302
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-23 12:14:05 -07:00
Jeffrey Altman
bca64c7046 Windows: cm_serverLock read required not write
Change-Id: I9e804ddd7de824b2f5ce880e52c08bff6b0615e7
Reviewed-on: http://gerrit.openafs.org/5301
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-23 12:13:45 -07:00
Jeffrey Altman
b2c1313f2f Windows: Be more efficient when processing locks
Do not drop the cm_scacheLock only to reacquire it a few lines
later.

Do not manually set the tail of the queue when osi_RemoveHT
does it for us.

Change-Id: I61b2e54a4864760d257dfcd2841c2c15f1ee41fe
Reviewed-on: http://gerrit.openafs.org/5300
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-23 12:13:26 -07:00
Jeffrey Altman
a576ff1e53 Windows: be explicit when mapping sharing violation
Only one lock acquistion failure should be mapping to
CM_ERROR_SHARING_VIOLATION.  That is CM_ERROR_LOCK_NOT_GRANTED.
Make it clear that is what we are doing.

Change-Id: Ic1933a989a4e8c95a1417679e9bc7cbc4e14dd12
Reviewed-on: http://gerrit.openafs.org/5299
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-23 12:13:05 -07:00
Jeffrey Altman
a6138b412d Windows: Track file server lock count
The fsLockCount field is the lock count reported by the
file server as part of the status info.  Lock acquisition
and releasing does not obtain new status info but we can
estimate what the lock count is by tracking it ourselves
for each of our successful RXAFS_SetLock and RXAFS_ReleaseLock
RPCs and failed RXAFS_ExtendLock RPCs.

Change-Id: Ib5dc5853d82a1292e848bf67d4d9932485177d91
Reviewed-on: http://gerrit.openafs.org/5298
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-23 12:12:45 -07:00
Jeffrey Altman
ae87a1aff2 Windows: remove signed/unsigned mismatch cm_aclent.c
Change-Id: I6cf41410d84b96d2fbe9fd8f1602a7aaa2c1797d
Reviewed-on: http://gerrit.openafs.org/5297
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-23 12:12:31 -07:00
Jeffrey Altman
21acdd92c8 Windows: avoid duplicate volume update queries
If multiple volume update queries have stacked up in
cm_UpdateVolumeLocation() and the active query failed,
do not re-issued the blocked queries.  Instead, prevent new
queries for 60 seconds and fail those that blocked during
the active query.

Change-Id: Ic3f55ae08da36900fc8c7a89b6487ae53f381eb3
Reviewed-on: http://gerrit.openafs.org/5296
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-23 12:12:17 -07:00
Marc Dionne
0fb2e3a6db dir: verified pathnames fallout
Fix some issues introduced with the verified directory path names
commit in master:
- In GetVerifiedBlob, the output parameter is set to NULL on entry
and dereferenced later on.
- For Linux, the code in afs_linux_readdir was changed to pass a
DirEntry to GetVerifiedBlob.  This is incorrect, the function still
expects a DirBuffer pointer.
- In afs_dir_IsEmpty, the assignment of ep was removed, leaving
the function to dereference this pointer which was never set.

Change-Id: I9045076ebe636cf68c19487c0d58baebf2de7dd1
Reviewed-on: http://gerrit.openafs.org/5292
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-23 09:38:35 -07:00
Jeffrey Altman
add66023a0 Windows: avoid cm_serverLock refcount leak
Change-Id: I4e46750de130557b7d4779f83029b69bc28eaf4b
Reviewed-on: http://gerrit.openafs.org/5293
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-22 15:34:16 -07:00
Garrett Wollman
5836464f45 libafs: don't crash if afs_write() is called with zero-length uio
If AFS_UIO_RESID(auio) is zero in afs_write(), we could end up
calling afsio_free(NULL).  Guard the free.  (In the alternative,
perhaps we should just osi_Assert(totalLength > 0) instead?)

Change-Id: Ic218f039e2034b679cb4817a543af2e8307f36f8
Found-by: clang static analyzer with the help of AFS_NONNULL
Reviewed-on: http://gerrit.openafs.org/5259
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-22 12:13:06 -07:00
Jeffrey Altman
259eaa9915 Windows: torture test updates
roken'ize

remove dead code

Change-Id: Id556ded4b3340fac1d58b5407f82d394ab1d18b2
Reviewed-on: http://gerrit.openafs.org/5290
Tested-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-17 07:01:21 -07:00
Derrick Brashear
ad6e19331e macos: fix race in afs_root
same race on PutVCache in afs_root as we had on other platforms,
for instance FreeBSD. use a local variable instead to avoid the race.
additionally, make sure we end up with the root flagged VROOT.

Change-Id: I45ac36f12565320576070fd1c6d1f99ac6db8a63
Reviewed-on: http://gerrit.openafs.org/5278
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-15 12:04:26 -07:00
Simon Wilkinson
b88c0482f4 rpm: Update CellServDB
The commit (a5d66d05fa) which updated
our in-tree copies of the CellServDB for the 14th August release
failed to update the copy that's referenced from the rpm spec file.
Update the filename used here so that rpms also get to have an
up to date CellServDB

Change-Id: I2906b0515a1c91f3ea6eb51ec3dcd161675e8060
Reviewed-on: http://gerrit.openafs.org/5285
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2011-08-15 05:28:44 -07:00
Jeffrey Altman
1a0b99e654 Windows: add assertions to cm_scache.c
Change-Id: If9a47c3b1507b5b4aa9c271204ff496c5b0a88a0
Reviewed-on: http://gerrit.openafs.org/5280
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-14 21:52:36 -07:00
Jeffrey Altman
c58ae34f72 Windows: cm_ShutdownSCache corrections
Obtain cm_scache.dirlock, cm_scache.rw and cm_scacheLock
in the correct order.

Do not release cm_scache.rw when it is not held.

Since the cm_scacheLock is being dropped, preserve the value
of scp->allNextp prior to dropping the lock.

Change-Id: I025a8d76f3f7b94ae00bfd4e000750a90d38b343
Reviewed-on: http://gerrit.openafs.org/5279
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-14 21:52:27 -07:00
Jeffrey Altman
020b415be8 Windows: Save Wix config at start if possible
Save the current configuration at the start of the install
process so the user can be presented with a dialog prior
to installation asking whether the existing or saved
configuration should be used or whether a new configuration
should be created.

Change-Id: I4a42ad597a7e1806bbae6d63bf1a2db365e6be8e
Reviewed-on: http://gerrit.openafs.org/5281
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-14 21:51:49 -07:00
Jeffrey Altman
73b91bf0c0 Windows: More interlocked ops for cm_cell flags
Change-Id: I9e5cae6152439af75a9baf85900117ca9b456f40
Reviewed-on: http://gerrit.openafs.org/5274
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-14 19:39:31 -07:00
Jeffrey Altman
f752142827 Windows: Interlocked ops for cm_user flags
Change-Id: I64932b0d15b439614b6bbba0ba875eacb1260832
Reviewed-on: http://gerrit.openafs.org/5273
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-14 19:39:07 -07:00
GCO Public CellServDB
a5d66d05fa CellServDB update 14 Aug 2011
Change-Id: I2b18a59001c4a5fe041e977ee0321cfafb22fa91
Reviewed-on: http://gerrit.openafs.org/5270
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-14 15:51:38 -07:00
Jeffrey Altman
b97383c1e6 Windows: cm_FindServerByUuid correct lock acquisition
Obtain cm_serverLock when 'locked' is FALSE instead
of when TRUE.

Change-Id: I427fa849ff34734a2dd11d06f42bc709bb70a74e
Reviewed-on: http://gerrit.openafs.org/5268
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-14 15:26:07 -07:00
Jeffrey Altman
c20010850e Windows: prevent cm_server races
Use interlocked operations to modified the flags field.

Close a race in cm_NewServer() which can result in multiple
cm_server objecs being created for the same addr/port/type
tuple.

Change-Id: Ia26e21e1f007875ce316d2ae45a1fbf6fed835f9
Reviewed-on: http://gerrit.openafs.org/5266
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-14 11:34:07 -07:00
Garrett Wollman
10d2734180 libafs: don't call afs_PutDCache(NULL) in afs_GetDownD()
It's possible for an eviction candidate to be omitted by the small
for loop (around line 670), leaving its reference in victimDCs
set to NULL.  In the big for loop that follows, don't call
afs_PutDCache() when we hit one.

Change-Id: Ib0891636a3479bf97cdeab823189e659cb261aa6
Found-by: clang static analyzer with help from AFS_NONNULL
Reviewed-on: http://gerrit.openafs.org/5260
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-13 19:08:43 -07:00
Garrett Wollman
5c0e92a159 libafs: don't free a null pointer in an unlikely error condition
It is extremely unlikely that we will ever fail to allocate two
bytes in SRXAFSCB_GetCellServDB() to hold the empty-string return
value for the case where the specified cell can't be found.  But
that would result in freeing a null pointer, so check for it.

Change-Id: I47a296148e231b0ef20ecd18b8458b912f22a58c
Found-by: clang static analyzer with the help of AFS_NONNULL
Reviewed-on: http://gerrit.openafs.org/5261
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-13 19:07:45 -07:00
Garrett Wollman
ee56107d4d libafs: don't free the NULL we get from a failed allocation
In extractPioctlToken(), if we fail to allocate space for
token_opaque_val, don't immediately pass the null pointer
to osi_Free on the error exit path.

Change-Id: Ic95e178cfbc1b1bbcb18701c0bbd5221426342ee
Found-by: clang static analyzer with help from AFS_NONNULL
Reviewed-on: http://gerrit.openafs.org/5262
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-13 19:07:21 -07:00
Jeffrey Altman
5b40c5f529 Windows: Insert Server Reference List changes
When inserting a new cm_serverRef_t object into a server list
perform the following operations:

1. take advantage of the fact that the cm_serverLock is held
   exclusively to purge the list of any deleted entries that
   could not be removed previously.

2. check to ensure that the item that is being added does not
   already exist in the list.  If it does, discard it.

Change-Id: Ibabfc3b2e1b716f2a0cc664a4667bc9219fde09c
Reviewed-on: http://gerrit.openafs.org/5258
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-13 19:06:52 -07:00
Jeffrey Altman
8f446c7463 Windows: Fix cm_serverRef ref counts
Use Interlocked operations consistently

Simplify cm_ServerInsertList().  It no longer increments the
refCount on the serverRef object.  Instead it leaves the refCount
as is.  Its the caller's responsibility to add a reference if
required.

Add reference counts and hold locks in places where the
volume server list was used unprotected.

Change-Id: Ie65cdca4461e84c675e8a29e22cef3e15679fda7
Reviewed-on: http://gerrit.openafs.org/5248
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-13 06:09:26 -07:00
Jeffrey Altman
578db3bbec Windows: remove unused variables in fs.c
Change-Id: Ie0f21b84266d77d0c92244d5c8a6958d9bfe7e71
Reviewed-on: http://gerrit.openafs.org/5247
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2011-08-13 06:08:33 -07:00
Derrick Brashear
145a8490c7 aklog: attempt to warn about needed weak crypto switch for Lion
Lion's Kerberos is rather unfortunate. deal with the multitude of
missing functionalities by hardcoding this case here.

Change-Id: I95f9136cecb476f70fe694847a518eabd2d1ef44
Reviewed-on: http://gerrit.openafs.org/5240
Tested-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-13 06:01:40 -07:00
Derrick Brashear
ef3ef19921 redhat: update dkms config
make the dkms config properly name the version. remove no-longer-needed
disconnected option for configure

FIXES 130170

Change-Id: Id71d46381c8fbade3ea72c581911447fe6ade395
Reviewed-on: http://gerrit.openafs.org/5246
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2011-08-13 05:58:48 -07:00
Simon Wilkinson
bb25bdfcb0 dir: Protect against circular hash chains
The dir package didn't protect against circular hash chains when
performing directory lookups. A corrupt directory could therefore
cause a client or a fileserver to go into an endless loop if that
directory contained a loop in its hash chain pointers.

Fix this by exiting the lookup if the hash chain has more elements
than the total number of entries in a directory. This maximum number
of entries is taken as being (number of entries per page) * (max
number of pages), which is considerably more than the real maximum
value.

Change-Id: I9e281571f3b01bd8de346ee5418df38b2f5edaa1
Reviewed-on: http://gerrit.openafs.org/5242
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-13 05:56:31 -07:00
Simon Wilkinson
d1946ffe9b libafs/dir: Verify directory pathnames
Provide a new routine, afs_dir_GetVerifiedBlob() which will ensure
that the pathname contained within a directory blob is correctly
terminated before returning it to the caller. For the purposes of this
function, correct termination is defined as having a terminating
\0 character within the same directory page as the blob itself.

Change-Id: I4b3bbb95cb49645a8ac52e6061f9e24f89924831
Reviewed-on: http://gerrit.openafs.org/5241
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-13 05:56:20 -07:00
Garrett Wollman
e3148c6bfa FBSD: coalesce three assignments to the same variable
Change-Id: Iadc9652c03a2d3453addab759c9f8f0048929e2b
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5233
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-12 12:36:28 -07:00
Michael Meffie
cbdca2996a volser: log host address of caller in extra logging
When the volserver is running with extra logging (-log),
log the address of the host running vos in addition
to the user name.

Change-Id: I040be71a84dede255e43c30dd7d8ae56f767f721
Reviewed-on: http://gerrit.openafs.org/5234
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-12 08:27:15 -07:00
Derrick Brashear
a3b4cd3c73 viced: avoid aborting on host table exhaustion
if we exhaust the host table, instead of aborting, return VBUSY at
the client, to defer until hopefully hosts are freed.

Change-Id: Ie8b026992bdde1b46117e6f592f9cf0ea4c85a7e
Reviewed-on: http://gerrit.openafs.org/5181
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-08-11 20:18:24 -07:00
Garrett Wollman
8a25d1a1de rx: make queue macros easier to follow
Nothing depends on the queue-manipulation macros having the expression
nature, so make them proper statements and unpack the comma-expressions
to make it easier to read and understand how they work.  This should
not change the object code.

Change-Id: Icf14537f902768429aa27f67f8acfe39ac996214
Reviewed-on: http://gerrit.openafs.org/5200
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-11 18:42:18 -07:00
Derrick Brashear
d18ff03b59 macos: axe static vfs_fsentry
for whatever reason, lion 32 bit doesn't like it when this is static.
fine, so it's not static now.

Change-Id: Ia9fe6d96615c7fa816f4a88b794faa6ee7e1d010
Reviewed-on: http://gerrit.openafs.org/5206
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-08-11 11:50:04 -07:00
Jeffrey Altman
7ab3405812 Windows: Interlocked operations for cm_buf
cm_buf flags and qFlags

Separate flags and qFlags in the cm_buf structure to improve
performance.

Change-Id: I3d9504827cb74f8770e344cea1c06a6e786785b3
Reviewed-on: http://gerrit.openafs.org/5197
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>
2011-08-10 23:16:47 -07:00
Jeffrey Altman
4876a416d2 Windows: Interlocked for cm_buf cmFlags
Change-Id: I7ed2847afdcbc94c9023c6686d3c81f7863d7f61
Reviewed-on: http://gerrit.openafs.org/5196
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>
2011-08-10 23:15:54 -07:00
Jeffrey Altman
8661c9b671 Windows: fix tptserver director creation
Change-Id: Ifc2433068e1811633f4ac80d3b4a2a9d16226f16
Reviewed-on: http://gerrit.openafs.org/5195
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>
2011-08-10 23:15:13 -07:00
Jeffrey Altman
cbd075a360 Windows: Interlocked ops for cm_volume
Use Interlocked operations for protection of cm_volume flags and
qFlags as well as cm_vol_state flags.

Change-Id: I1a062a5c49d793162b83b9f4f3c32185ae596369
Reviewed-on: http://gerrit.openafs.org/5194
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>
2011-08-10 23:14:51 -07:00
Jeffrey Altman
75297d4439 Windows: Interlocked ops for cm_scache
Use Interlocked operations for cm_scache flags and mask field
changes.

Change-Id: Ice87dc5de395b54e7e30e362d2e72caa9062120e
Reviewed-on: http://gerrit.openafs.org/5193
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>
2011-08-10 23:14:12 -07:00
Jeffrey Altman
deb8c893c2 Windows: Interlocked ops for cm_cell
Use Interlocked operations for cm_cell flag updates.

Change-Id: I45c0a39ea935db2c231a30ecb02963f35b6d734c
Reviewed-on: http://gerrit.openafs.org/5192
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>
2011-08-10 23:13:32 -07:00
Jeffrey Altman
ec1295d11b Windows: implement InterlockedAnd/Or for X86 Debug
Change-Id: I56b3f9534daf0cd152eeea293b1a357d062b9166
Reviewed-on: http://gerrit.openafs.org/5191
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>
2011-08-10 23:12:38 -07:00
Jeffrey Altman
3993b215af Windows: correct prototype for ChangeList fs_acl.h
Change-Id: I63e3b37bd4348da0789dfa78599e513753f34a62
Reviewed-on: http://gerrit.openafs.org/5190
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>
2011-08-10 23:12:15 -07:00
Jeffrey Altman
6691ff6dac Windows: make osi_Log macro safe for if..else
wrap the osi_Log macro's internal if statement with
a do {...} while(0) block in order to ensure that
it is safe for use in if..else controls without bracing.

Change-Id: Ica7bb95dfb1c0285a925771a9b659f85ec0e075f
Reviewed-on: http://gerrit.openafs.org/5189
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-10 23:11:51 -07:00
Garrett Wollman
833010acac stds.h: __nonnull__ has four underscores
Compile-testing AFS_NONNULL doesn't prove anything until something
actually uses it.  Fix 342be35354
to use the spelling that the compilers actually support.

Change-Id: I4a6b965d459a90a1832f2e813e886c15d3477962
Reviewed-on: http://gerrit.openafs.org/5198
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-08-10 20:49:23 -07:00
Derrick Brashear
e8607d8d25 macos: reset next vcache pointer after reacquiring xvcache
dropping the xvcache lock means that things can change out from under
us. in case they do, reset the next vcache pointer before looping

Change-Id: I71be39a2f2986804257c50b1d5b7d557b58a3573
Reviewed-on: http://gerrit.openafs.org/5184
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-08-10 10:49:01 -07:00
Garrett Wollman
7d0cd1393f FBSD: catch up with the disappearance of VOP_GETVOBJECT
The vnode operation VOP_GETVOBJECT disappeared in FreeBSD 6.0, an
embarrassingly long time ago.  Six years ago, a kluge was added
to emulate its behavior, but it did not correctly emulate the
return value of the old VOP implementation.  As a result,
osi_VM_StoreAllSegments() could never actually do anything.  Since we
don't support FreeBSD before 8.0, remove all references to VOP_GETVOBJECT
and examine vp->v_object directly instead.

This has the result that osi_VM_StoreAllSegments() will actually do
something now, which may not be desirable.  (Previously, if somehow
the vnode had no associated VM object, it would crash, and otherwise
it would do nothing at all.)

Change-Id: Ifdad92ae8e393e85c3f97907af7119ce342b25dd
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5183
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-10 10:48:39 -07:00
Garrett Wollman
342be35354 stds.h: introduce AFS_NONNULL
AFS_NONNULL wraps the GCC/Clang function attribute __nonnull__, which
tells the compiler and the static analyzer that the pointer arguments
to a function (or specific ones, if provided) cannot be null.  Note
that GCC has only limited support for warning about violations of these
constraints.

Usage examples:
int myfunc(struct foo *a, bar_t, struct baz *c) AFS_NONNULL((1));

tells the compiler that the first argument cannot be null (but the
third one can).

int myfunc2(struct foo *a, bar_t, struct baz *c) AFS_NONNULL();

tells the compiler that both pointer arguments cannot be null.

Change-Id: Id81f0c382a6a3bdd9bf9c716eb4091b433129d69
Suggested-by: Simon Wilkinson, comment on change Ic8751737 (#5180)
Reviewed-on: http://gerrit.openafs.org/5182
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-10 10:48:17 -07:00
Andrew Deason
2cd9d0536b volinfo: Include nfs.h
nfs.h is required for various types used in vol-info.c. Include it. On
namei this header gets pulled in indirectly via other means, but on
inode it does not (and we shouldn't be relying on such anyway).

Change-Id: If917f8c3b0382572d2146450116399498257ffc7
Reviewed-on: http://gerrit.openafs.org/5185
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-10 10:48:01 -07:00
Simon Wilkinson
a868209c4a aklog: Add -config option
Add the -config option to aklog so that a different configuration
directory location can be specified on the command line for testing
purposes.

Change-Id: Ic5f8d778304a43c823e53bf1855a3e6bf426f80c
Reviewed-on: http://gerrit.openafs.org/5170
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-09 20:55:21 -07:00
Simon Wilkinson
8b60082c1f pts: Add the -config option
Add the -config option to all pts commands, so that the user can set
the location of the configuration directory to use. This is primarily
provided for testing purposes, to make it simpler to build fake AFS
cells with configuration in non-standard locations.

Change-Id: I90c9c95cbf99b3853bfbe93dab1ab71c3ae7e228
Reviewed-on: http://gerrit.openafs.org/5103
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-09 20:54:51 -07:00
Marc Dionne
d28188382b pam: fix unused but set warnings
Fix a few cases of set but unused variables.

Change-Id: I0a3e0906dbc708e2449121f3de1726d7055efc27
Reviewed-on: http://gerrit.openafs.org/5173
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-08-09 20:54:05 -07:00
Marc Dionne
4b4a52b314 volser: flag unused variable
nearInode can be unused, flag it as such to prevent warnings and
keep enable_checking happy.

Change-Id: Ic79d101380b79c3c3d90c4c4f949abe7c3f476ff
Reviewed-on: http://gerrit.openafs.org/5172
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-08-09 20:53:58 -07:00
Garrett Wollman
bf4b2fd3e2 bos: don't dereference a null pointer when printing an error message
The parameter we are interested in is at MRAFS_OFFSET + 17, not
MRAFS_OFFSET + 13.

Change-Id: Ib856ff40c5949cde95a2b277cd44253b87c3c2a4
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5178
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-09 20:53:43 -07:00
Garrett Wollman
7fe4125fe3 dir/vol: Die() really does
Die() is an abort routine shared by the dir and vol modules.  Move its
prototype into dir.h to ensure that its declaration matches its three
different definitions, and add an AFS_NORETURN annotation so that the
static analyzer knows that it aborts.

Change-Id: If01f35fe796708f6187b9767497a32458888ec1c
Reviewed-on: http://gerrit.openafs.org/5177
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-09 20:52:56 -07:00
Garrett Wollman
9b0f53b2bf vos: eliminate unnecessary global variables
tserver is used by three different functions but not shared by them;
make it private to each one to improve static analysis.  tconn is
not used by anything, so just delete it.

Change-Id: Ic9fc4add66dbbb02170846154e44d261dcc6b061
Reviewed-on: http://gerrit.openafs.org/5176
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-09 09:07:40 -07:00
Garrett Wollman
292b375e39 volser: let it be known that Abort() really aborts
The compiler and static checkers can do a better job if they know that
certain functions never return.  Tell it that common.c:Abort() is such
a function.  While we're at it, let volser_internal.h provide the
declarations for this function (Log() was already there).  This makes
volser parallel to the way the same functions are declared in vol.

Change-Id: I8b684bf96866edfc9edaae126d789d245a8d2356
Reviewed-on: http://gerrit.openafs.org/5175
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-09 09:07:08 -07:00
Garrett Wollman
ae6a392948 kdb: don't dereference a null pointer on corrupt database
When iterating through the database, kdb would dereference a
null pointer if it encountered an error retrieving the value
or if the value was not the right length, in code that was clearly
cut-and-pasted from the other branch of an "if" statement where a
specific entry was requested on the command line.  Print the name
of the entry with the problem as was apparently intended.

Change-Id: Idc2d3c9b6049e5d3b0eb302353a68bcfdad6a90d
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5174
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-09 09:06:49 -07:00
Garrett Wollman
90ea68979c afsd: look in the right place for -splitcache argument
The argument to -splitcache is in as->parms[34], not [30].

Change-Id: I4d7be16a1ad99a03025c80f9782c4f678da868ae
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5169
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 11:50:27 -07:00
Garrett Wollman
8776f19417 afs_pioctl: don't use cell uninitialized in PGetTokens2
An unlikely error condition could lead to the variable cell in
PGetTokens2 being passed uninitialized to afs_PutCell.  Initialize
it to NULL beforehand to avoid this.

Change-Id: Ia8ded86df9d8af2f08c02d39749252d98a6c9ffe
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5168
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 11:50:19 -07:00
Garrett Wollman
43834bff1a butc: avoid freeing uninitialized pointer in writeDbDump()
In error conditions, charList could be freed before it is initialized.
Move the initialization up to before the error checks.

Change-Id: I678f40552590e238f494507f7410233cdbb949ac
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5167
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 11:50:08 -07:00
Derrick Brashear
1fc4c9dbe2 pam: stop building it wrong
in the new lwp/pthread/shared universe, well, we have the
opportunity to be correct. and we chose to do it entirely wrong.
we're building a shared object. use the right rules. we need
to add some CFLAGS for PAM. do that using MODULE_CFLAGS instead
of just building a whole new CCRULE

Change-Id: Ie3e3c5ba902e5364cfa99d4dbd1b5b7fd4451127
Reviewed-on: http://gerrit.openafs.org/5153
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 11:49:42 -07:00
Derrick Brashear
3d84c065fb pam: clean up unused variables and prototyping
don't define variables on platforms we won't use them on
do prototype functions we call. basically, we compile with warnings
enabled now, so, fix everything so we *can*.

Change-Id: I749f27c227ac70c58ccc68f1548f8274f10e3587
Reviewed-on: http://gerrit.openafs.org/5154
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 11:49:20 -07:00
Derrick Brashear
496fb87372 rx: avoid nat ping until connection is attached
drop nat pings on connections we haven't talked on yet

Change-Id: Ie333d50a090f1f086c958440cc37849413442dea
Reviewed-on: http://gerrit.openafs.org/5130
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 11:49:00 -07:00
Garrett Wollman
c92f04af60 butc: avoid testing stack garbage; remove dead initializer
"code" is unconditionally set early in saveDbToTape() so there's
no need to initialize it.  On the other hand, dumpEntry.id is used
before dumpEntry is initialized, so set it to what appears to be
the expected value before any non-local exits could cause it to be
inspected.

Change-Id: I133f8e84e46d0faedf3c9683330d92158bcd8935
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5166
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 08:56:09 -07:00
Garrett Wollman
34cc26a1b1 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.)

Change-Id: I25bf7a5e149540593febec79f9f5111434807514
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>
2011-08-07 08:55:37 -07:00
Garrett Wollman
619b420903 vos: don't free stack garbage on error
If wantExtendedInfo is true, then pntr is used uninitialized.
In the other case, UV_ListVolumes will have set it to NULL
before doing anything (even if it returns an error), so this
free() is dead anyway.

Change-Id: I6979a69d33ecbbdb906eb9a075bbf13180e36646
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5164
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 08:55:05 -07:00
Simon Wilkinson
55beacdc38 libafsauthent: Add volser and vldb
Add the volser and vldb families of functions to libafsauthent. This
allows applications such as per-AFS which are building pthreaded clients
to use a single library, rather than trying to mix LWP and pthreaded
code within the same process.

Change-Id: I3682876e91ca03311a798ac71e3a7a28f3205d42
Reviewed-on: http://gerrit.openafs.org/5157
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 08:54:38 -07:00
Jeffrey Altman
0246f6e968 Windows: symlink make should translate \\afs target
If the target is a UNC path beginning with the AFS netbios name,
convert the path to use Unix /afs mountpoint notation.

Change-Id: I01e01b70938f8eb383fd3e7458a140d9e89dd237
Reviewed-on: http://gerrit.openafs.org/5162
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-05 06:22:35 -07:00
Jeffrey Altman
c512683859 Windows: adjust scache LRU postion upon deletion
If the object represented by a scache object is deleted,
update the LRU position of the scache object to make it
the first object in the LRU queue to be recycled.  This
preserves the cached objects for those that might prove
useful in the future.

Change-Id: I0e862b1270e10c31f20ecde06d208f4b8c405c3a
Reviewed-on: http://gerrit.openafs.org/5161
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-04 19:03:07 -07:00
Jeffrey Altman
4e42d6fd18 Windows: fix condition calls to osi_Log
The osi_Log macro is if(foo) osi_AddLog()

If osi_Log macros will be conditionally called, the conditonal
needs to have bracing.

Change-Id: I59de78a5b7b35cc822a648a51cd63a14037c1ca5
Reviewed-on: http://gerrit.openafs.org/5160
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-04 19:00:45 -07:00
Jeffrey Altman
17e50a4b98 Windows: LockOrderValidation memory usage optimization
Instead of using malloc() and free() to allocation lock reference
structures, cache allocated objects in a free list.  This reduces
memory fragmentation.

Change-Id: Idffe82282c77202d0fc3a9be9123c3b7384ecd63
Reviewed-on: http://gerrit.openafs.org/5159
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-04 19:00:26 -07:00
Jeffrey Altman
2bce3b50ef Windows: after dir enum adjust dir scache LRU
During a directory enumeration the directory scache object
is reference counted so it can't be recycled.  However, if
there are more directory entries than the maximum number
of cached scache objects the directory scache object will
end up being the next object to be recycled after the refcount
is dropped.  Since the directory is clearly a hot object, before
dropping the reference, adjust the scache LRU position so that
it is the last object to be recycled.

Fix the variable name for the directory scache to be 'dscp'
for consistency.

Change-Id: Ia2089fb9b47dab77abc0911ab009e5aed75ed848
Reviewed-on: http://gerrit.openafs.org/5158
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-04 19:00:03 -07:00
Jeffrey Altman
4111ee2374 Windows: use %p to print cm_scache_t pointers
Change-Id: Iee13204820b3adc4359e42d46d9f9050ab07bcb2
Reviewed-on: http://gerrit.openafs.org/5152
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-04 18:59:42 -07:00
Jeffrey Altman
fec4e6bc59 Windows: add missing dafs man pages to wix installer
dafileserver.html
dasalvager.html
davolserver.html

Change-Id: I87a70b2a30701f184f7a70fbcf6ee50a4bb1d973
Reviewed-on: http://gerrit.openafs.org/5149
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-02 23:19:00 -07:00
Jeffrey Altman
f631a11f5e Windows: conditionalize mappings of error values
Visual Studio 10 adds a large number of additional POSIX C99
error values to errno.h.  Wrap each mapping with #ifndef to ensure
that we do not redefine the C runtime errno.h definition.

Change-Id: Ia6929d9ff84358059efcc4a53dcc91ee2612fc5a
Reviewed-on: http://gerrit.openafs.org/5129
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-01 10:42:55 -07:00
Jeffrey Altman
71e64b6f21 Windows: unified afs errors must use nt mapping
On Windows, error.h does not provide a complete list of POSIX
C99 error values.  OpenAFS fills in the gaps with a private
error mapping table afs/errmap_nt.h (src/util/errmap_nt.h).
If errmap_nt.h is not included prior to processing unified_afs.h,
values such as ELOOP will be mapped to EIO instead of the unique
value defined by errmap_nt.h.

Change-Id: I3d25fafb15f1b0060ad1047178cbadd5ce22edb2
Reviewed-on: http://gerrit.openafs.org/5128
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-01 10:42:39 -07:00
Derrick Brashear
d54c9b05d0 vos: spell "vldb" correctly
i'm not even going to ask.

Change-Id: I5f59177ef58d9728a516176a14e0504130f7c584
Reviewed-on: http://gerrit.openafs.org/5125
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-08-01 08:03:42 -07:00
Derrick Brashear
5ebef72c02 macos: fix vnode finalization
erroneously pushed a bad version of this. fix it now.

Change-Id: Ic5db50473a97bd7ffb3ba34ac052da2ae8f2875b
Reviewed-on: http://gerrit.openafs.org/5124
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-08-01 07:47:40 -07:00
Andrew Deason
b621a29860 SOLARIS: Do not release NULL root vp on unmount
When we unmount, and afs_globalVp is NULL (e.g. because root.afs was
unavailable when the client was started), we will panic the machine if
we try to release it. So, if afs_globalVp is NULL when we hit our
unmount handler, don't touch it.

Reported by Andy Cobaugh.

Change-Id: I4e5869237e24da320afc2b7edaf8edca0ab3e4e9
Reviewed-on: http://gerrit.openafs.org/5117
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-08-01 05:08:35 -07:00
Will Maier
6b83ba621b RedHat: Return status values from client init
The init script provided with OpenAFS always returns 0 when the status
subcommand is called, even if the service is not running.

For example:

$ sudo service afs status; echo $?
afsd is stopped
0

This change makes sure the init script exits with the value returned
by the status function from /etc/init.d/functions. With this patch,
the afs init script behaves as expected when used, for example, in a
Chef service resource:

$ sudo service afs status; echo $?
afsd is stopped
3

Change-Id: If3d317fc406746f357e29e0d8d82c7ccf3c192d7
Reviewed-on: http://gerrit.openafs.org/5123
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-08-01 05:03:18 -07:00
Jeffrey Altman
afc3ded567 Windows: Do not execute tasks on deleted files
If a cm_BkgDaemon thread finds a queued request whose cm_scache_t
has the CM_SCACHEFLAG_DELETED flag set, do not execute the request
and fail it immediately with CM_ERROR_BADFD.  Any attempt to execute
the request will fail with VNOVNODE from the file server.

Change-Id: Ib74300568ac083e39506b0d106a5984e8fe5e464
Reviewed-on: http://gerrit.openafs.org/5120
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-31 10:21:38 -07:00
Jeffrey Altman
7e3615208d Windows: cm_BkgDaemon should not do cm_SyncOp's job
cm_SyncOp is designed to synchronize operations among multiple
threads.  The background daemon threads should not filter requests
based upon cm_SyncOp states.  Doing so is racy and does not produce
better performance.

Change-Id: Ifeafd55da6e02807ed4cc3c3f2b6f1de4df2a87f
Reviewed-on: http://gerrit.openafs.org/5119
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-31 10:21:23 -07:00
Jeffrey Altman
fa11f71f04 Windows: Do not release locks on deleted files
If the cm_scache_t flags include CM_SCACHEFLAG_DELETED, do not
bother releasing an outstanding file lock to the file server.
The lock went away when the file was deleted.  Any attempt to
release will fail with VNOVNODE which is translated locally into
CM_ERROR_BADFD.

If a RXAFS_ReleaseLock RPC fails with VNOVNODE, treat it as
success.

Change-Id: I15860920a224bd032256e08c9983fa31f7f1c9ee
Reviewed-on: http://gerrit.openafs.org/5118
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-31 10:21:06 -07:00
Jeffrey Altman
4138a778fe Windows: permit perl command to be explicitly set
Add PERL variable to the build system.  If not specified
externally the variable will be set to 'perl'.  However,
ActiveState Perl should be used and not Cygwin Perl.  The build
environment should indicate that by specifying a PERL setting.

SET PERL=c:\perl64\bin\perl.exe

or similar.

Change-Id: Iaf14a82134cc2dcf3c23b1e5a0ed65606e2487bb
Reviewed-on: http://gerrit.openafs.org/5115
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-31 10:20:19 -07:00
Jeffrey Altman
b61bd99bce Windows: add debugging to afskfw
More debugging output added when a debugger is present.

Change-Id: I22698ebaf3c950a5b9c9b7d6746af45603b5acf9
Reviewed-on: http://gerrit.openafs.org/5112
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-31 10:18:56 -07:00
Jeffrey Altman
7c59ec8f81 Windows: afskfw remove TRUE conditional
Simply the code by removing an if(1) conditional.

Change-Id: I2cb3f861b99686a7d14aa7f567adc5a083a08a5b
Reviewed-on: http://gerrit.openafs.org/5111
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-31 10:18:24 -07:00
Jeffrey Altman
214e9a6052 Windows: KFW_AFS_get_cred userrealm
The userrealm string in KFW_AFS_get_cred() should not include
the '@' symbol from the user principal.  Including the '@' produces
an invalid realm name.

Change-Id: I5887ffabce93666bdbe231eaac0821573162a6ba
Reviewed-on: http://gerrit.openafs.org/5110
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-31 10:17:55 -07:00
Jeffrey Altman
a063ecdc78 Windows: afslogon start service if not started
If the service is configured for auto start but has yet
to start, kick it off just in case.

Change-Id: I668961b17472a78ebac6744bf131dcb850d4e4a2
Reviewed-on: http://gerrit.openafs.org/5109
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-31 10:17:31 -07:00
Jeffrey Altman
549737f1e7 Windows: improve afskfw error message output
Add KTC and PT error messages to those that can be
translated within afskfw.lib.  This improves the error
logging for afslogon.dll, afscreds.exe, and afssrvadm.exe

Change-Id: I62aa5f1249d4d1f2d64ed068be47a5832d97f85c
Reviewed-on: http://gerrit.openafs.org/5108
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-29 19:15:07 -07:00
Michael Meffie
be152a00a7 volinfo: clean up headers
Remove unneeded includes.

Change-Id: I68514d47b1ddd4ea1d79c919635f87f6670e767f
Reviewed-on: http://gerrit.openafs.org/5098
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-29 14:17:55 -07:00
Andrew Deason
530b5ecac5 libafs: Rate-limit hard-mount waiting messages
Limit how often we log "hard-mount waiting for XXX" messages. Without
this, it is possible for a client with hard-mounts enabled to spam the
kernel log rather excessively (in extreme cases this can even panic
the machine on at least some Linux).

To keep things simple, just log approximately one message per volume
per hard-mount interval.

Change-Id: Ie82f68c5eae76519fcf1491164133c1955ed9c08
Reviewed-on: http://gerrit.openafs.org/5060
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-29 14:17:31 -07:00
Simon Wilkinson
0251eb6b37 util: Don't use FT_GetTimeOfDay for MRAFS logs
FT_GetTimeOfDay creates an LWP dependency. For the purpose that we're
using it in serverLog.c, gettimeofday performs identically. So, just
use gettimeofday and reduce our dependencies.

Change-Id: I36887d725c7e93386c80c61b3b33a7cda2bfe738
Reviewed-on: http://gerrit.openafs.org/5085
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-29 14:17:13 -07:00
Garrett Wollman
192ba0deae pthreaded servers: set thread names
In the startup function for each thread, set a thread name.  This
can safely be done unconditionally as LWP builds turn the call into
a no-op.  In general, the thread name parallels the name passed to
LWP_CreateProcess, but for Rx server threads, it additionally includes
the thread ID so that these threads can easily be distinguished.  (I'm
not sure yet whether doing so will prove to be useful or counterproductive.)

Change-Id: I30e012eebef4c7856084fa8b8eb1d88d9fcdf2c4
Reviewed-on: http://gerrit.openafs.org/5041
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-29 14:16:25 -07:00
Andrew Deason
e453f49bd4 libafs: Add afs_conn refCount imbalance safeguard
If someone is putting back too many refs, we can detect so very
easily. If we see that such a thing is happening, give a warning and
bail out, instead of risking a panic or memory corruption.

Change-Id: I36c968f9cd7cab3f569d3f6860f41678f026fba8
Reviewed-on: http://gerrit.openafs.org/5094
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-29 14:15:59 -07:00
Garrett Wollman
04e4126264 FBSD: complete the build fix for 8.1 libafs
Strangely enough, nosys() also needs a cast to sy_call_t *.

Change-Id: I7fee2278c228da3ddb2c3ccc9758681cd0abc01d
Reviewed-on: http://gerrit.openafs.org/5105
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-29 14:15:31 -07:00
Garrett Wollman
3d6f6e0043 configure: provide some necessary prerequisites in header checks
<netinet/in.h> is a prerequisite for <resolv.h> and <netinet/if_ether.h>.
<sys/socket.h> is a prerequisite for <net/if.h>.

Change-Id: I2c974ad863c6ff7eedb3702159399118af8de074
Reviewed-on: http://gerrit.openafs.org/5107
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-29 14:15:08 -07:00
Garrett Wollman
74e8bec7be configure: spell the "=" operator to test(1) correctly
Equality in the test(1) utility is represented by "=", not "==".
Some, but not all, versions of test accept the latter as an extension.

Change-Id: I25380f77e1c621965e0610318c9793874154cf15
Reviewed-on: http://gerrit.openafs.org/5106
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-29 14:14:48 -07:00
Garrett Wollman
9e29a20df7 libuafs: don't use a GNU-only feature in a common makefile
$(shell ...) is a GNU Make proprietary feature and shouldn't be used
OS-independent makefiles.  There is no need to use it here; command
substitution in the shell is good enough.

Change-Id: I511108dab0770e772005b3f4a851713d1ee5a83e
Reviewed-on: http://gerrit.openafs.org/5093
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-07-29 14:13:34 -07:00
Derrick Brashear
f8ff2591f7 macos: don't attempt finalize fixup on root vnode
because of how the root fid is created we can end up being dumb.
turns out we never want to bypass doing the full pass for root anyway
so just force fixup to not happen.

Change-Id: I2b6d8d5cc4824f0f2a9473a2e810410579e3ad48
Reviewed-on: http://gerrit.openafs.org/5095
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-25 21:58:57 -07:00
Andrew Deason
ef28bc08c1 libafs: Avoid duplicate afs_Analyze in bulk stat
In afs_DoBulkStat, we can call afs_Analyze multiple times for the same
set of connection objects. Since afs_Analyze puts its reference to the
given afs_conn and rx_connection structures, calling it more than once
can cause the reference counts on those objects to be lower than they
should be.

Instead of making another afs_Analyze call, just alter the error code
inside the normal do/while afs_Analyze loop, so the 'loop' afs_Analyze
call gets the appropriate error code from the first bulk stat'd entry.

Change-Id: Id6396f8e9d4757d54825d4915458bf8b5153984f
Reviewed-on: http://gerrit.openafs.org/5086
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-25 13:38:16 -07:00
Simon Wilkinson
461603e474 vlserver: Use libcmd for command line parsing
Modify the vlserver so that it uses the libcmd library to parse its
command line, rather than rolling its own command line parsing.

Change-Id: I7705219894de2d2268729ddc66a8af9ad9758ce7
Reviewed-on: http://gerrit.openafs.org/5074
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-25 10:45:07 -07:00
Simon Wilkinson
0b9986c875 ptserver: Use libcmd for command line parsing
Modify the ptserver so that it uses the libcmd library to parse its
command line, rather than rolling its own command line parsing.

Change-Id: I84bac2cd70bbaf85004fce2f23d9237215544edd
Reviewed-on: http://gerrit.openafs.org/5073
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-25 10:44:53 -07:00
Ben Kaduk
46b897bbaf FBSD: cast lkmnosys appropriately
lkmnosys is a function, and as such has its own prototype which
includes a named struct specific to it (struct nosys_args).  When
comparing its address to an entry in the syscall table, we must
cast it to a sy_call_t to correctly do the comparison, lest gcc
warn us about comparing distinct pointer types without a cast.
This warning recently became an error due to bsd.kmod.mk, so it
causes the build to fail on 8.1 and earlier, which do not use
syscall_register() due to a conflicting entry for our syscall
in syscalls.master.

Change-Id: I606aaf73e433a50ea41adaab842d61ee69653bd5
Reported-by: Garrett Wollman
Reviewed-on: http://gerrit.openafs.org/5087
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-23 19:54:11 -07:00
Simon Wilkinson
e49bf687fe util: Cleanup generation of dirpath.h
dirpath.h is only copied into place if it has changed. However, this
means that the timestamp of dirpath.h is never updated, causing make to
always trigger the buildrule, even if the rule eventually does nothing.

Instead, always copy in the new dirpath.h, which simplifies the make
rules, and stops make from always building.

Change-Id: I43ba9152473591c5afd9064ad6e58adda6823f11
Reviewed-on: http://gerrit.openafs.org/5084
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-23 14:22:01 -07:00
Simon Wilkinson
18af550ef1 rx: Provide Get/SetThreadNum functions
Provide functions to let an application manipulate the rx thread
specific key, rather than letting them root around in the internals
of RX themselves.

Change-Id: Ic42430de7e0c0a60217a509d9b7ef9d3523463ce
Reviewed-on: http://gerrit.openafs.org/5083
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-23 14:21:36 -07:00
Simon Wilkinson
2676143c03 klog.krb5: Don't use ubik_PR_NameToID internal func
ubik_PR_NameToID is a low level function which requires a large amount
of setup from the caller. Instead, use pr_Initialize() and pr_SNameToId()
which do all of the work in a library.

Change-Id: I6b8d50c3d16eb258a4a81335790be2654c4fb191
Reviewed-on: http://gerrit.openafs.org/5082
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-23 14:21:24 -07:00
Simon Wilkinson
a40cbd7f07 ubik: ServerInitCommon is an internal function...
... so make it static

Change-Id: Ia323d9ea4e35e4d3a5593df05a905191e9d951a0
Reviewed-on: http://gerrit.openafs.org/5081
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-07-23 06:36:09 -07:00
Simon Wilkinson
10264a523f bozo: Don't initialise variables unecessarily
Don't initialise variables to NULL 3 lines before we assign malloc
results to them.

Caught by clang-analyzer

Change-Id: Ic0f2fc56fe6ce39411c4cd48ea0a0b955b3e0f19
Reviewed-on: http://gerrit.openafs.org/5080
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-22 21:11:33 -07:00
Simon Wilkinson
ba18ea6517 viced.c: Don't store results of reads unecessarily
When we don't need to store the amount of data read from a file,
don't complicate the if() statement by adding a pointless assignment.

Caught by clang-analyzer

Change-Id: I326d894c9b5f7a89f31534c7864e05ea059a03aa
Reviewed-on: http://gerrit.openafs.org/5079
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-22 21:11:24 -07:00
Simon Wilkinson
364d1bec74 libcmd: Don't increment array then discard result
We don't need to increment argv here, as we're about to return
to the caller.

Change-Id: I442fe741e4bda91e12375a6fe72657dc215c4e78
Reviewed-on: http://gerrit.openafs.org/5078
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-22 21:11:08 -07:00
Simon Wilkinson
e3d9821a8b libcmd: Don't store values that we don't need
Don't store the results from cmd_CreateSyntax unless we actually
need to use them for something.

Caught by clang-analyzer

Change-Id: I581dcc00a886245a8d117f78c74590111c75e3b0
Reviewed-on: http://gerrit.openafs.org/5077
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-22 21:10:49 -07:00
Simon Wilkinson
2d61f1fcbb ptserver: Don't print undefined value
The readgroup utility printed the wrong variable when listing the
source group - instead of printing the group name, it tried to
print an arbitrary element from the list of group members. Fix it
to print the right thing.

Caught by clang-analyzer.

Change-Id: Ie7ada8a1e881871ae5db14714ee10325ac052d40
Reviewed-on: http://gerrit.openafs.org/5076
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-22 21:10:18 -07:00
Andrew Deason
6cae7c554e libafs: Remove unused volume "states" flags
VResort and VMoreReps are not referenced anywhere in the tree, so
remove their definitions. Keep VPartVisible for VICEP-ACCESS, but
lower it to the next unused bit.

Change-Id: I04c9d1c75774a55d01105acb2b5df9d2bcafa5d8
Reviewed-on: http://gerrit.openafs.org/5059
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-22 16:50:03 -07:00
Derrick Brashear
09d1d8575c aklog: check ccache errors in get_user_realm
if there's an error finding the specified ccache, don't
bother continuing.

Change-Id: I344a06c66c426c5d14dbe08ce9da0431f095349d
Reviewed-on: http://gerrit.openafs.org/5069
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-22 13:30:32 -07:00
Derrick Brashear
62cccc4547 macos: avoid KLRenewInitialTickets crash in Lion
the shimmed heimdal in Lion crashes on this call now.
the shim also exports diddly squat. fine, we pick over what
IS exported and use only calls available to us.

should be exactly as functional as before.

Change-Id: I6a55209b94694e8eb462bc0a4607a891b9f8b570
Reviewed-on: http://gerrit.openafs.org/5065
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-22 13:29:11 -07:00
Andy Cobaugh
30cd8dafa7 rpm: remove postinstall message from openafs-client
Printing out information on how to configure cacheinfo and ThisCell
is a bit noisy, and pam_afs.so is probably not what most people
want to use nowadays.

Change-Id: I103ccb39bc7bb075cffab1d980b542ea8156f0c6
Reviewed-on: http://gerrit.openafs.org/5026
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-07-22 10:55:50 -07:00
Jeffrey Altman
c61f5208f5 Windows: do not leak space allocation
smb_ReceiveNTTranCreate leaks a cm_GetSpace allocation on
error.  Don't do that.

Change-Id: I40349826f2ab229961e3c3552f66808775f0a239
Reviewed-on: http://gerrit.openafs.org/5062
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-22 08:56:12 -07:00
Jeffrey Altman
9c2d3180aa Windows: smb_ReceiveNTTranCreate path not found
if the directory object cannot be found in the tree, return
CM_ERROR_PATHNOTFOUND instead of crashing.

Change-Id: I51458e24b5b9f16fc0378073e002d8ee160b8f15
Reviewed-on: http://gerrit.openafs.org/5061
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-22 08:55:50 -07:00
Jeffrey Altman
d3a4b6ce70 Windows: improve shutdown time
During Windows OS shutdown the service may be given as little
as six seconds to shut itself down before it will be terminated.
Forced termination will leave the cache file in a dirty state.
This patchset makes several minor changes to reduce the overall
time required for shutdown:

1. do not wait for the IP address change notification thread.
   by the time it terminates the ip address has been lost.

2. send give up all callbacks earlier.

3. reorder the daemon thread waits.

4. change the daemon thread loop sleep time to 500ms in order
   to prevent the service from waiting up to 10 seconds for
   the thread to notice a shutdown is in progress.

Change-Id: Ib1ff3eaf2e5116d9b3d7561670b8266e1bc5d1cf
Reviewed-on: http://gerrit.openafs.org/5055
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-22 08:55:29 -07:00
Jeffrey Altman
0783b8f382 Windows: cm_daemonCheckOfflineVol fix
When computing whether or not to perform an offline volume
check it is critical that the 'lastBusyVolCheck' variable
be assigned the current time instead of 'lastVolCheck'.
By setting the wrong variable a new offline volume check is
performed every 10 seconds which is undesireable.

Change-Id: I509cde64a8b51ce1846f37047a574409ff248978
Reviewed-on: http://gerrit.openafs.org/5054
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-22 08:55:08 -07:00
Jeffrey Altman
e91f16ebb7 Windows: Add shutdown event log message
Add an explicit message that the shutdown sequence is complete.
This is necessary because during a Windows OS shutdown, the service
is frequently killed prior to the memory mapped file is fully released.

Change-Id: I1ad2471e1e1442d836d6abac09fc5cdd08edae0b
Reviewed-on: http://gerrit.openafs.org/5053
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-22 08:54:49 -07:00
Jeffrey Altman
a1af69182b Window: breakout CM error codes into separate header
Change-Id: I67be608c6cb153904fa2ca8c5ad6cbc7943064e5
Reviewed-on: http://gerrit.openafs.org/5052
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-22 08:54:34 -07:00
Andrew Deason
ba546ecf0c afsd: Add the -rxmaxfrags option
Add an option to afsd to limit the number of fragments Rx will
send/receive, called -rxmaxfrags.

Change-Id: I9f0b3edd95db17f82ef8f7d1e300df4eff355172
Reviewed-on: http://gerrit.openafs.org/4899
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-22 05:36:08 -07:00
Ben Kaduk
beac254406 FBSD: in libafs, define LIBAFSNONFS
Running 'make dest' will fail without this variable defined.

Change-Id: I7f82cb3aeae8585c68ee60b005f4ba32d44e2104
Reviewed-on: http://gerrit.openafs.org/5058
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-22 05:30:48 -07:00
Derrick Brashear
ee950e7ecf macos: krb5_524 is uselessly stubbed
from MITKerberosShim-44:
dummy(krb5_524_conv_principal, 0);
dummy(krb5_524_convert_creds, 0);

this basically logs and returns success. not helpful.
so let's just not call them.

Change-Id: I91e7113e6934c67129e61dfc84b7f0c4d110cea0
Reviewed-on: http://gerrit.openafs.org/5066
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-21 19:40:07 -07:00
Derrick Brashear
45f0cbf83a redhat: support epel yum configs in mockbuild
epel's mock is useful in terms of config, but we need to allow
use of it. do so here. add centos6 at the same time.

Change-Id: I781fc475389c5be56aa89041b8d22b166517a3f5
Reviewed-on: http://gerrit.openafs.org/5056
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-21 15:47:00 -07:00
Andrew Deason
1fc5b6e674 Revert "afs: Use 64-bit inode numbers"
This reverts commit e1e0083386. Using
64-bit inode numbers can make AFS largely inaccessible to 32-bit
programs that are not compiled with large file support, since the
inode number we provide is not representable in a 32-bit struct stat.
Using 64-bit inode numbers thus can break quite a few programs, and
has little benefit, so don't do it.

Change-Id: Ia482ac2864601b5c56a4259432529d14981f4a1a
Reviewed-on: http://gerrit.openafs.org/5048
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-19 19:39:24 -07:00
Ben Kaduk
79aedab16c FBSD: update to using bsd.kmod.mk
We have for a long time had a cobbled-together kernel module build
system that essentially copied build arguments from a kernel build
in an ad hoc fashion, with lots of conditionals on architecture
and OS version.  (We got it wrong, several times, too.)
Instead, use the supported mechanism for building kernel modules,
which allows us to remove a lot of code from the Makefile and gives
us some measure of future-proofing.

FIXES 127578

Change-Id: Ibccea4507f57660becb4fb39a57b50c15ea4cb07
Reviewed-on: http://gerrit.openafs.org/5042
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-18 09:40:57 -07:00
Ben Kaduk
1ec64ba50e libafs: switch to hardcoded source names with CRULE
Most of the userspace tree uses AFS_CCRULE for how to compile
things.  We cannot use this directly for libafs, since in the
general case kernel and userland code may need to be treated
with an entirely different compiler and compiler options.
Switching libafs fully to a (e.g.) LIBAFS_CCRULE would be a substantial
amount of work, and require a lot of testing.  However, we can
stop passing -c $? (the out-of-date sources) in CRULE_{NO,}OPT
and add the source file after each invocation of the CRULEs,
an incremental step towards LIBAFS_CCRULE.
This has the extra advantage of not causing issues when integrating
with kernel module build systems that automatically add dependencies
to all object file targets. (In such cases, $? expands to multiple files
and 'gcc -o foo.o -c' bails out.)

Most of this change was automatically generated from the following
awk script:
==========
/[a-zA-Z_0-9].o:/ {path=$2;}
/^      \$\(CRULE_/ {print $0,path;}
!/^     \$\(CRULE_/ {print;}
==========

Change-Id: I22b8eeaee730feb37b2527d44d6548e7b13b9a0a
Reviewed-on: http://gerrit.openafs.org/5040
Tested-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-18 09:40:40 -07:00
Simon Wilkinson
4356fcbb5b vlserver: Handle logging of non-rxkad classes
Expand the 'rxinfo' function so that it is not rxkad specific, and
add the framework to allow other security classes to be added to it.

Change-Id: Idb514be6aafbc69154a7aba4b0ece3330b8b3aed
Reviewed-on: http://gerrit.openafs.org/5031
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-17 22:27:12 -07:00
Ben Kaduk
e798bcaf97 FBSD: use better casts in vop_advlock
In the bsd.kmod.mk world, the compiler bails when we cast a pointer
directly to int.  Cast through intptr_t as the supported mechanism.
On amd64, this loses bits, but since this instance is just attempting
to use the value as a unique handle, it is probably okay for now.
However, it should be addressed more properly eventually, when
this locking implementation sees wider use.

Change-Id: I4fe8084c14a97dc4efc8d74e9971b1540c028e40
Reviewed-on: http://gerrit.openafs.org/5034
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-17 22:22:51 -07:00
Ben Kaduk
135b41ec7e FBSD: Use correct path for ufsmount.h include
The two lines above it already used </ufs/ufs/...> correctly.
In the bsd.kmod.mk world, this will let us get rid of some
more symlink hackery in libafs, since the system's '@' symlink
will point to the system headers directly.

Change-Id: I97dd779c2c7a119f51972b02e185a17264911151
Reviewed-on: http://gerrit.openafs.org/5036
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-17 11:11:56 -07:00
Ben Kaduk
d10f62a7e7 FBSD: cast pointers appropriately
Since the bsd.kmod.mk build uses -Werror.

Change-Id: I4bc34477a36ae8946272c1830080ddd9add5cd00
Reviewed-on: http://gerrit.openafs.org/5035
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-17 11:11:36 -07:00
Ben Kaduk
037f3251cd FBSD: Remove include directive for nonexistent file
In the bsd.kmod.mk world, this becomes a fatal error.

Change-Id: I14315982fac48bf392d9f3a06422f5c4707bc3b9
Reviewed-on: http://gerrit.openafs.org/5033
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-17 07:49:00 -07:00
Simon Wilkinson
9d3d4b30af Fix broken make dest rules
Commit ffb6864f0f is missing some
semi-colons in assorted dest rules, which breaks the make dest target.

Change-Id: Ie6f88878604f1043256f1683e1d228e16d568f50
Reviewed-on: http://gerrit.openafs.org/5037
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-16 22:02:13 -07:00
Michael Meffie
45025e949b audit: remove uneeded strncpy
In this caller to krb_realms, when no realms names are returned the
number of local realms is correctly set to zero, however the first
local realm buffer is filled with a placeholder string which is
not used.  Remove the uneeded strncpy, which also makes this
section of code consistent with afs_is_foreign_ticket().

This section of code is duplicated by afs_is_foreign_ticket() and
should be consolidated in a subsequent patch.

Change-Id: I48f84934e7321769eebaf80c83b2c100fd026a6a
Reviewed-on: http://gerrit.openafs.org/5020
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-16 22:01:42 -07:00
Andrew Deason
607c0aaaa4 UKERNEL: Avoid using parameters named "new"
Alter the prototypes in afs_usrops.h to avoid using the name "new", in
order to make the header usable by C++ code.

Change-Id: I21165b5c1e33e9229172d9f8e797d65fc954bb77
Reviewed-on: http://gerrit.openafs.org/5038
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-16 22:01:13 -07:00
Garrett Wollman
df4843c4b1 util: clean up two #ifs
Use defined(...) in two instances to avoid warnings.

Change-Id: I0a574283e2384c7cfb2f58884570e78e3fed3bc6
Requested-by: Simon Wilkinson
Reviewed-on: http://gerrit.openafs.org/5005
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-15 12:35:06 -07:00
Garrett Wollman
1f181307d5 util: try again to satisfy the gatekeepers
Apply a two-clause BSD license to src/util/pthread_threadname.c. Note
that the claim of copyright in this file refers to the derivative work
consisting of the original code combined with the text of the license.

Change-Id: Id75badee03cb85a23778088aa9cb49d8c92eb5d0
Reviewed-on: http://gerrit.openafs.org/5025
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-15 12:34:16 -07:00
Simon Wilkinson
ffb6864f0f Make --enable-pthreaded-ubik do what it claims
The configure help text for --enable-pthreded-ubik says
    "enable installation of pthreaded ubik applications"

This patch set makes the behaviour in the code match that. Instead
of controlling whether the pthreaded ubik code is compiled at all,
the configure option now just controls whether it is installed. This
means that we'll always build the pthread code, and so should reduce
the number of times it is inadvertently broken.

Change-Id: I8b2ffb46e01157f2043cf7daf68e69580ea285c5
Reviewed-on: http://gerrit.openafs.org/5028
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-15 12:28:26 -07:00
Simon Wilkinson
f56f273155 Fix pthreaded ubik dest and install rules
Fix the dest and install rules for pthreaded ubik, and its servers, so
that they match the current Makefile style.

Change-Id: Ifd3bd181772e278518f2a90167b6524d6045645c
Reviewed-on: http://gerrit.openafs.org/5027
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-15 12:27:27 -07:00
Andrew Deason
20a2422c14 util: Include pthread.h in afsutil_prototypes.h
afsutil_prototypes.h can reference pthread_t when we are in
AFS_PTHREAD_ENV. So, include pthread.h to guarantee we get the
definition for pthread_t.

Change-Id: Ib46c2cf3b3fdd2dcd61a7b8ac4d5512fecd084ff
Reviewed-on: http://gerrit.openafs.org/5023
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-14 13:58:35 -07:00
Ben Kaduk
b6d05986f0 Install afszcm.cat for i386_fbsd make dest
Because we missed it in gerrit/4815.

Change-Id: I653c4259a0bbe926abac80c09e32ff3bc35f2de2
Reviewed-on: http://gerrit.openafs.org/5022
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-14 13:29:27 -07:00
Derrick Brashear
e2980f3d70 volser: remove pragma requiring ultranew gcc
this won't fly with the gcc in the field most places. move along.

Change-Id: I54de25c4986e574ca5b34b850807b10374d9d8ad
Reviewed-on: http://gerrit.openafs.org/5013
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 22:07:43 -07:00
Marc Dionne
a76e65034c Linux: remove unused variable
endindex is not used, remove it

Change-Id: I50a89e3f25828c05fd24f4fc6a1068007a68dbc2
Reviewed-on: http://gerrit.openafs.org/5012
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 22:07:24 -07:00
Simon Wilkinson
0e4c227d62 rxkad: Suppress warnings for ticket5.c
rxkad's ticket5.c includes v5gen.c, a generated file from Heimdal.
This file contains a load of set-but-unused variable warnings. As we
currently have no way of portably suppressing just these warnings,
turn off warnings-as-errors for ticket5.c

Change-Id: I739cee4f345523fce130c73c713c7309273f5bee
Reviewed-on: http://gerrit.openafs.org/5003
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 19:59:02 -07:00
Simon Wilkinson
6840d8dfb8 volser: fix set-but-unused variable warning
restorevol reads the magic number from the dump, then does nothing
with it. Rather than not reading it at all, just mark the variable that
it is read into as unused to supress the compiler warning.

Change-Id: I371e2556e3661836f6256fac255ae79005d9ffaa
Reviewed-on: http://gerrit.openafs.org/5002
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 19:58:35 -07:00
Jeffrey Altman
130155ff3c Windows: not safe to dereference before locking
Throughout cm_server.c, input parameters to functions that
are protected by cm_serverLock are dereferenced by assignment
during variable initialization prior to the cm_serverLock being
obtained.  As a result there is a race which can result in
either list corruption or dereferencing freed memory.

Change-Id: I4fa42b9ae0af5eb7c44ea868b4ea6ca9e4e0bb92
Reviewed-on: http://gerrit.openafs.org/4985
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-13 19:46:37 -07:00
Simon Wilkinson
beda3b239a vol: Initialise list before error exit when cloning
The inode list wasn't being initialised before the first call into the
error handler. This makes it possible that we end up trying to discard
items from an uninitialised list, with all the chaos that would cause.
Fix things so that this list is correctly set up.

Change-Id: I5dbc33e2e1a9a4ca1bdf4b2f7e56f33af87ccc1a
Reviewed-on: http://gerrit.openafs.org/5001
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 15:52:30 -07:00
Simon Wilkinson
53cc2ebaea volser: Actually return errors from ListOneVolume
The return code from GetVolInfo was being thrown away, and success
returned to the caller, regardless of the success of this function.
As GetVolInfo's exit codes aren't suitable for sending over the wire,
just return ENODEV if this function returns failure.

Change-Id: Ie4adbbd98f5006a9aa50ed9bf73ea9e4344fabf3
Reviewed-on: http://gerrit.openafs.org/5000
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 15:18:47 -07:00
Simon Wilkinson
9bb81711a5 Mark nearInode as unused
When we're building an inode fileserver, we use the nearInode hint.
The IH_CREATE macro just throws this hint away if we're building namei,
which leads to compiler warnings about set-but-unused variables. Just
flag nearInode as being potentially unused in order to suppress these
warnings.

Change-Id: I25022dc859974e9311e4530a9eeee8ab1d77c373
Reviewed-on: http://gerrit.openafs.org/4999
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 15:18:23 -07:00
Simon Wilkinson
85b8372b44 Don't split int64s when we don't need to
Now that we're always using an int64, and never a hyper_t, to represent
64bit integers, we can just print them out and assign them using the
native tools, rather than having to call SplitInt64. Simplify our code
to do so, which also avoids some gcc-4.6.0 warnings.

Change-Id: I12cfb5401d0431be2a4fefdfc5e1f52df7d5764d
Reviewed-on: http://gerrit.openafs.org/4998
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 14:37:36 -07:00
Simon Wilkinson
8df379696c afsio: Remove unused 'code' value
main always return 0, so don't bother getting an exit value back from
cmd_Dispatch that we have no intention of doing anything with.

Change-Id: I0085adbfdb886d89acc7f4203ddb6f7a10281dfc
Reviewed-on: http://gerrit.openafs.org/4997
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 13:28:17 -07:00
Simon Wilkinson
093b5108a3 uss: Remove unused variables
Remove assorted unused variables, both those used to capture error
returns, and so unused (but initialised) string pointers, to make
gcc 4.6.0 happier.

Change-Id: I8cdcfb7175b48c79ce2b1a312d6a5fe6ab5c1989
Reviewed-on: http://gerrit.openafs.org/4996
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 12:57:12 -07:00
Simon Wilkinson
96b4f4be97 scout: Remove unused error codes
Remove unused error returns, and make gcc 4.6.0 a little bit happier

Change-Id: Ic1fe541ed860a739ac3e2aa2978cbb8b92ec1a8d
Reviewed-on: http://gerrit.openafs.org/4995
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 12:57:02 -07:00
Simon Wilkinson
d6b1573995 libadmin: Remove unused error codes
A number of functions in the libadmin vos implementation set up
error values, and assign them to 0, but never actually use them
for anything (either further assignment, or returning to the user)
So, just remove these unecessary variables, and make gcc 4.6.0 a
little happier.

Change-Id: Ia4a4a7d8cda855d904f2a84092928f227ea83f3b
Reviewed-on: http://gerrit.openafs.org/4994
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 12:17:34 -07:00
Simon Wilkinson
fa71561e49 bozo: Remove unused error codes assignments
This removes a couple of unreported error code assignments. Firstly,
the return from 'setsid' was being assigned to 'ec' and promptly
ignored, and secondly, the response from SendNotifierData was
being ignored. As there is nothing sensible to do with these error
codes, just ignore them properly.

Change-Id: Ifff8c7b5b7950e467570d26ce5f92fe5f11a51e9
Reviewed-on: http://gerrit.openafs.org/4993
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 11:34:25 -07:00
Simon Wilkinson
00061610b9 afsmonitor: Fix set-but-unused variable warnings
Tidy up the afsmonitor code to remove gcc 4.6.0's set-but-unused
variable warnings. These are all assignments to error code
values which are never checked, or reported.

Change-Id: I8d48a6defe848d7cf477ac747aa330fc8ed1b276
Reviewed-on: http://gerrit.openafs.org/4992
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 11:12:29 -07:00
Simon Wilkinson
cd8ebb14e5 libafs: Remove support for length optimisation
At one point afs_StoreAllSegments had an optimisation to speed up
stores. However, that optimistation used the chunkLength without
taking appropriate locks, and was disabled. The variable assignments
which still exist from this code cause errors with gcc 4.6.0, so just
remove them.

Change-Id: I86547d94280d7f07214fbf6ef5b3db61c9781e59
Reviewed-on: http://gerrit.openafs.org/4991
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 10:35:11 -07:00
Simon Wilkinson
6a03341df6 libafs: Fix warnings in PPrefetchFromTape
The PrefetchFromTape pioctl had a number of set-but-unused variable
warnings. Tidy up the code to remove these warnings.

Change-Id: I358f7e31ab8e9f03447675be40dc8571650dbe72
Reviewed-on: http://gerrit.openafs.org/4990
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 09:56:45 -07:00
Simon Wilkinson
4e9a49c58a libafs: Fix statistics for PrefetchFromTape pioctl
The PrefetchFromTape pioctl was overloading SetAcl's statistics. Give
it a slot of its own.

Change-Id: I5698f8861af1b5e9771d138ca93a28f676df349b
Reviewed-on: http://gerrit.openafs.org/4989
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 09:56:36 -07:00
Simon Wilkinson
beaf9a4e3e libafs: Remove unused DNLC LRU code
The LRU code in osi_dnlc_lookup has never been enabled in OpenAFS,
and causes compilation errors with gcc 4.6.0 - just remove the unused
code and its associated variables.

Change-Id: Ifc09bbb857406b9bfcbf436c35e36289567f65cf
Reviewed-on: http://gerrit.openafs.org/4988
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 09:56:21 -07:00
Simon Wilkinson
37f41897fb libafs: Remove unused NAT markeddown code
Remove unused code which used to retry once when a server was
marked down due to a bad NAT. This code has never been enabled
in OpenAFS, and causes compile errors with gcc 4.6.0

Change-Id: Idc978a68e81ccb761117c97200607e30c98627dc
Reviewed-on: http://gerrit.openafs.org/4987
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 09:56:08 -07:00
Garrett Wollman
8adf4cd0b0 util: introduce a common interface for setting thread names
A previous change added support for setting thread names/titles to
viced; this change moves the #ifdef spaghetti to src/util in
preparation for calling it from other places where it would be
useful.  Two functions are defined, one for setting an arbitrary
thread's name (as might be done by the spawning thread) and one
for setting the current thread's name; the latter is also defined as
a macro for non-pthreads compilations so that it can be called
unconditionally (the interface does not reference any
pthread-specific data types).  Note that some platforms, Mac OS X
in particular, do not allow setting the name of a different thread.

The two functions are defined as no-ops for Windows as our pthreads
emulation layer for Windows does not provide the needed mechanism.

Make viced use the new interface.

Change-Id: I58c65a28772d8d188c03d6ff3a6f052889362fb7
Reviewed-on: http://gerrit.openafs.org/4966
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 09:55:22 -07:00
Simon Wilkinson
470bab9d56 Add PERLUAFS to libuafs's git ignore
Change-Id: I0067ba4c9b4f2b57ded862bc5cfe33a2c419d108
Reviewed-on: http://gerrit.openafs.org/5004
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 07:10:00 -07:00
Simon Wilkinson
6a27e228ba rpms: Use git version information
Use the git version information when building RPMS, rather than hard
coding it into configure.ac.

Change-Id: I477629b4102f48a9669ff67aae429c08862a5afc
Reviewed-on: http://gerrit.openafs.org/4983
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 06:27:35 -07:00
Derrick Brashear
4470d849ec macos: note additional vfs features
currently we have inode numbers which do not change. note it.
additionally, we support large files. note it.

Change-Id: I77090d3ccc3ba9952e14f2be13946ef2e91a6af7
Reviewed-on: http://gerrit.openafs.org/4973
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-12 13:23:14 -07:00
Ken Dreyer
8bface302c Red Hat: update build script for newer Fedora versions
Remove old Fedora versions and add the currently-supported ones.

Change-Id: Ib514328cf944ea601028fb99273046cb2f5ea828
Reviewed-on: http://gerrit.openafs.org/4925
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-12 11:58:31 -07:00
Antoine Verheijen
2d794a5e5d Remove pre-existing assert macro in hcrypto header.
The config.h header for hcrypto defines an assert macro for
use by RX. OpenBSD already has an assert macro definition so
this new one causes screaming by the compiler about
re-definition. This patch adds the directives to remove any
pre-existing definition of assert, if one exists, prior to
defining the new one.

Change-Id: I01d5a1f26617fecfd0ffcc3930a7c7881beb8183
Reviewed-on: http://gerrit.openafs.org/4958
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-12 11:15:31 -07:00
Michael Meffie
02aa30893f salvager: do not redefine SalvageVolumeGroup
Do not use the c preprocessor to redefine the SalvageVolumeGroup()
function name.

Change-Id: I3d48ee28dc03be702d0427d74725ff1e99ec6411
Reviewed-on: http://gerrit.openafs.org/4965
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-12 11:14:05 -07:00
Derrick Brashear
5ec998a016 macos: fix shlib link list
link shared libs from the right place, lib not etc

Change-Id: I3d58d1f65b479b7c23c1bb0978eacea99b114541
Reviewed-on: http://gerrit.openafs.org/4971
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-12 11:05:46 -07:00
Simon Wilkinson
84a3c4714f rpms: Fix handling of x86 architectures
Once upon a time, our specfile would assume that if you were
building for i386 you were building userspace, and that i586 or i686
implied doing a kernel only build. This is no longer the case, and
now everything on modern Fedora is built for i686, so we should adapt
the spec file for this.

Change-Id: Ia56b9b15d0b28672a8411417d38937ed45ee93a1
Reviewed-on: http://gerrit.openafs.org/4970
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-12 11:05:05 -07:00
Simon Wilkinson
15c073887b rpms: Fix our %version handling
When we're doing version requirements in -devel package Requires:
lines, we should be using %{version}-%{release}, not just %{version}

FIXES 130137

Change-Id: I2d10c6fa362d3cbfa786c270996fa8ae75b9db20
Reviewed-on: http://gerrit.openafs.org/4969
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-12 11:04:35 -07:00
Michael Meffie
82e772bed0 salvager: check namei linktable header magic
Recreate the namei linktable file if the header magic
is bad.

Change-Id: I1e8c2d101cf1dd1d375a965684d95f6708e8c601
Reviewed-on: http://gerrit.openafs.org/4968
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-12 09:32:48 -07:00
Jeffrey Altman
27af8b4b53 Windows: always open dscp in smb_ReceiveNTTranCreate
There were two code paths in smb_ReceiveNTTranCreate that included
asserts in case the directory cm_scache_t object had not been
evaluated.  RT129299 contains a report that at least one of
them had been tripped in production.  There is no reason to avoid
evaluating the directory scp.  It must exist in the cache and
obtaining a reference in all cases simplifies the logic of this
overly complex function.

FIXES 129299

Change-Id: I7b32c81f11c3fef53f8a21a44f3594d5cd9e1552
Reviewed-on: http://gerrit.openafs.org/4967
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-12 09:32:27 -07:00
Garrett Wollman
ee05a1b086 viced: If platform supports setting a thread title, do so
Some pthread libraries support setting a name or title for individual
threads (analogous to setproctitle() for processes).  This can be useful
for debugging and is sometimes published for use by utilities like ps
(again like setproctitle() for processes).  The two most common variants
of this have the same signature with slightly different function names.
If either one is present, use it in viced (which already assigns a thread
name when compiled for LWP but ignores it in pthreads compilations).

Change-Id: I5486aa6a21dbc3c8885b94ad52c2b1a66baae81f
Reviewed-on: http://gerrit.openafs.org/4950
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-11 11:32:11 -07:00
Jeffrey Altman
52fee71403 Windows: Move file server lock releases to daemon
Create a new lock daemon thread which performs regular
cm_LockCheck() calls.  If a lock is deleted check the cm_scache_t
to see if the matching file server lock should be dropped.   If yes,
drop it.

This effectively caches file server locks for two seconds after
they are released to provide a chance for subsequent local lock
requests on the same file to avoid a file server RPC.  It also
ensures that windows processes do not thrash the file server and
force callback breaks.

Change-Id: I1c452e231ff282d9b45026aed1b02ab0c5932a77
Reviewed-on: http://gerrit.openafs.org/4964
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-11 00:57:08 -07:00
Ken Dreyer
1accef4e77 Red Hat: use repoquery to find kernels in build script
Remove the custom yum Python code in favor of repoquery.

Change-Id: Ifb185297666e5365974c342814ed3c2d2a54092e
Reviewed-on: http://gerrit.openafs.org/4926
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-10 06:58:04 -07:00
Antoine Verheijen
3559e5c8ed OpenBSD: Add <sys/queue.h> header for <sys/lockf.h>
On OpenBSD, the <sys/lockf.h> header requires the TAILQ_* macros
which are defined in <sys/queue.h>. The latter is not automatically
included by <sys/lockf.h> . This patch makes sure that it is
available by putting it into the OpenBSD-specific param.h files
(so as not to impact any other OS).

Change-Id: I8281b085eed2a6dec1f096ad9a6e96078c1e4af0
Reviewed-on: http://gerrit.openafs.org/4956
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-10 06:55:04 -07:00
Garrett Wollman
53434c828d viced: indent nested preprocessor directives
Make viced.c look more like other source files by indenting nested
preprocessor directives.  In a few case it made more sense to
eliminate the nesting.  This should otherwise be a whitespace-only
chnage.

Change-Id: I895ea2f754f90a15daa73cea24d3da9576fff9c9
Reviewed-on: http://gerrit.openafs.org/4959
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-10 06:50:59 -07:00
Jeffrey Altman
99b43273c0 rx: prevent connection channel assignment race
When rx was converted to use pthreads, the code that allocates
a call to a connection channel in rxi_ReceivePacket() was not
made thread safe.  The code prior to this patchset permitted a race
in the server connection case.  The rx_connection channel assignment
in rxi_ReceivePacket() and the call destruction in rxi_FreeCall()
and rxi_DestroyConnectionNoLock() did not consistently protect the
rx_connection channel array using the conn_call_lock.

This race could result in rxi_ReceivePacket() operating on a
rx_call which was disconnected from the previously assigned
rx_connection.

In addition, the code in rxi_ReceivePacket() that was intended
to protect the allocation of a call using rxi_NewCall() to the
connection channel array was racy with itself.

This patchset consistently applies the conn_call_lock to protect
the allocation / deallocation of calls to the connection channel
array and in the process simplifies the logic in rxi_ReceivePacket()
as it is no longer necessary to protect against a null call pointer
since the race can no longer be lost.

Change-Id: Id61b55b4d1d57a2b9b35ea942545ef4bdc8d33f3
Reviewed-on: http://gerrit.openafs.org/4963
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-10 06:50:29 -07:00
Jeffrey Altman
88b4e2e527 windows: include cmp_Cmd_Ref_3_en_US component
when building installers actually include the html 3 man pages

Change-Id: I03e47d24fa79c888dc49a9dba7e0388dafe6ce59
Reviewed-on: http://gerrit.openafs.org/4961
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-09 07:35:35 -07:00
Jeffrey Altman
da6c97678f Windows: out of order lock smb v3 locking
Do not obtain the smb_rctLock after holding the cm_scache_t->rw
lock.

At most one hold is required in case of lock failure.  Obtain
it as the start of processing and drop it at the end if not required.

Change-Id: I370321b087df480336c833d68e348d7f62d227b3
Reviewed-on: http://gerrit.openafs.org/4955
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-07-09 05:14:45 -07:00
Andrew Deason
3505c444f6 Add AFS::ukernel libuafs perl bindings
Add the SWIG-generated AFS::ukernel perl module, which provides perl
bindings to libuafs calls.

Change-Id: I5ce480944a8c97cbca72c80e79fc40c0edb0962f
Reviewed-on: http://gerrit.openafs.org/2048
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-08 22:20:06 -07:00
Andrew Deason
bbd505a8e1 Add afsload
Add afsload, a set of scripts used to synchronize the activity of
numerous libuafs cache managers for testing/simulation purposes.

Change-Id: I6f797d5968ea4ba3c29c1b13251f743c7d02d60d
Reviewed-on: http://gerrit.openafs.org/4906
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-08 22:16:28 -07:00
Andrew Deason
21edc432dc doc: Add support for section 3 man pages
Generate and install man pages (and their HTML versions) for library
reference documentation in section 3.

Change-Id: I500818097c6880e0412794661393351ab14461dc
Reviewed-on: http://gerrit.openafs.org/3898
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-08 22:16:10 -07:00
Jeffrey Altman
21854e03eb Windows: Improve logging for StoreMini and cm_BufWrite
Add trace logging to cm_StoreMini which never had it before.

Improve the logging of cm_BufWrite by adding the trucPos value
which is the new length of the file that is being reported to
the file server.

Remove cm_buf_t data references when cm_BufWrite is performing
operations using rx_Writev and iovec structures.

Change-Id: I28798eb2232e739f665eb51499305a7a1898f824
Reviewed-on: http://gerrit.openafs.org/4924
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>
2011-07-07 14:20:57 -07:00
Jeffrey Altman
1ac219f537 Windows: Refactor cm_Unlock*() to avoid code duplication
cm_Unlock() and cm_UnlockByKey() duplicate a significant amount
of code.  Refactor it into a new static function, cm_IntUnlock()
which handles the process of downgrading or releasing a file
server lock depending upon the lock state of the cm_scache_t
object.

Change-Id: Ic5db7b3928fc0477f155183326321717ea04ace0
Reviewed-on: http://gerrit.openafs.org/4923
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>
2011-07-07 14:17:33 -07:00
Jeffrey Altman
1a56229910 Windows: Do not probe new servers from cm_UpdateVolumeLocation
cm_NewServer() can result in a call to cm_UpdateVolumeLocation()
if a server probe is performed.   In order to avoid recursive
calls to cm_UpdateVolumeLocation() do not probe new servers from
within cm_UpdateVolumeLocation().

Change-Id: Icdb8efe030ae3e1f714ca72ad741bd38c692697f
Reviewed-on: http://gerrit.openafs.org/4922
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>
2011-07-07 12:46:17 -07:00
Andrew Deason
e1e0083386 afs: Use 64-bit inode numbers
When we have a 64-bit ino_t, use the full 64 bits, instead of always
limiting ourselves to 32 bits.

Change-Id: I8f9f552b230e1723c8b77bfe92213ca43816240c
Reviewed-on: http://gerrit.openafs.org/4921
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-07 05:24:38 -07:00
Andrew Deason
2dc7ee2757 afs: Consolidate afs_calc_inum
Instead of having two separate afs_calc_inum functions, just have one
afs_calc_inum, and split off the md5 inode code into its own function
under a LINUX20 ifdef.

Change-Id: I400d2e70403905da40055238ffc2bb785659e9e0
Reviewed-on: http://gerrit.openafs.org/4920
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-06 22:51:10 -07:00
Andrew Deason
3a33ce4a33 afs: Use afs_calc_inum everywhere
The algorithm for calculating inode numbers was copied in several
places in libafs. Make them all use afs_calc_inum instead.

Change-Id: Ie835a0b92bf940b78090fd7ca4e36aace1df9767
Reviewed-on: http://gerrit.openafs.org/4919
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-06 22:50:41 -07:00
Andrew Deason
42943aead4 afs: Use cell for md5 inode numbers
When calculating the inode number for a file with md5 inodes, include
the cell number in the calculation, in order to reduce collisions
between cells.

Change-Id: I4b939042dd993419f785a78e87e68cf346b56e26
Reviewed-on: http://gerrit.openafs.org/4902
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-07-06 22:50:14 -07:00
Andrew Deason
0a51946f7c uss: Suppress more warnings from lex.yy.c
Specify -Wold-style-definition when compiling lex.yy.c. This allows us
to compile when --enable-checking is specified and our lex generates
code with old-style function definitions.

Change-Id: I09c87fd6274b5850952a8aaf63f0e3358100d567
Reviewed-on: http://gerrit.openafs.org/4905
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-06 13:42:33 -07:00
Andrew Deason
39083fe1ed afs: Ensure afs_calc_inum yields nonzero ino
afs_calc_inum can currently yield an inode of 0 if MD5-based inode
numbers are turned on. Some userspace applications (and for some
platforms, maybe even the kernel) make certain assumptions about the
inode number for a file; in particular for example, 'ls' will not
display a file with inode 0 in a normal directory listing.

So, read the md5 digest until we get a non-zero result. Fall back to
the non-md5 calculation if we still somehow end up with a 0.

While this case may at first glance seem to be extremely rare, in
practice it can occur, as the current calculation for volume
538313506, vnode 26178 does actually yield a 0.

Change-Id: Iee1ef4cc2ad66269f2c677e29d586ef0964d7c70
Reviewed-on: http://gerrit.openafs.org/4901
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-07-06 13:41:46 -07:00
Andrew Deason
cdd9f78f05 Add a few missing .gitignore entries
Change-Id: Ibe1498c504defc0e1779b8764c091a98576a588a
Reviewed-on: http://gerrit.openafs.org/4904
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-06 11:08:17 -07:00
Andrew Deason
78e39417af vol: Don't always FDH_REALLYCLOSE on linktable ops
If we dec a linktable entry or get a free tag from the link table,
there is no reason to FDH_REALLYCLOSE the linktable fd handle.
FDH_REALLYCLOSE is the same as FDH_CLOSE, except that it tells the
ihandle package that the file handle will not be used again soon. If
we dec a linktable entry or get a free tag, there is no reason to
think that, so just FDH_CLOSE the handle instead.

Change-Id: I5f48a78528a75b984201f9ee0563b142ef59baf9
Reviewed-on: http://gerrit.openafs.org/4903
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-01 20:18:29 -07:00
Andrew Deason
1ecac71e50 DAFS: Do not clear salv state on fssync salvage
When a volume is put into an error state via the FSYNC_VOL_FORCE_ERROR
command, we clear the salvage state informaton on it, since we're
forcing it offline and thus inaccessible. However, if we are forcing
it to an error state because the volume needs salvaging, we just
salvage it. In this case, do not clear the salvage state, since we
need to know if we've already requested or scheduled a salvage so we
can correctly keep track of the number of salvages performed.

Change-Id: Ic4efd7a78bfb1b99a5308f0c67e81f4779dfe545
Reviewed-on: http://gerrit.openafs.org/4900
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-01 20:17:37 -07:00
Andrew Deason
31a001f60e SOLARIS: Granular multiPage detection
Currently, a struct vcache has a multiPage counter, indicating how
many afs_getpage requests are in-flight for that vcache that involve
retrieving multiple pages. Any dcache associated with such vcaches are
then avoided when choosing dcache entries to evict from the cache,
since we may deadlock when trying to evict a dcache entry from one of
the earlier afs_GetOnePage calls in a particular afs_getpage request.

This behavior can cause the client to become unusable if the cache
becomes full, and the only items in the cache are dcache entries in a
file that has an in-flight multi-page afs_getpage request. Since, in
that case, we cannot kick out any entries from the cache, and so we
wait forever to wait for the cache utilization to go down.

To prevent this from occurring, record exactly which ranges in the
file have in-flight multi-page afs_getpage requests, and just avoid
dcache entries in those ranges. This way afs_GetDownD can evict dcache
entries in the same file, but still avoid entries that would cause a
deadlock.

Also add some comments explaining this situation a bit more.

Change-Id: Idb305c8b7511065301739542772d16d4fe8cd574
Reviewed-on: http://gerrit.openafs.org/4896
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-06-30 07:28:05 -07:00
Andrew Deason
8017773587 Remove nonsensical bozon-lock defines
Currently there are two preprocessor defines related to bozon locks:
AFS_BOZONLOCK_ENV, and AFS_NOBOZO_LOCK. The former creates the pvnLock
member of a struct vcache, and controls calls to e.g. afs_BozonLock in
cross-platform code. The latter, if defined, turns calls to e.g.
afs_BozonLock into no-ops.

It doesn't make any sense to have both of these, since if
AFS_BOZONLOCK_ENV and AFS_NOBOZO_LOCK are defined, the pvnLock member
exists but is never used, since afs_BozonLock &co are no-ops. On
Solaris, the only platform where AFS_NOBOZO_LOCK is currently defined
(DUX used to define it before DUX was dropped), this is the case.

So to make things a bit more clear, get rid of the AFS_NOBOZO_LOCK
define, and just use AFS_BOZONLOCK_ENV to dictate whether we do
anything with bozon locks (ppc_darwin_80 appears to be the only
platform at this time).

Remove AFS_BOZONLOCK_ENV from Solaris param files, since it doesn't
use bozon locks. Remove all references to pvnLock in Solaris-specific
code.

Change-Id: Id72c14ec5485d35b853d38e2ea1a944a385f2b5b
Reviewed-on: http://gerrit.openafs.org/4889
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-06-30 07:27:52 -07:00
Andrew Deason
e4c2810f41 Remove support for Solaris pre-8
Remove support for all Solaris and SunOS platforms prior to Solaris 8,
since Solaris 7 reached end-of-life in August of 2008. Remove all
non-documentation references to sunx86_57 and earlier, sun4x_57 and
earlier, and AFS_SUN57_ENV and earlier.

References to AFS_SUN58_ENV have been changed to AFS_SUN5_ENV where
appropriate, and AFS_SUN5_ENV now implies Solaris 8.
AFS_SUN57_64BIT_ENV has been renamed to AFS_SUN5_64BIT_ENV.

Change-Id: Ia64ce7da7bfc685fa28a5119c51ec740625456e3
Reviewed-on: http://gerrit.openafs.org/4888
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-06-30 07:27:39 -07:00
Jeff Blaine
a4e3c3be69 Change wiki ref to wiki.openafs.org from stanford.edu
Change wiki ref to wiki.openafs.org from stanford.edu

Change-Id: I2bb70d79da529aee7a810264542aa3b381dcb972
Reviewed-on: http://gerrit.openafs.org/4897
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-30 06:13:05 -07:00
Jeffrey Altman
70c5cb7b5d rx: race in rx_multi processing
multi_Init() registers an arrival procedure which is called when
the first response packet for the call arrives.  If the call times
out the multi_Body loop will call rx_EndCall() and then set
multi_h->calls[multi_i] to NULL.  If the first data packet of the
call arrives before rx_EndCall() is executed, then the arrival
procedure, multi_Ready(), will be executed adding the call to the
firstNotReady list.  When the multi_Body loop attempts to process
the call from the firstNotReady list it attempts to dereference
the NULL multi_call.  This race was introduced by
be4abb4ec8.

multi_h->calls[multi_i] is set to NULL as an indicator to
multi_Finalize() that rx_EndCall() has already been processed
for the call.  When rx_EndCall() is executed the arrival
procedure is cleared.

If rx_EndCall() has already been processed, the fact that
the arrival procedure has been executed must be ignored.  Add
an additional check in multi_Body for a non-NULL call pointer
to skip the startProc and rx_FlushWrite processing on the
no longer existent call.

Note that it is not safe to hold onto the call reference after
rx_EndCall() has been processed since the call slot may be
reused for a new RPC before the multi processing on all calls
is complete.

Change-Id: Ib4694a7e1d133f621d15e79534a42f780b141e34
Reviewed-on: http://gerrit.openafs.org/4890
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-28 12:51:44 -07:00
Jeff Blaine
131cbaa0cf Change -n to -dryrun for backup subcommands
Change -n to -dryrun for "don't do it, show it though" operation
to be in line with agreement on -dryrun in place of -noexecute
or -n.  Updated man page POD sources to reflect the changes
and updated README to remove these specific todo line items.

Change-Id: I5c1361dcc866ea3d1efbb0c0ddcd4a7fe513c816
Reviewed-on: http://gerrit.openafs.org/4827
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-06-28 09:53:15 -07:00
Jeffrey Altman
c643f455cb vos: refactor ListAddrs
refactor ListAddrs to be more readable.   Clarify that -uuid and
-host cannot be issued at the same time.  Rename 'nentries' to
'max_index' so it is clear that ubik_VL_GetAddrs() is issued
to set an upper-bound for the number of subsequent ubik_VL_GetAddrsU()
calls that are issued when neither -host nor -uuid are specified.

Change-Id: Icbd511722728396fda837abba39a3e6809f4d26c
Reviewed-on: http://gerrit.openafs.org/4754
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>
2011-06-28 06:28:57 -07:00
Jeffrey Altman
51fa590e70 Windows: MergeStatus before SyncOpDone
cm_SyncOp/cm_SyncOpDone is used to synchronize the RPC processing
to ensure that calls which are in conflict cannot occur at the
same time but also to ensure that the ordering of operations
is consistent.  cm_MergeStatus() was in many cases executed after
cm_SyncOpDone() removed the synchronization barrier which in turn
permitted status information to be applied out of order.  Side
effects could have included data loss due to client side file
truncation.  More commonly two StoreData RPCs would have their
status information applied out of order forcing the cache manager
to invalidate all of the cached data for the file.

Change-Id: I8073da701cf11cd0df2b901e81180de7c193ae23
Reviewed-on: http://gerrit.openafs.org/4891
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-06-27 08:18:55 -07:00
Jeffrey Altman
9f77a2d6b3 Windows: TRANS2_FIND_FIRST2 for _._AFS_IOCTL_._
smb_T2SearchDirSingle() must not fail directory search requests
for the _._AFS_IOCTL_._ file.  Although this file does not actually
exist, it is successfully processed by CreateFile operations.
Therefore, an explicit search for it should return a valid answer.

Change-Id: I9df3443f0bdf0dd05caac74f4de3a0cc64d26800
Reviewed-on: http://gerrit.openafs.org/4884
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-06-25 16:20:56 -07:00
Jeffrey Altman
7532b05221 Windows: Fix SMB_COM_NEGOTIATE for MS11-043
MS11-043 adds response validation for SMB_COM_NEGOTIATE messages
received by the SMB Redirector.  OpenAFS failed to properly specify
a Challenge and DomainName in the response when the security mode
is SMB_AUTH_NONE (or share with password).  This patchset corrects
smb_ReceiveNegotiate() so that it adheres to the protocol specification.

FIXES 130033

Change-Id: I3dc6e571326c7259a39d30bd80b5986ff35c743c
Reviewed-on: http://gerrit.openafs.org/4886
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-06-25 09:54:02 -07:00
Jeffrey Altman
358099b21c Revert "Rx: When call receive is done, send ack all packet"
This reverts commit 3cd3715e60,
which replaces an ack with an ackall; ackall processing does
not actually mark all packets acked when it is received, so
it is insufficient.

Change-Id: I7ee90e1190688570cf3b268229972064480283cc
Reviewed-on: http://gerrit.openafs.org/4837
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-06-23 08:48:22 -07:00
chas williams - CONTRACTOR
137dd23494 doc: prefer fop to generate pdf from docbook
It would seem xsltproc -> fop -> pdf is the "modern" way to generate
pdf from docbook now.  The hard part is finding the stylesheets.
This should work for fedora, sles and debian.  Additionally, it brings
some consistency--xsltproc for all the conversions.  You can still
override via configure options if you prefer something else.

Change-Id: Id779e9473a6759daddc9a61be714109b27da980e
Reviewed-on: http://gerrit.openafs.org/4821
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-06-22 11:01:53 -07:00
Jeffrey Altman
1ac8468ad9 roken: add search.h to .gitignore
Change-Id: Iab524de2757af982b00ff09048b6cb4ee34d797e
Reviewed-on: http://gerrit.openafs.org/4879
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-06-22 08:00:26 -07:00
Andrew Deason
f5349051ab DAFS: Do not attach a specialStatus'd vol
If we encounter a preattached volume during GetVolume, we currently
ignore vp->specialStatus before trying to attach. However, we will
generally always fail to attach due to a conflicting vol op, but even
if we don't, GetVolume always returns an error later on if
vp->specialStatus is set. So, same some processing and attempted
attachments by bailing out sooner if vp->specialStatus is set.

Change-Id: Id5df08fe31073485e4d733c42310b42090ee8e7b
Reviewed-on: http://gerrit.openafs.org/4874
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-22 05:56:27 -07:00
Andrew Deason
926ce3d350 salvager: Clear summary in RecordHeader
Not every field in the summary header in RecordHeader is set, leaving
some used uninitialized when we copy to the given volumeSummaryp (like
'deleted'). Zero out the header before we do anything.

Change-Id: I94f6e5c8b8c60675de25eb6f8290de9545ff4dd0
Reviewed-on: http://gerrit.openafs.org/4876
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-06-22 05:55:30 -07:00
Andrew Deason
f2d067b4e4 Build a separate copy of vlib for dasalvager
Currently dasalvager links to vlib.a. But vlib.a is built without any
DAFS defines, and so the size of a struct DiskPartition64 is different
(since dasalvager is built with AFS_DEMAND_ATTACH_UTIL). Build our own
copies of the volume package files instead, with
AFS_DEMAND_ATTACH_UTIL defined.

Change-Id: I7b9f965fc18b6e6b71275912684ad041aaef19f4
Reviewed-on: http://gerrit.openafs.org/4875
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-06-22 05:55:18 -07:00
Andrew Deason
3f47779f51 dir: Remove extraneous printf from Create
Change-Id: Id226d5457119a9f898aa35bc7b4d4db830a2f7fc
Reviewed-on: http://gerrit.openafs.org/4878
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-06-21 22:15:28 -07:00
Andrew Deason
9f8757650c dir: Fix DRead
DRead was missing a return statement in one of the cases where we
found the buffer we were looking for, so we locked the buffer but kept
looking. Return it instead.

Change-Id: If72a0ba3ce60a847f2796b51a82f0f473bbc608a
Reviewed-on: http://gerrit.openafs.org/4877
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-06-21 22:15:09 -07:00
Andrew Deason
25688bc2e7 vol: Do not overwrite specialStatus in attach2
attach2 wants to set specialStatus to VBUSY in certain conditions
(such as, it discovers a conflicting vol op where VVolOpSetVBusy_r is
true). However, specialStatus may already be set to something else,
like VMOVED if the volume is being moved off of the server. This can
happen if the volserver has checked out and FSYNC_VOL_MOVE'd a
preattached volume but hasn't deleted or checked the volume back in
yet.

So, if specialStatus is already set, don't touch it, so we don't start
reporting VBUSY errors to clients when we should be reporting VMOVED,
or some other error code previously set.

Change-Id: Icb2895036620f186230e1558b8bc04d18cc45c86
Reviewed-on: http://gerrit.openafs.org/4873
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-06-21 21:56:56 -07:00
Simon Wilkinson
6b833f5757 rx: Exit fast restart on non-duplicate ACK
The current code only exits fast restart when we receive an ACK
packet that contains no missing chunks at all. On a network that is
dropping a reasonable chunk of its packets, this means that we spend
most of the call in fast recovery. (I originally found this by running
with the intentionally drop packets feature set to 10%)

TCP's fast retransmit behaviour is that we stay in fast recovery until
we receive our first non-duplicate acknowledgement. In TCP that means an
acknowledgement that moves the window. In RX, it is an acknowledgment
that ACKs a new packet.

Change-Id: If8e461dd91315be845397dd1bf42771c9223d156
Reviewed-on: http://gerrit.openafs.org/4869
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-06-21 18:59:24 -07:00
Simon Wilkinson
91b351e88b rx: Don't limit the # of packets sent in recovery
The RX transmit engine limits the number of packets sent whilst in
loss recovery to one per invocation of the transmit engine. As the
engine cannot be called by the application thread whilst in recovery,
this means that we end up being limited to one packet per ACK received,
which means that despite a growing congestion window we'll only send
one packet per RTT (in effect, a congenstion window of 1).

This will remain the case until we exit recovery, and all of a sudden
can send a large number of packets. If this is larger than the current
capacity of the network, we'll probably end straight back in recovery
again.

Let the congestion window do its job, by removing this arbitrary limit.

Change-Id: I9f21138662b0918d6d2b885f0fb5ada7fa4c79ec
Reviewed-on: http://gerrit.openafs.org/4868
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-06-21 18:59:19 -07:00
Simon Wilkinson
0b9c9e9973 rx: Don't wait for TQ busy when entering recovery
Two different threads can cause a call to enter recovery. The event
thread will move a call into recovery as a result of a timeout, or
the listener thread will move it there following a fast retransmit.

In both of these cases, recovery looks different. In the case of
a timeout, we enter slow start, starting as if we were begininning
transmission for the first time. Following fast retransmit, we enter
fast recovery, with different starting parameters than those coming
from slow start.

As a reslt, the current behaviour, where either call sitting in
FAST_RECOVERY_WAIT causes the other to simply return is inappropriate.

Further investigation indiciates that FAST_RECOVER_WAIT is actually
uncessary. There is no harm caused to a thread which is currently
blocked on the network in the middle of a transmit, in adjusting the
window size underneath it. As both of these states collapse the window,
that thread will simply cease sending earlier.

So, simplify the code, and remove the potential race between event and
listener by removing the FAST_RECOVER_WAIT state.

Change-Id: Ic2e7606136ca04c869685345b63101c346ce702b
Reviewed-on: http://gerrit.openafs.org/4867
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-06-21 18:59:13 -07:00
Simon Wilkinson
e8c4fc4f37 rx: Enter loss recovery when we retransmit
Since I mistakenly wrote commit 36e2d13b, RX hasn't entered congestion
avoidance when a loss event occurs. This is bad, because on todays
networks the majority of packet losses are due to some form of
congestion.

Now that the timeout code has been restructured, the chances of entering
the retransmit routine in error are much much smaller, so this code
needs to be restored.

This change reverts 36e2d13b55. However,
the original RX code has the problem that it assumes that all forms of
fast recovery are the same - in particular, that the call settings that
result from entering fast recovery due to a fast retransmit are
identical to those resulting from a timeout. This is not the case, and
this will be fixed in a later change.

Change-Id: Iedb34437db9fcfbc90307b01e566a8d089eef4bb
Reviewed-on: http://gerrit.openafs.org/4866
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-06-21 18:59:04 -07:00
Simon Wilkinson
0118fb5387 rx: Add Karn-style backoffs to RX retransmits
When we retransmit a packet, we may be doing so because the RTT of the
connection has grown dramatically larger than earlier within the call.
However, RX doesn't permit all ACKs to retransmitted packets to be
counted within the RTT calculation.

So, adopt the same approach as Karn developed for TCP, and as described
in detail in RFC2988. When a retransmit event occurs, backoff the
connection RTT by doubling its value, and hold at this doubled value
until either another retransmit occurs (in which case we back off again,
up to a predetermined ceiling), or we receive an ACK packet which we
can use within the RTT calculation, in which case we drop back down to
the newly measured value.

This change replaces the per-packet backoff strategy originally
implemented in RX (which, whilst allowing resent packets more chance of
arriving, doesn't help with computing a correct RTT).

Change-Id: I715dc673a0b379733e3be26fa594ea13f492a58f
Reviewed-on: http://gerrit.openafs.org/4865
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-06-21 18:58:57 -07:00
Simon Wilkinson
784babbea1 rx: Make clock_Add correctly add to itself
With the existing clock_Add code, the following:
    struct clock a = {2, 800000};
    clock_Add(&a, &a);
gives a clock value of {6, 600000}, rather than the expected {5, 60000}.

This is because the ordering of instructions leads it to double count
the carry on the seconds field. Reorder the instructions so that the
carry is correctly applied.

Change-Id: Ia71b387ce521a11e4caf9ec200907efe1d2be8ff
Reviewed-on: http://gerrit.openafs.org/4864
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-06-21 18:58:51 -07:00
Simon Wilkinson
280c801525 rx: Remove resending logic into its own function
Create a new function, rxi_Resend, which is the entry point to running
the transmit queue as a result of a resend event. This concentrates all
of the resend logic into one place, removes the need for
rxi_StartUnlocked, and means that rxi_Start's arguments don't need to
match those of an event handler.

Change-Id: I550ebbbae63b7d659bb980eea709a14882038914
Reviewed-on: http://gerrit.openafs.org/4863
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-21 18:54:52 -07:00