openafs.git
8 years agoRemove dead code from rxi_FindIfnet()
Ben Kaduk [Sat, 3 Dec 2011 01:24:04 +0000]
Remove dead code from rxi_FindIfnet()

There is a separate implementation for DARWIN and XBSD above, so
having a check for DARWIN here is pointless.

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

8 years agorx: Refactor MaxMTU error checking
Simon Wilkinson [Sun, 20 Nov 2011 16:29:55 +0000]
rx: Refactor MaxMTU error checking

The error checking on the rxMaxMTU parameter was done individually by
every server that sets it, using "internal" RX #defines to do so.
Instead, do the error checking within the function that actually sets
the MTU, reducing both the amount of code duplication, and the amount
of RX knowledge held within the servers.

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

8 years agosalvager: Create link table with volume group id
Andrew Deason [Fri, 2 Dec 2011 20:36:59 +0000]
salvager: Create link table with volume group id

The link table needs to be created with the VG id or RW vol id, not
the non-RW vol id. Unlike other special inodes, this goes for both the
'parent' and 'volume' volume ids, not just the 'parent' id, since
there is only one link table per VG.

Without this, the salvager can generate invalid linktable special
inodes if it encounters a VG with no inodes for the RW vol.

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

8 years agoDAFS: Ensure logging on attach2 errors
Andrew Deason [Wed, 30 Nov 2011 23:41:53 +0000]
DAFS: Ensure logging on attach2 errors

The attach2 error path transitions a volume to VOL_STATE_ERROR, in
case whatever got us to that error path did not already put the volume
in an appropriate state. Log when we do this, to make sure we do not
end up with a volume in VOL_STATE_ERROR state silently.

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

8 years agoDAFS: Avoid unnecessary preattach on FSYNC_VOL_ON
Andrew Deason [Wed, 30 Nov 2011 23:35:56 +0000]
DAFS: Avoid unnecessary preattach on FSYNC_VOL_ON

FSYNC_VOL_ON/FSYNC_VOL_ATTACH can be called to "online" a volume that
was actually kept online for the duration of the volume operation.
Avoid calling VPreAttachVolumeByVp_r for such a volume if it's already
attached, in order to avoid an unnecessary log message and to save a
tiny bit of processing.

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

8 years agoDAFS: Log more for VPreAttachVolumeByVp odd states
Andrew Deason [Wed, 30 Nov 2011 23:21:32 +0000]
DAFS: Log more for VPreAttachVolumeByVp odd states

When we encounter "odd" states in VPreAttachVolumeByVp_r, say what the
actual state we encountered was, along with the attach flags, so we
have a better idea of what's going on.

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

8 years agoDAFS: Ensure GetVolume errors on ERROR volumes
Andrew Deason [Wed, 30 Nov 2011 23:08:57 +0000]
DAFS: Ensure GetVolume errors on ERROR volumes

In GetVolume, after we call VAttachVolumeByVp_r, there is no explicit
check to see if vp is in VOL_STATE_ERROR state. Make sure we don't try
to use such a volume, or blindly transition the volume away from that
state.

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

8 years agoDAFS: Do not transition to ERROR on trivial errors
Andrew Deason [Wed, 30 Nov 2011 20:36:06 +0000]
DAFS: Do not transition to ERROR on trivial errors

attach2 can result in many different errors; some indicate that the
volume is in an inconsistent state, but many others just indicate that
the volume cannot be attached for benign reasons (such as VNOVOL if
the volume doesn't exist, or VOFFLINE if the volume is being used by a
volume utility). Currently, for DAFS, attach2 transitions the relevant
volume to the VOL_STATE_ERROR state for almost all errors encountered,
even the benign ones. Instead, skip the error state transition for
error handling paths that do not reflect a "broken" volume.

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

8 years agoWindows: GetInfoTip really set return to NULL
Jeffrey Altman [Fri, 2 Dec 2011 23:49:23 +0000]
Windows: GetInfoTip really set return to NULL

When we are not returning an info-tip string from the shell
extension the string output parameter must be set to NULL.

Change-Id: I63cd9bbe078edd01e62d4b0c810a513dfbf205ae
Reviewed-on: http://gerrit.openafs.org/6183
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoWindows: memset in RDR_RequestFileExtentsAsync
Jeffrey Altman [Fri, 2 Dec 2011 18:41:38 +0000]
Windows: memset in RDR_RequestFileExtentsAsync

The logic in RDR_RequestFileExtentsAsync() made it possible
for memset() to be called multiple times on a buffer that
is already known to be up to date.  Restructure the code to
make things faster.

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

8 years agoWindows: cm_MergeStatus redirector invalidation
Jeffrey Altman [Fri, 2 Dec 2011 18:36:01 +0000]
Windows: cm_MergeStatus redirector invalidation

The redirector maintains its own cached status information which
must be updated when a DV change occurs that is not the result
of a redirector initiated data change.

If the current old DV is BAD, send a DV change notification.

If the DV has changed and request was not initiated by the
redirector, send a DV change notification.

If the request was initiated by the redirector, send a notification
for store and directory operations that result in a DV change greater
than the number of active RPCs or any other operation that results
in an unexpected DV change such as FetchStatus.

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

8 years agoWindows: cm_MergeStatus use new DV to purge buffers
Jeffrey Altman [Fri, 2 Dec 2011 18:31:15 +0000]
Windows: cm_MergeStatus use new DV to purge buffers

When deciding whether or not to purge buffers on a DV change
it is the new DV that matters not the old DV.  If the new DV
is 0, there should be no purging because there are no buffers
to purge.

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

8 years agoWindows: use interlocked increment on cm_buf_t refcnt
Jeffrey Altman [Fri, 2 Dec 2011 18:21:24 +0000]
Windows: use interlocked increment on cm_buf_t refcnt

For consistency use interlocked increment when setting the
cm_buf_t refCnt to 1 even though it is protected by a lock.

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

8 years agoWindows: buf_GetNewLocked should use cleaned cm_buf
Jeffrey Altman [Fri, 2 Dec 2011 16:21:46 +0000]
Windows: buf_GetNewLocked should use cleaned cm_buf

buf_GetNewLocked() searches the free buffer list for a buffer
that has a 0 refcnt, is not in the chunk that is being populated,
is not actively having I/O performed on it and is not dirty.
If it comes across a dirty buffer, it calls buf_Clean() with
the assumption that buf_CleanAsync() (as it was previously called)
was in fact asynchronous and would return immediately.  Instead
buf_Clean() is synchronous and when it completes the buffer will
in most cases be clean.  buf_GetNewLocked() should use the newly
cleaned buffer if it is still available and not continue the
search from the next entry in the free buffer list.

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

8 years agoWindows: fix buf_Recycle() comment
Jeffrey Altman [Fri, 2 Dec 2011 16:19:13 +0000]
Windows: fix buf_Recycle() comment

buf_Recycle() does not return with a reference count to the
cm_buf_t object held.  Correct the comment.

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

8 years agoWindows: buf_CleanAsync is not async; rename it
Jeffrey Altman [Fri, 2 Dec 2011 16:14:11 +0000]
Windows: buf_CleanAsync is not async; rename it

buf_CleanAsync() calls cm_BufWrite() which stores the dirty
buffers synchronously.  There is nothing asynchronous about
buf_CleanAsync() so rename it to buf_Clean() and buf_CleanAsyncLocked()
to buf_CleanLocked().   Update the comments to remove the references
to the asynchronous processing which doesn't exist.

That is not to say that the call to buf_Clean() in buf_GetNewLocked()
should not be asynchronous; it should.  There is no such functionality
at the moment.  One approach would be to modify buf_IncrSyncer to
trigger on an event set by buf_GetNewLocked() instead of the call
to buf_Clean().  Another approach would be registering a background
store event.  In any case, that is for another patchset.

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

8 years agoWindows: convert buf_IncrSyncer to pthreads
Jeffrey Altman [Fri, 2 Dec 2011 16:11:59 +0000]
Windows: convert buf_IncrSyncer to pthreads

buf_IncrSyncer() calls rx therefore it should be a pthread
thread so as not to count against the 63 native thread count
limit.

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

8 years agoWindows: invalidate rdr for CM_SCACHE_VERSION_BAD
Jeffrey Altman [Thu, 1 Dec 2011 04:29:56 +0000]
Windows: invalidate rdr for CM_SCACHE_VERSION_BAD

If the cm_scache_t.dataVersion is set to CM_SCACHE_VERSION_BAD,
invalidate the redirector notion of status so that we do not
leak info to users that do not have permission.

If the dataVersion is CM_SCACHE_VERSION_BAD and is updated
with real status info, invalidate the redirector so it attempts
to read the directory contents.

Change-Id: Iaa15b37f7f1863169ffe93ae9bc3d24086a3b734
Reviewed-on: http://gerrit.openafs.org/6159
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoWindows: do not set CM_SCACHEFLAG_EACCES twice
Jeffrey Altman [Thu, 1 Dec 2011 04:28:46 +0000]
Windows: do not set CM_SCACHEFLAG_EACCES twice

correct a merge error.

Change-Id: Iaf57703403a5c7555da730be0907bd31c9dfb34f
Reviewed-on: http://gerrit.openafs.org/6158
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoSOLARIS: Define BSD_COMP for non-UKERNEL on 5.11
Andrew Deason [Thu, 1 Dec 2011 17:20:41 +0000]
SOLARIS: Define BSD_COMP for non-UKERNEL on 5.11

We were defining BSD_COMP twice for UKERNEL. Move one of the #define's
up to the !UKERNEL section.

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

8 years agoafsd.fuse: link libopr
Derrick Brashear [Thu, 1 Dec 2011 17:34:38 +0000]
afsd.fuse: link libopr

needed for rbtrees. linktest does so; we also need to

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

8 years agoremove CopyOnWrite2 and unused vars
Derrick Brashear [Wed, 30 Nov 2011 21:20:23 +0000]
remove CopyOnWrite2 and unused vars

unused static functions make grumpy compilers grumpy.

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

8 years agoviced: disable accelerated copyonwrite
Derrick Brashear [Sun, 27 Nov 2011 16:23:29 +0000]
viced: disable accelerated copyonwrite

don't do multistage CoW

FIXES 130295
Change-Id: Iec35619b970d87a72ed497d4bbec0b9415c9ddf7
Reviewed-on: http://gerrit.openafs.org/6135
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

8 years agoWindows: AFSRDFSProvider log to file
Jeffrey Altman [Tue, 29 Nov 2011 20:02:12 +0000]
Windows: AFSRDFSProvider log to file

For when logging via OutputDebugString() is insufficient, add
a cheap method of logging to a fixed file: c:\temp\AFSRDFSProvider.log.
Set AFSRedirector\NetworkProvider "Debug" to 0x2.

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

8 years agoWindows: NPEnumResources no Printer support
Jeffrey Altman [Tue, 29 Nov 2011 20:01:00 +0000]
Windows: NPEnumResources no Printer support

The AFS Redirector does not support printer shares.  If the
query is for printers only (or any other query that does not
permit disk shares as a response) return no more entries.

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

8 years agoWindows: NPGetConnectionCommon buffer too small
Jeffrey Altman [Tue, 29 Nov 2011 19:59:24 +0000]
Windows: NPGetConnectionCommon buffer too small

If the specified buffer size is too small, say so.  Do not
attempt to copy data in that won't fit.  Do not walk beyond
the end of the allocated memory.

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

8 years agoWindows: no drive subst for NPCancelConnection
Jeffrey Altman [Tue, 29 Nov 2011 19:55:55 +0000]
Windows: no drive subst for NPCancelConnection

NPCancelConnection() must use the results of a Get Connection
ioctl to the afs redirector and not the result of Drive Letter
Substitution queries via DosQueryDevice().  Rename NPGetConnection()
to NPGetConnectionCommon() and add a new parameter to indicate
whether drive substitution is ok.

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

8 years agoWindows: refactor NPCancelConnection
Jeffrey Altman [Tue, 29 Nov 2011 19:54:24 +0000]
Windows: refactor NPCancelConnection

refactor NPCancelConnection to consolidate some conditional
blocks to improve readability.

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

8 years agoWindows: Mount Point and Symlink Overlay Icons
Chris Orsi [Sat, 26 Nov 2011 22:26:10 +0000]
Windows: Mount Point and Symlink Overlay Icons

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

8 years agoWindows: Wix disable integrated logon by default
Jeffrey Altman [Mon, 28 Nov 2011 23:42:21 +0000]
Windows: Wix disable integrated logon by default

One of the significant differences between the NSIS and Wix
installer packages is that NSIS does not activate integrated
logon by default whereas the Wix installer does.  Enabling
integrated logon without configuring the cell, CellServDB,
installing Kerberos v5 and configuring krb5.conf can result
in a very long wait at logon.  Now that NSIS is no longer
being supported and cannot be supported as a native 64-bit
installer mechanism we must disable integrated logon by
default to prevent more bad end user experiences like
@Lotterleben described on Twitter.

Change-Id: I10be4185177f94e53295a7641dd387feb295eaa5
Reviewed-on: http://gerrit.openafs.org/6132
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agorx: Use a red black tree for the event stack
Simon Wilkinson [Sun, 23 Oct 2011 20:21:39 +0000]
rx: Use a red black tree for the event stack

Instead of the current event stack, which uses a sorted linked
list, use a red/black tree to maintain the timer stack. This
dramatically improves event insertion times, at the expense of
some additional implementation complexity.

This change also adds reference counting to the rxevent
structure. We've always had a race between an event being
fired, and that event being simultaneously cancelled by
the user thread. Reference counting avoids that race resulting
in the structure appearing twice in the free list.

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

8 years agoUnix CM: Build rbtrees in kernel
Simon Wilkinson [Fri, 11 Nov 2011 09:33:31 +0000]
Unix CM: Build rbtrees in kernel

Build the new opr rbtree code in the Unix kernel module

Change-Id: I8271b209c8c17c4c651f2499cd8f60e44818a828
Reviewed-on: http://gerrit.openafs.org/5842
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoudebug: Fix endianness when fudging lastYesHost
Andrew Deason [Tue, 29 Nov 2011 18:07:49 +0000]
udebug: Fix endianness when fudging lastYesHost

hostAddr is in NBO, lastYesHost is in HBO.

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

8 years agoWindows: FSync not CleanVnode during Cleanup
Jeffrey Altman [Tue, 29 Nov 2011 00:15:33 +0000]
Windows: FSync not CleanVnode during Cleanup

cm_FSync() is buf_CleanVnode() plus a sync of metadata which
is required during last handle close.

FIXES 130351

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

8 years agoWindows: Wix cell names can be greater than 120 chars
Jeffrey Altman [Mon, 28 Nov 2011 23:45:55 +0000]
Windows: Wix cell names can be greater than 120 chars

Increase the permitted length in the UI to 255 characters.

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

8 years agoWindows: cache format version change
Jeffrey Altman [Mon, 28 Nov 2011 20:13:43 +0000]
Windows: cache format version change

With the change to the size of the osi_mutex_t and osi_rwlock_t
structures the CM_CONFIG_DATA_VERSION must change to force a
reconstruction of the cache file.

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

8 years agoWindows: osi_mutex / osi_rwlock changes
Jeffrey Altman [Sat, 26 Nov 2011 22:26:50 +0000]
Windows: osi_mutex / osi_rwlock changes

Reorganize the osi_mutex and osi_rwlock structure so
that all counters are 32-bit and pointers are
aligned.  This requires adding padding fields.

Move lock validation checks within the critical section.

Include additional assertions checking the ownership
state and protecting against under/overflows.

Increase the size of the rwlock tid array to support
a larger number of simultaneous readers.

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

8 years agoWindows: convert daemons threads to pthreads
Jeffrey Altman [Sat, 26 Nov 2011 15:55:27 +0000]
Windows: convert daemons threads to pthreads

The daemon threads make calls to Rx and therefore need to
be created with the pthread package to prevent the threads
from being tracked as 'native' threads by the pthread_thread_shutdown
thread which can only track up to 63 native threads.

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

8 years agoFBSD: cleanup dvp locking for ISDOTDOT
Ben Kaduk [Sun, 13 Nov 2011 18:12:50 +0000]
FBSD: cleanup dvp locking for ISDOTDOT

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

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

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

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

8 years agonamei: force-close fd on read or write error
Derrick Brashear [Sun, 27 Nov 2011 15:42:59 +0000]
namei: force-close fd on read or write error

if we errored, just reallyclose so we'll get a new fd

Change-Id: I55de45a96dc7fab481a49c10c68f2ebc0d4ea27c
Reviewed-on: http://gerrit.openafs.org/6126
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

8 years agoLinux: 3: Update specfile to know about 3.* kernels.
Edward Z. Yang [Sun, 27 Nov 2011 00:32:51 +0000]
Linux: 3: Update specfile to know about 3.* kernels.

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

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

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>

Change-Id: Ife6046db0bec981be59aa053f63ae71458da7167
Reviewed-on: http://gerrit.openafs.org/6120
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

8 years agoUnix CM: Fix PutVolume in afs_BlackListOnce
Simon Wilkinson [Wed, 23 Nov 2011 16:30:55 +0000]
Unix CM: Fix PutVolume in afs_BlackListOnce

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

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

8 years agoWindows: add trace logging to Pioctl File Info Query
Jeffrey Altman [Tue, 22 Nov 2011 14:31:45 +0000]
Windows: add trace logging to Pioctl File Info Query

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

8 years agoWindows: _._AFS_IOCTL_._ size is zero
Jeffrey Altman [Tue, 22 Nov 2011 21:36:18 +0000]
Windows: _._AFS_IOCTL_._ size is zero

When replying to a FileStandardInformation query on the pioctl
special file, the size of the file is 0.  Failure to return 0
can result in an anti-virus program attempting to read the file
via a paging request which will fail.

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

8 years agoWindows: RDR_InvalidateObject do not hold locks
Jeffrey Altman [Tue, 22 Nov 2011 02:47:38 +0000]
Windows: RDR_InvalidateObject do not hold locks

Do not hold any locks when calling the afs redirector.  Holding
a lock can cause a deadlock.

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

8 years agoWindows: cm_GetSCache do not release unheld lock
Jeffrey Altman [Mon, 21 Nov 2011 18:14:40 +0000]
Windows: cm_GetSCache do not release unheld lock

if cm_GetNewSCache() fails, an attempt would be made to
release cm_scacheLock which is not held.  However, it should
be noted that cm_GetNewSCache() cannot fail without itself
triggering a panic.

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

8 years agoWindows: Use Jenkins' Hash
Jeffrey Altman [Mon, 21 Nov 2011 13:42:13 +0000]
Windows: Use Jenkins' Hash

Replace the non-string hash functions with Jenkins' Hash
derived hash values.

Bump the cache version value because the hash function has
changed.

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

8 years agoopr: Add Bob Jenkins's hash functions
Simon Wilkinson [Sun, 20 Nov 2011 23:40:51 +0000]
opr: Add Bob Jenkins's hash functions

This imports a small subset of Bob Jenkins lookup3.c hash functions
into the opr library. At present we only import the subset of this
that deals with aligned arrays of integers, as this addresses our
immediate need.

It seems likely that if we're interested in a hash function for string
arrays (or other arbitrary data), that more recent functions such like
SpookyHash (from Bob Jenkins, again) or CityHash (from Google) may be
a better solution.

The immediate use case for this is removing the use of the '%' operator
when indexing speed critical hash tables, as well as ensuring fairer
distribution of entries across these tables.

A short set of test cases is also provided

Change-Id: I0ae26382e77da02204a30a95747f7d6de8c4f24a
Reviewed-on: http://gerrit.openafs.org/6095
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoLinux: 3.2: Use set_nlink to update i_nlink
Anders Kaseorg [Mon, 21 Nov 2011 00:00:00 +0000]
Linux: 3.2: Use set_nlink to update i_nlink

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

Change-Id: If0a38ffb7f9964e23f5e64c900ae92f56fb77def
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/6096
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

8 years agoafs: Leave cellnum alone for explicit mtpt cell
Andrew Deason [Tue, 15 Nov 2011 19:18:48 +0000]
afs: Leave cellnum alone for explicit mtpt cell

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

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

Change-Id: I7b98ccc94bf61dc3d7be0b7d6b54019cd797e884
Reviewed-on: http://gerrit.openafs.org/6051
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

8 years agonamei: tweak getlinkbyte error handling
Jeffrey Altman [Fri, 11 Nov 2011 16:00:47 +0000]
namei: tweak getlinkbyte error handling

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

Change-Id: Id7a371f3fd710f3c6dad21bccb0662cf8562d99f
Reviewed-on: http://gerrit.openafs.org/5843
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoauth: avoid excessive stat of cellservdb
Michael Meffie [Thu, 27 Oct 2011 21:53:47 +0000]
auth: avoid excessive stat of cellservdb

The modified time resolution is one second, so only
stat the cellservdb file at most only once per second.

Change-Id: I7d9a58f9af72b8c36b50374e49c07b4db85285e0
Reviewed-on: http://gerrit.openafs.org/5743
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agovol: rate-limit volume usage updates
Michael Meffie [Thu, 3 Nov 2011 21:09:28 +0000]
vol: rate-limit volume usage updates

Add threshold and time rate-limit parameters for volume usage
updates to disk.  This reduces the amount of i/o needed for
volume usage statistics on very busy fileservers.  Set the
default to limit updates to one every 5 seconds per volume.

Change-Id: I6b4274476ef6b8f9e4288b109d5a3edbdea6e91c
Reviewed-on: http://gerrit.openafs.org/5803
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

8 years agoWindows: RDR_RequestFileExtentsAsync unheld lock
Jeffrey Altman [Fri, 18 Nov 2011 14:54:43 +0000]
Windows: RDR_RequestFileExtentsAsync unheld lock

commit 55f5f356af2ef884413bd656f100055741ae871b forgot to remove
a lock_ReleaseWrite(&scp->rw) in RDR_RequestFileExtentsAsync().

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

8 years agoWindows: must obtain and release an actual lock
Jeffrey Altman [Fri, 18 Nov 2011 05:39:24 +0000]
Windows: must obtain and release an actual lock

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

8 years agoWindows: non-release only worker threads can release
Jeffrey Altman [Thu, 17 Nov 2011 05:30:24 +0000]
Windows: non-release only worker threads can release

There are two classes of worker threads created by the service
and donated to the afsredir as part of the reverse ioctl processing
model.  Normal workers can process any kind of ioctl and Release
Only workers that can only process release extent events.

Use a KeWaitForMultipleEvents in the normal worker case to permit
processing any type of event.  The previous implementation excluded
release extent ioctls from the normal workers.

Change-Id: I05e86f62c08e322cf7aa9bdd2fd325919bcbfe8f
Reviewed-on: http://gerrit.openafs.org/6071
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoauth: initKeys before first error exit path
Jeffrey Altman [Wed, 16 Nov 2011 05:29:34 +0000]
auth: initKeys before first error exit path

In afsconf_OpenInternal() _afsconf_InitKeys() must be called
before the first opportunity to call afsconf_CloseInternal()
or a crash can occur if the CellServDB file cannot be parsed.

Change-Id: I5b2487056a24d0c4ad78921d85df755758c7679e
Reviewed-on: http://gerrit.openafs.org/6059
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoWindows: Do not install IBM AFS HLP files
Jeffrey Altman [Wed, 16 Nov 2011 15:33:41 +0000]
Windows: Do not install IBM AFS HLP files

The IBM AFS HLP files are so out of date at this point
that they are simply confusing.  They reference tools and screens
that no longer exist and claim the product is "IBM AFS".  Incorrect
documentation is worse than no documentation.

The HLP files cannot be updated since we do not have the sources.

HLP file format is no longer supported on Windows Vista or 7.

The afs-nt.hlp file will continue to be installed conditionally
when afscreds.exe is installed but the shortcut to it in the
Start menu is being removed.  afscreds.exe is not installed by
default.

Change-Id: I3443a5c4ca65472a16cbf7ae1d52da39e917136a
Reviewed-on: http://gerrit.openafs.org/6065
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoWindows: buf_CleanAsyncLocked dirty range only
Jeffrey Altman [Tue, 15 Nov 2011 23:35:26 +0000]
Windows: buf_CleanAsyncLocked dirty range only

buf_CleanAsyncLocked() should not instruct cm_BufWrite() to
write a full chunk if the current buffer is the only one that
is dirty.  cm_BufWrite() will determine if it is appropriate
to fill a full chunk when storing.  Instructing it to check
a full chunk forces it to do more work than necessary.

Change-Id: Ie140d405147d700196532b72f04885a301a2550f
Reviewed-on: http://gerrit.openafs.org/6054
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoWindows: create scache->redirMx to reduce contention
Jeffrey Altman [Tue, 15 Nov 2011 23:23:46 +0000]
Windows: create scache->redirMx to reduce contention

Relying on the cm_scache_t.rw lock to protect the cm_scache_t.redirQueue*
results in a large amount of contention between processing extent
requests and releases from the afs redirector and the threads attempting
to read from or write data to the file server.   There is no reason why
the same lock must be used.  Allocate a dedicated mutex to protect the
queue.

By placing the new mutex after the buf_globalLock in the locking
hierarchy it permits the lock acquisition logic for extent processing
to be simplified further reducing cm_scache_t.rw lock transitions.

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

8 years agoWindows: Increase default number of daemon threads
Jeffrey Altman [Wed, 16 Nov 2011 00:03:14 +0000]
Windows: Increase default number of daemon threads

With the SMB interface there was little benefit to having
a large background daemon worker pool since it was so rarely
used.  Now that the redirector does everything in the background
daemon workers, increase the default from 4 to 16 threads.

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

8 years agoWindows: cm_SetupStoreBIOD use firstModOffset chunk
Jeffrey Altman [Wed, 16 Nov 2011 00:00:05 +0000]
Windows: cm_SetupStoreBIOD use firstModOffset chunk

When cm_SetupStoreBIOD attempts to store a chunk to the file
server it should not use *inOffsetp as the start of the range.
There is no guarantee that the buffer at *inOffsetp is dirty.
Instead use firstModOffset which refers to the first known
dirty buffer in the range specified by the caller.  Attempt
to fill a chunk of consecutive dirty buffers from that point.

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

8 years agoWindows: Fairness for background operations
Jeffrey Altman [Tue, 15 Nov 2011 23:40:21 +0000]
Windows: Fairness for background operations

The background daemon worker pool is responsible for processing
background Store and Fetch operations.  With the SMB interface
primary store and fetch operations are performed in the SMB worker
thread which makes sense since those operations must be synchronous
to the incoming request.

With the AFS redirector interface almost all of the work is performed
by the background daemon worker pool.  It is therefore critical that
the workers not get stuck in a state that starves applications.
For example, copy of a file that is larger than the cache to \\AFS
will result in a background store request for each chunk size of
the file.  If each worker thread grabs one to process, only one will
make progress and the rest will block.  If a cleanup operation
(aka handle close) occurs the entire file will be flushed to the
server synchronously in the redirector worker thread.  That thread
will cause of the background daemon threads to block.

Any subsequent fetch data requests that get queued behind the list
of stores will in turn block until they clear.  This behavior is not
fair.

This patchset adds a new test to the cm_BkgDaemon() request
selection loop, cm_RequestWillBlock().  If a request will block it
is skipped.  If there are no requests to process that would not have
blocked, the worker will sleep for 25ms instead of the usual 1s.

For BkgStore operations, the CM_SCACHEFLAG_DATASTORING flag is
used to indicating a blocking state.

For BkgFetch and PreFetch operations, the CM_BUF_WRITING and
CM_BUF_READING flags on the first cm_buf_t of the range is used
to indicate a blocking state.

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

8 years agovlserver: Avoid atoi for vol ids
Andrew Deason [Tue, 15 Nov 2011 17:53:12 +0000]
vlserver: Avoid atoi for vol ids

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

8 years agoWindows: Create default Security Descriptor
Jeffrey Altman [Tue, 15 Nov 2011 14:03:59 +0000]
Windows: Create default Security Descriptor

A misplaced #endif prevented the allocation of a default
security descriptor.  This results in STATUS_INSUFFICIENT_RESOURCES
errors.

FIXES 130284

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

8 years agoWindows: interlocked refCount increment in cm_GetSCache
Jeffrey Altman [Mon, 14 Nov 2011 22:49:45 +0000]
Windows: interlocked refCount increment in cm_GetSCache

Failure to use interlocked operations in cm_GetSCache can
result in an under count

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

8 years agoWindows: netidmgr krb5_cc_get_principal can fail
Jeffrey Altman [Sun, 13 Nov 2011 17:06:18 +0000]
Windows: netidmgr krb5_cc_get_principal can fail

Do not dereference a NULL pointer if krb5_cc_get_principal fails.

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

8 years agoWindows: smb_ReceiveNTCreateX create smb_fid earlier
Jeffrey Altman [Sat, 12 Nov 2011 23:33:18 +0000]
Windows: smb_ReceiveNTCreateX create smb_fid earlier

smb_ReceiveNTCreateX() calls cm_CheckNTOpen() which now
requires the smb_fid_t allocated fid value for use in share
mode locking.   Move the allocation of the smb_fid earlier
in the function and apply necessary cleanup in error paths.

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

8 years agoWindows: cm_GetSCache avoid holding cm_scacheLock
Jeffrey Altman [Sat, 12 Nov 2011 22:32:06 +0000]
Windows: cm_GetSCache avoid holding cm_scacheLock

cm_GetSCache used to hold cm_scacheLock write-locked from
start to finish except that it didn't.  There were several
places where cm_scacheLock was dropped and reacquired due
to lock ordering requirements.  Unfortunately, this has
two problems. First, the function isn't very fast in the
most common case since cm_scacheLock is write-locked for
the search for an existing FID.  Second, there is a race
that results when cm_GetNewSCache() drops the cm_scacheLock.

To make things faster, use a read-lock for the common case.

To avoid the race, if the FID cannot be located, call
cm_GetNewSCache() first and then obtain the cell and volume
information.  Then perform a second lookup for the FID while
holding cm_scacheLock write-locked.  If we lost the race or
there was an error obtaining the cell and volume info, put
the new cm_scache_t back onto the end of the LRU queue.

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

8 years agoWindows: avoid null ptr in RDR_RequestFileExtentsAsync
Jeffrey Altman [Sat, 12 Nov 2011 22:24:12 +0000]
Windows: avoid null ptr in RDR_RequestFileExtentsAsync

If the cm_scache_t cannot be obtained, do not dereference it
while returning an error to the redirector.

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

8 years agoWindows: Track active RPCs per scache_t
Jeffrey Altman [Sat, 12 Nov 2011 18:45:08 +0000]
Windows: Track active RPCs per scache_t

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

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

8 years agoWindows: fix locking hierarchy in service
Jeffrey Altman [Sat, 12 Nov 2011 18:41:30 +0000]
Windows: fix locking hierarchy in service

The smb username lock and the daemon global lock can be requested
while the scache dirlock is held if there are no free buffers
and the service is forced to claw back extents from the redirector.
Adjust the locking hierarchy accordingly.

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

8 years agoafs: Do not use separate array for srvAddrs
Andrew Deason [Wed, 2 Nov 2011 21:55:49 +0000]
afs: Do not use separate array for srvAddrs

The array of srvAddr structs we use in afs_LoopServers have indices
unrelated to the indices of conns, rxconns, etc. Several places were
assuming that addr[i] corresponded to conn[i], which is not
necessarily true. So instead, do not use the separate addr array
(except when populating the conn and rxconn arrays), and just get the
srvAddr structure by going through the relevant conn[i].

Change-Id: Ib60126811f51943bfc81ab7c48d7f247f00f1cad
Reviewed-on: http://gerrit.openafs.org/5790
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

8 years agorx: Turn the rxevent_Cancel macro into a function
Simon Wilkinson [Sat, 22 Oct 2011 15:37:04 +0000]
rx: Turn the rxevent_Cancel macro into a function

Turn rxevent_Cancel into a function rather than a macro which modifies
its argument as a side effect. rxevent_Cancel now checks whether the
event being cancelled is already NULL, as well as NULLifying the event
when it is actually cancelled.

Update all of the callers to reflect this new API, and so they no
longer do unecessary work.

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

8 years agorx: New signature for rx event functions
Simon Wilkinson [Sat, 22 Oct 2011 15:22:36 +0000]
rx: New signature for rx event functions

For a while now, we've had both new and old-style rx event callback
functions. Modify all of our event handlers, and the functions that
install them, to use only new style functions, and get rid of the
old-style function prototypes.

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

8 years agoopr: Add a red/black tree implementation
Simon Wilkinson [Sat, 22 Oct 2011 10:22:51 +0000]
opr: Add a red/black tree implementation

Add an implementation of red/black trees to our runtime library.

This is originally derived from the FreeBSD macro-based rbtree
implementation, but is heavily reworked to not use macros, to improve
legibility, and to favour speed over structure compactness.

A test suite is provided in tests/opr/

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

8 years agorx: Add a helper function for delayed acks
Simon Wilkinson [Sat, 22 Oct 2011 10:10:53 +0000]
rx: Add a helper function for delayed acks

The code to schedule a new delayed ack event is distributed throughout
the RX code. Consolidate this into a single helper function.

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

8 years agoopr: Add opr_containerof
Simon Wilkinson [Sat, 22 Oct 2011 08:45:10 +0000]
opr: Add opr_containerof

Add the opr_containerof macro, which can be used to find the base
address of a structure which contains a member whose location is known.

This formulation is heavily used throughout OpenAFS to determine the
base address of structures containing queue pointers - this provides
a central definition, rather than coding it from scratch each time.

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

8 years agoWindows: Add Vista/Win7 Firewall Configuration
Jeffrey Altman [Sat, 5 Nov 2011 08:10:42 +0000]
Windows: Add Vista/Win7 Firewall Configuration

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

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

8 years agoWindows: Enforce Share Access
Jeffrey Altman [Wed, 5 Oct 2011 07:36:48 +0000]
Windows: Enforce Share Access

Use file server locks to enforce file share access modes
via the afs redirector interface.  The approach taken
integrates share mode enforcement with the file server
lock tracking code in the service.  The share mode
enforcement mimics that of the SMB Server interface.

This patchset includes two functional changes to
the previous locking and share mode processing:

 1. The cm_scache_t fsLockCount field is used to
    determine if the desired lock can be granted
    by the file server.  If not, the RXAFS_SetLock()
    request is skipped and the request is failed
    locally.

 2. cm_CheckNTOpen() now accepts the desired and
    and share access modes.  The share access mode
    is used to determine if a test lock should be
    obtained at all.  If the share mode is FILE_SHARE_WRITE
    then no lock is requested.  This change permits
    Microsoft Office applications to offer the user
    the ability to open the file in read-only mode
    and notify the user when the document can be
    opened in read-write mode.

Developed with Peter Scott <pscott@kerneldrivers.com>

FIXES 130239

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

8 years agoSOLARIS: Do not build x86 kernel module on 5.11
Andrew Deason [Thu, 10 Nov 2011 21:18:41 +0000]
SOLARIS: Do not build x86 kernel module on 5.11

Oracle Solaris 11 no longer supports x86 (amd64 is required). If we
try to build the x86 module, /usr/include/sys/kobj.h complains that
the ISA is unsupported, and refuses to go on. So, just remove
MODLOAD32 from the libafs directories to build on sunx86_511.

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

8 years agonamei: Remove extraneous rmdir
Andrew Deason [Thu, 10 Nov 2011 17:58:12 +0000]
namei: Remove extraneous rmdir

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

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

8 years agovol: Remove O_EXCL|O_TRUNC combinations
Andrew Deason [Thu, 10 Nov 2011 17:05:28 +0000]
vol: Remove O_EXCL|O_TRUNC combinations

A few places were specifying both O_EXCL and O_TRUNC to open().
O_TRUNC does not make any sense with O_EXCL, and doesn't do anything,
so remove O_TRUNC from these instances to make the code more clear.

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

8 years agoWindows: FSCTL_SET_REPARSE_POINT not yet implemented
Jeffrey Altman [Thu, 10 Nov 2011 03:52:37 +0000]
Windows: FSCTL_SET_REPARSE_POINT not yet implemented

Since FSCTL_SET_REPARSE_POINT is not yet implemented
return STATUS_INVALID_PARAMETER to all requests that
do not fail validity tests.

Change-Id: I53d4b4fc9d957daa70b16d37a529778ed8bbfa5e
Reviewed-on: http://gerrit.openafs.org/5829
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoWindows: FSCTL_SET_REPARSE_POINT error
Jeffrey Altman [Thu, 10 Nov 2011 03:47:55 +0000]
Windows: FSCTL_SET_REPARSE_POINT error

According to MS_FSCC 2.3.54 if the input buffer length is less than the size
of a REPARSE_DATA_BUFFER structure, or the input buffer length is greater
than 16,384, or a REPARSE_DATA_BUFFER structure has been specified for a
third party reparse tag, or the GUID specified for a third party reparse tag
does not match the GUID known by the operating system for this reparse
point, or the reparse tag is 0 or 1, then the return status shall be
STATUS_IO_REPARSE_DATA_INVALID.

Change-Id: I0072902afc8bc354af8f9b84b1021b37191dc23a
Reviewed-on: http://gerrit.openafs.org/5828
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoWindows: FSCTL_IS_PATHNAME_VALID return success
Jeffrey Altman [Thu, 10 Nov 2011 03:45:07 +0000]
Windows: FSCTL_IS_PATHNAME_VALID return success

Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista,
Windows Server 2008, Windows 7, and Windows Server 2008 R2 support the
FSCTL_IS_PATHNAME_VALID Request (section 2.3.21) and return STATUS_SUCCESS
whenever this request is invoked.  We will do the same.

Change-Id: I432c8a41e1102648faaa3d8c0f3b8c36ea89bfc8
Reviewed-on: http://gerrit.openafs.org/5827
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoWindows: these fsctl cmds are not implemented
Jeffrey Altman [Thu, 10 Nov 2011 03:42:54 +0000]
Windows: these fsctl cmds are not implemented

Return STATUS_NOT_IMPLEMENTED since the following
FSCTL_ operations are not:

FSCTL_LOCK_VOLUME
FSCTL_UNLOCK_VOLUME
FSCTL_DISMOUNT_VOLUME
FSCTL_MARK_VOLUME_DIRTY
FSCTL_IS_VOLUME_DIRTY
FSCTL_IS_VOLUME_MOUNTED

Change-Id: Idfe26a4b71538defd1919be575d62b32dd415a06
Reviewed-on: http://gerrit.openafs.org/5826
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoWindows: Additional trace logging
Jeffrey Altman [Thu, 10 Nov 2011 03:33:11 +0000]
Windows: Additional trace logging

Add additional trace logging to the redirector to assist
with debugging reparse point processing.

Change-Id: I89d7a26d7d10ba5fff001d91f5e67baa224f4179
Reviewed-on: http://gerrit.openafs.org/5825
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoWindows: service must set reparse point attribute
Jeffrey Altman [Thu, 10 Nov 2011 01:05:05 +0000]
Windows: service must set reparse point attribute

When populating the directory entry information for the
redirector the service must set the reparse point attribute.

Change-Id: I26db0b822f850f0a19606eeed3c29e0e72562e2f
Reviewed-on: http://gerrit.openafs.org/5824
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoWindows: Correctly increment PIOCtl DE
Peter Scott [Thu, 10 Nov 2011 20:34:53 +0000]
Windows: Correctly increment PIOCtl DE

When performing a directory enumeraiton, correctly increment ref count on
the PIOCtl DE structures

Change-Id: I44de6ab2d804378723e31887089aca4890d15fa6
Reviewed-on: http://gerrit.openafs.org/5834
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

8 years agoWindows: FileNetworkPhysicalNameInfo implementation
Peter Scott [Thu, 10 Nov 2011 16:06:53 +0000]
Windows: FileNetworkPhysicalNameInfo implementation

Handle this File information query

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

8 years agoWindows: improve store data parallelism
Jeffrey Altman [Mon, 31 Oct 2011 03:52:00 +0000]
Windows: improve store data parallelism

The file server will set the rx call status bit (0x1)
when the rpc is in process and all of the locks are held.
At this point it is not possible for another store data rpc
to begin on the vnode prior to the completion of the current
rpc.  Once this status bit is detected as set, the exclusive
store data synchronization on the cm_scache_t can be dropped.

This permits the next store data rpc to perform its biod
construction.

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

8 years agovolser: Preserve needsSalvaged during restore
Andrew Deason [Wed, 9 Nov 2011 23:04:09 +0000]
volser: Preserve needsSalvaged during restore

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

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

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

8 years agoviced: avoid bogus handle in rename
Derrick Brashear [Wed, 9 Nov 2011 15:34:10 +0000]
viced: avoid bogus handle in rename

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

FIXES 130215

Change-Id: I8578d30da42bdd9be2c552cdac4d2c526c22ee45
Reviewed-on: http://gerrit.openafs.org/5818
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

8 years agoregen: Fail on failures
Andrew Deason [Tue, 8 Nov 2011 18:52:50 +0000]
regen: Fail on failures

If something fails, don't ignore the error.

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

8 years agoAdd "pretty" build option
Andrew Deason [Wed, 13 Apr 2011 18:15:57 +0000]
Add "pretty" build option

Add the capability to do a "pretty" build, where we output something
like "  CC  /path/to/foo.o" to build foo.o, instead of the entire
compiler invocation, similarly to how the Linux kernel build appears.
Add the "pretty" building for CC and LD rules.

This also prints out some helpful information when a command fails,
which can sometimes otherwise be annoying to figure out post-mortem.

To enable the pretty building, make with V=0. To output everything
that is actually run with V=0, make with 'V=0 Q=' .

Note that this does not work with all makes, since not all makes will
propagate command-line-specified variables to sub-makes without -e.
Non-working makes include /usr/ccs/bin/make on HP-UX and Solaris.
However, GNU make will work, as will /usr/xpg4/bin/make on Solaris.

Change-Id: Idce0afffe7d5be88b0743ec3f926a52efb1a6a74
Reviewed-on: http://gerrit.openafs.org/4486
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

8 years agoSpecify pattern rules in addition to suffix rules
Andrew Deason [Tue, 8 Nov 2011 18:29:39 +0000]
Specify pattern rules in addition to suffix rules

A few makefiles specify an old-style suffix rule, such as:

  .c.o:
          $(AFS_CCRULE) $<

Not all makes seem to interpret these rules correctly (such as Solaris
/usr/xpg4/bin/make). Since it is easy to do so, specify pattern-based
rules along with these, like so:

  %.o: %.c
          $(AFS_CCRULE) $<

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

8 years agoAdd setenv/unsetenv to roken
Andrew Deason [Thu, 3 Nov 2011 18:40:37 +0000]
Add setenv/unsetenv to roken

Add the replacement setenv and unsetenv functions to roken, for use on
(at least) HP-UX and older Solaris.

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

8 years agodafs: avoid null deref getting volume header
Derrick Brashear [Sun, 6 Nov 2011 21:28:27 +0000]
dafs: avoid null deref getting volume header

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

Change-Id: I023fd959c5d49575dbdf89fd4dab77341c5c52d0
Reviewed-on: http://gerrit.openafs.org/5814
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

8 years agosalvager: Implement AskDAFS via SYNC flags
Andrew Deason [Thu, 3 Nov 2011 18:17:33 +0000]
salvager: Implement AskDAFS via SYNC flags

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

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