openafs.git
12 years agoWindows: Make use of SMB interface a runtime decision
Jeffrey Altman [Sat, 3 Sep 2011 22:13:31 +0000]
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>

12 years agoWindows: pioctl path retrying with \\afs\all
Jeffrey Altman [Fri, 6 Aug 2010 22:24:47 +0000]
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>

12 years agoWindows: remove MULTIHOMED ifdef
Jeffrey Altman [Sat, 3 Sep 2011 03:51:59 +0000]
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>

12 years agoWindows: missing ! in update volume location
Jeffrey Altman [Fri, 2 Sep 2011 22:36:13 +0000]
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>

12 years agoWindows: improve handling of volume rename
Jeffrey Altman [Fri, 2 Sep 2011 22:32:40 +0000]
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>

12 years agoWindows: refactor volume location updates
Jeffrey Altman [Fri, 2 Sep 2011 22:28:31 +0000]
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>

12 years agomacos: update 32 bit kernel build flags
Derrick Brashear [Thu, 11 Aug 2011 14:39:11 +0000]
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>

12 years agoxserver lock order violation
Derrick Brashear [Tue, 23 Aug 2011 04:20:37 +0000]
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>

12 years agoxvcb lock order violation
Derrick Brashear [Mon, 22 Aug 2011 18:56:03 +0000]
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>

12 years agoredhat: mockbuild updates for repoquery
Derrick Brashear [Tue, 30 Aug 2011 05:18:37 +0000]
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>

12 years agoWindows: correct CheckOfflineVolumeState logic
Jeffrey Altman [Tue, 30 Aug 2011 13:49:11 +0000]
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>

12 years agoxstat: cm xstat time values are 32 bit
Michael Meffie [Fri, 12 Aug 2011 18:29:48 +0000]
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>

12 years agoaklog: work around lion kerberos disaster
Derrick Brashear [Thu, 25 Aug 2011 00:40:38 +0000]
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>

12 years agoWindows: afslogon network provider debug registry value
Jeffrey Altman [Sun, 28 Aug 2011 16:03:53 +0000]
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>

12 years agoWindows: afslogon NPLogonNotify exit on KTC_NOCM
Jeffrey Altman [Sun, 28 Aug 2011 16:02:14 +0000]
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>

12 years agoWindows: afslogon.dll is not a file system interface
Jeffrey Altman [Fri, 26 Aug 2011 17:57:15 +0000]
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>

12 years agoWindows: torture error reporting
Jeffrey Altman [Fri, 26 Aug 2011 13:36:04 +0000]
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>

12 years agolibafs: crash in a more useful way if nchunks is zero
Garrett Wollman [Tue, 9 Aug 2011 03:59:17 +0000]
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>

12 years agolibafs: FillStoreStats doesn't need to be global; avoid pass-by-pointer
Garrett Wollman [Thu, 11 Aug 2011 01:52:44 +0000]
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>

12 years agodoc: missing $DBTOEPUB variable in the Makefile
chas williams - CONTRACTOR [Sat, 13 Aug 2011 14:29:31 +0000]
doc: missing $DBTOEPUB variable in the Makefile

Change-Id: I623859ae58fea6a602221ca5d111605004b4a27f
Reviewed-on: http://gerrit.openafs.org/5256
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agoihandle: Fix IH_REALLYCLOSE for positional I/O
Andrew Deason [Wed, 24 Aug 2011 17:48:19 +0000]
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>

12 years agoihandle: Actually assert active fdPs are not AVAIL
Andrew Deason [Wed, 24 Aug 2011 17:30:00 +0000]
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>

12 years agoLINUX vcache lock ordering in afs_linux_readdir
Matt Benjamin [Wed, 24 Aug 2011 20:23:37 +0000]
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>

12 years agoroken: no strcasecmp
Derrick Brashear [Thu, 25 Aug 2011 02:53:38 +0000]
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>

12 years agoWindows: change buf_Find*() signature to accept cm_fid_t
Jeffrey Altman [Tue, 23 Aug 2011 20:02:28 +0000]
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>

12 years agoWindows: do not drop lock unnecessarily
Jeffrey Altman [Sun, 21 Aug 2011 04:37:34 +0000]
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>

12 years agoWindows: cm_serverLock read required not write
Jeffrey Altman [Sun, 21 Aug 2011 04:36:44 +0000]
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>

12 years agoWindows: Be more efficient when processing locks
Jeffrey Altman [Fri, 19 Aug 2011 01:58:50 +0000]
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>

12 years agoWindows: be explicit when mapping sharing violation
Jeffrey Altman [Fri, 19 Aug 2011 01:57:12 +0000]
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>

12 years agoWindows: Track file server lock count
Jeffrey Altman [Fri, 19 Aug 2011 01:53:45 +0000]
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>

12 years agoWindows: remove signed/unsigned mismatch cm_aclent.c
Jeffrey Altman [Tue, 23 Aug 2011 01:12:25 +0000]
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>

12 years agoWindows: avoid duplicate volume update queries
Jeffrey Altman [Tue, 9 Aug 2011 18:26:33 +0000]
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>

12 years agodir: verified pathnames fallout
Marc Dionne [Sun, 21 Aug 2011 16:02:29 +0000]
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>

12 years agopod: use /OPTIONS when referring to the local OPTIONS section
chas williams - CONTRACTOR [Sat, 13 Aug 2011 15:01:28 +0000]
pod: use /OPTIONS when referring to the local OPTIONS section

Change-Id: I889e3a89f5cc68b816a822b6a23db30ac6fe2357
Reviewed-on: http://gerrit.openafs.org/5257
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agodoc: generate admin ref from the pod documentation
chas williams - CONTRACTOR [Sat, 13 Aug 2011 14:18:45 +0000]
doc: generate admin ref from the pod documentation

a bit convoluted but this generates docbook from the pod documentation and
from that pdf, epub and mobi versions.  we are using variablelist.as.block
since that looks prettier on smaller devices/screen.

Change-Id: I5cd51ef10448373960a0aeed15212bbcf6f44039
Change-Id: Ib222dbfa30e3af644b1dbc6738df1d39cc33c92f
Reviewed-on: http://gerrit.openafs.org/5255
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoDon't fail to build documentation if kindlegen doesn't exist
Russ Allbery [Sun, 24 Jul 2011 23:20:05 +0000]
Don't fail to build documentation if kindlegen doesn't exist

Check for kindlegen in configure and do nothing in the MOBI build
rule if the binary didn't exist.

This is still a bit of a hack since the rule will run with every
invocation of make.  The target needs to be made conditional.  But
at least this way make all in the documentation directory doesn't
fail.

Change-Id: I57f158929b3907678b9848a60edb9765136f7dbb
Reviewed-on: http://gerrit.openafs.org/5090
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agoWindows: avoid cm_serverLock refcount leak
Jeffrey Altman [Mon, 22 Aug 2011 13:00:47 +0000]
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>

12 years agolibafs: don't crash if afs_write() is called with zero-length uio
Garrett Wollman [Sat, 13 Aug 2011 22:34:47 +0000]
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>

12 years agoWindows: torture test updates
Jeffrey Altman [Tue, 16 Aug 2011 14:49:46 +0000]
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>

12 years agoAdd NEWS entries for the 1.6.0 final release
Russ Allbery [Tue, 16 Aug 2011 03:20:31 +0000]
Add NEWS entries for the 1.6.0 final release

The date will be slightly off from when it will be officially announced,
but it should be close enough.

Change-Id: Icb678bd2da148f59546f5e3d5cfda0251e76bdca
Reviewed-on: http://gerrit.openafs.org/5287
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agoPrefer dblatex to docbook2pdf
Russ Allbery [Sun, 24 Jul 2011 23:22:35 +0000]
Prefer dblatex to docbook2pdf

docbook2pdf, at least in version 0.6.14-1.1 in Debian, dies while
attempting to build the Admin Guide with an error about TeX capacity
exceeded.  dblatex seems to work reliably.  If both are installed,
prefer dblatex to docbook2pdf.

Change-Id: I7cf594c677cde84410bfefacf07cbbf398026ff3
Reviewed-on: http://gerrit.openafs.org/5091
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Russ Allbery <rra@stanford.edu>

12 years agomacos: fix race in afs_root
Derrick Brashear [Mon, 15 Aug 2011 16:17:06 +0000]
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>

12 years agorpm: Update CellServDB
Simon Wilkinson [Mon, 15 Aug 2011 09:25:27 +0000]
rpm: Update CellServDB

The commit (a5d66d05fa0308d505de8bde59442e29be9d04f8) 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>

12 years agoWindows: add assertions to cm_scache.c
Jeffrey Altman [Mon, 15 Aug 2011 04:37:31 +0000]
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>

12 years agoWindows: cm_ShutdownSCache corrections
Jeffrey Altman [Mon, 15 Aug 2011 04:34:00 +0000]
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>

12 years agoWindows: Save Wix config at start if possible
Jeffrey Altman [Mon, 15 Aug 2011 04:23:57 +0000]
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>

12 years agoWindows: More interlocked ops for cm_cell flags
Jeffrey Altman [Mon, 15 Aug 2011 01:41:47 +0000]
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>

12 years agoWindows: Interlocked ops for cm_user flags
Jeffrey Altman [Mon, 15 Aug 2011 01:41:19 +0000]
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>

12 years agoCellServDB update 14 Aug 2011
GCO Public CellServDB [Sun, 14 Aug 2011 22:43:08 +0000]
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>

12 years agoWindows: cm_FindServerByUuid correct lock acquisition
Jeffrey Altman [Sun, 14 Aug 2011 22:15:24 +0000]
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>

12 years agoWindows: prevent cm_server races
Jeffrey Altman [Sun, 14 Aug 2011 04:14:10 +0000]
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>

12 years agolibafs: don't call afs_PutDCache(NULL) in afs_GetDownD()
Garrett Wollman [Sat, 13 Aug 2011 22:51:02 +0000]
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>

12 years agolibafs: don't free a null pointer in an unlikely error condition
Garrett Wollman [Sat, 13 Aug 2011 23:01:26 +0000]
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>

12 years agolibafs: don't free the NULL we get from a failed allocation
Garrett Wollman [Sat, 13 Aug 2011 23:12:50 +0000]
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>

12 years agoWindows: Insert Server Reference List changes
Jeffrey Altman [Sat, 13 Aug 2011 18:35:53 +0000]
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>

12 years agoWindows: Fix cm_serverRef ref counts
Jeffrey Altman [Fri, 12 Aug 2011 23:02:48 +0000]
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>

12 years agoWindows: remove unused variables in fs.c
Jeffrey Altman [Fri, 12 Aug 2011 23:01:56 +0000]
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>

12 years agoaklog: attempt to warn about needed weak crypto switch for Lion
Derrick Brashear [Fri, 12 Aug 2011 20:54:03 +0000]
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>

12 years agoredhat: update dkms config
Derrick Brashear [Fri, 12 Aug 2011 22:25:24 +0000]
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>

12 years agodir: Protect against circular hash chains
Simon Wilkinson [Sat, 16 Jul 2011 21:59:12 +0000]
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>

12 years agolibafs/dir: Verify directory pathnames
Simon Wilkinson [Sat, 16 Jul 2011 21:57:55 +0000]
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>

12 years agoWindows: ChangeLog for 1.6.0 (final)
Jeffrey Altman [Fri, 12 Aug 2011 20:30:26 +0000]
Windows: ChangeLog for 1.6.0 (final)

Change-Id: Idd457c7ea4617f9d698d07359f750df25bab4c7c
Reviewed-on: http://gerrit.openafs.org/5239
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

12 years agoFBSD: coalesce three assignments to the same variable
Garrett Wollman [Fri, 12 Aug 2011 04:39:54 +0000]
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>

12 years agovolser: log host address of caller in extra logging
Michael Meffie [Fri, 12 Aug 2011 12:25:30 +0000]
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>

12 years agoviced: avoid aborting on host table exhaustion
Derrick Brashear [Thu, 11 Aug 2011 15:11:01 +0000]
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>

12 years agorx: make queue macros easier to follow
Garrett Wollman [Thu, 11 Aug 2011 03:20:57 +0000]
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>

12 years agomacos: axe static vfs_fsentry
Derrick Brashear [Thu, 11 Aug 2011 14:43:16 +0000]
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>

12 years agoWindows: Interlocked operations for cm_buf
Jeffrey Altman [Wed, 10 Aug 2011 20:40:35 +0000]
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>

12 years agoWindows: Interlocked for cm_buf cmFlags
Jeffrey Altman [Wed, 10 Aug 2011 15:42:59 +0000]
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>

12 years agoWindows: fix tptserver director creation
Jeffrey Altman [Wed, 10 Aug 2011 16:02:20 +0000]
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>

12 years agoWindows: Interlocked ops for cm_volume
Jeffrey Altman [Wed, 10 Aug 2011 15:41:21 +0000]
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>

12 years agoWindows: Interlocked ops for cm_scache
Jeffrey Altman [Wed, 10 Aug 2011 15:40:35 +0000]
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>

12 years agoWindows: Interlocked ops for cm_cell
Jeffrey Altman [Wed, 10 Aug 2011 15:37:51 +0000]
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>

12 years agoWindows: implement InterlockedAnd/Or for X86 Debug
Jeffrey Altman [Tue, 9 Aug 2011 21:25:50 +0000]
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>

12 years agoWindows: correct prototype for ChangeList fs_acl.h
Jeffrey Altman [Tue, 9 Aug 2011 21:25:22 +0000]
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>

12 years agoWindows: make osi_Log macro safe for if..else
Jeffrey Altman [Sun, 7 Aug 2011 18:11:17 +0000]
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>

12 years agostds.h: __nonnull__ has four underscores
Garrett Wollman [Thu, 11 Aug 2011 01:21:40 +0000]
stds.h: __nonnull__ has four underscores

Compile-testing AFS_NONNULL doesn't prove anything until something
actually uses it.  Fix 342be3535499c5ecd7d34b4edd43a4655559cb28
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>

12 years agomacos: reset next vcache pointer after reacquiring xvcache
Derrick Brashear [Wed, 10 Aug 2011 13:39:23 +0000]
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>

12 years agoFBSD: catch up with the disappearance of VOP_GETVOBJECT
Garrett Wollman [Wed, 10 Aug 2011 04:18:28 +0000]
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>

12 years agostds.h: introduce AFS_NONNULL
Garrett Wollman [Wed, 10 Aug 2011 03:50:09 +0000]
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>

12 years agovolinfo: Include nfs.h
Andrew Deason [Wed, 10 Aug 2011 15:23:40 +0000]
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>

12 years agoaklog: Add -config option
Simon Wilkinson [Sun, 31 Jul 2011 14:14:00 +0000]
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>

12 years agopts: Add the -config option
Simon Wilkinson [Wed, 27 Jul 2011 10:30:51 +0000]
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>

12 years agovenus depends on libafsauthent
Marc Dionne [Mon, 8 Aug 2011 20:08:25 +0000]
venus depends on libafsauthent

Add an explicit dependency on libafsauthent for src/venus, since it
is needed to build afsio.  This can cause parallel builds to fail.

Change-Id: Ifda59983cda0711e9e1568d5a6be25e6ea934eee
Reviewed-on: http://gerrit.openafs.org/5171
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agopam: fix unused but set warnings
Marc Dionne [Mon, 8 Aug 2011 21:08:34 +0000]
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>

12 years agovolser: flag unused variable
Marc Dionne [Mon, 8 Aug 2011 20:51:53 +0000]
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>

12 years agobos: don't dereference a null pointer when printing an error message
Garrett Wollman [Tue, 9 Aug 2011 03:26:38 +0000]
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>

12 years agodir/vol: Die() really does
Garrett Wollman [Tue, 9 Aug 2011 03:19:22 +0000]
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>

12 years agovos: eliminate unnecessary global variables
Garrett Wollman [Tue, 9 Aug 2011 02:49:24 +0000]
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>

12 years agovolser: let it be known that Abort() really aborts
Garrett Wollman [Tue, 9 Aug 2011 01:41:57 +0000]
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>

12 years agokdb: don't dereference a null pointer on corrupt database
Garrett Wollman [Tue, 9 Aug 2011 01:18:15 +0000]
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>

12 years agoafsd: look in the right place for -splitcache argument
Garrett Wollman [Sun, 7 Aug 2011 04:35:36 +0000]
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>

12 years agoafs_pioctl: don't use cell uninitialized in PGetTokens2
Garrett Wollman [Sun, 7 Aug 2011 04:09:33 +0000]
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>

12 years agobutc: avoid freeing uninitialized pointer in writeDbDump()
Garrett Wollman [Sun, 7 Aug 2011 03:55:50 +0000]
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>

12 years agopam: stop building it wrong
Derrick Brashear [Wed, 3 Aug 2011 17:05:27 +0000]
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>

12 years agopam: clean up unused variables and prototyping
Derrick Brashear [Wed, 3 Aug 2011 17:56:08 +0000]
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>

12 years agorx: avoid nat ping until connection is attached
Derrick Brashear [Mon, 1 Aug 2011 20:38:46 +0000]
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>

12 years agobutc: avoid testing stack garbage; remove dead initializer
Garrett Wollman [Sun, 7 Aug 2011 03:49:10 +0000]
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>

12 years agobutc: initialize startTime before it is used
Garrett Wollman [Sun, 7 Aug 2011 03:36:14 +0000]
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>

12 years agovos: don't free stack garbage on error
Garrett Wollman [Sun, 7 Aug 2011 03:15:14 +0000]
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>