openafs.git
12 years agoWindows: OpenAFS reparse points are surrogates
Jeffrey Altman [Mon, 6 Feb 2012 17:00:58 +0000]
Windows: OpenAFS reparse points are surrogates

OpenAFS reparse points represent mount points, symlinks, and dfs
referrals.  All of which are file system objects that represent
another named entity in the system.  As a result the reparse tag
field must include the Reparse Tag Surrogate bit (0x20000000) set.

This permits the IsReparseTagNameSurrogate() macro provided in
winnt.h to be used to determine if the reparse point is a surrogate
or not.

See
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365197%28v=vs.85%29.aspx

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

12 years agoRW Replication: Add basic definitions
Marc Dionne [Wed, 18 Jan 2012 19:04:28 +0000]
RW Replication: Add basic definitions

Add some basic definitions that will be needed to handle RW
replicas.

A new volume type RWREPL is added.  Replicas will share the same
volume ID as the RW volume, so the array of volume IDs by volume
type is unchanged, as is the VLDB entry format.

A new flag bit ITSRWREPL/VLSF_RWREPLICA for serverFlags identifies
RW replica sites in VLDB entries.

Change-Id: I882b238f34e682ebea782e11dc418ae1340d4546
Reviewed-on: http://gerrit.openafs.org/6676
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agovol: remove OPENAFS_VOL_STATS
Marc Dionne [Tue, 4 Oct 2011 21:47:48 +0000]
vol: remove OPENAFS_VOL_STATS

OPENAFS_VOL_STATS has been unconditionally defined since the IBM days.
Adjust the code to assume it is set.

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

12 years agoDisable kernel opt by default on Solaris 10 and 11
Andrew Deason [Mon, 6 Feb 2012 19:23:41 +0000]
Disable kernel opt by default on Solaris 10 and 11

With newer Solaris Studio (sometime in the 12.* series), cc started
adding SSE instructions to optimized x86 code, which is invalid for
kernel code and can generate panics. There appears to be no way to
turn this off currently (-xvector=%none is non-functional), so default
to not optimizing kernel code.

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

12 years agoRx: Add missing rx_packet.h includes
Andrew Deason [Fri, 3 Feb 2012 22:06:16 +0000]
Rx: Add missing rx_packet.h includes

We no longer include rx_packet.h from rx.h, so rx_kcommon.h was not
picking up some packet-related definitions. Some files
(SOLARIS/rx_knet.c, IRIX/rx_knet.c) were using packet-related defines
(e.g. RX_HEADER_SIZE) while just including rx_kcommon.h. Include
rx_packet.h in those files to get the relevant definitions.

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

12 years agoSOLARIS: Use kcred instead of afs_osi_cred
Andrew Deason [Thu, 2 Feb 2012 23:35:52 +0000]
SOLARIS: Use kcred instead of afs_osi_cred

For many vfs ops to the cache, we currently pass &afs_osi_cred for our
credentials, which is a mostly zeroed-out credential structure. In
some modern versions of Solaris (Solaris 11), at least some parts of
this structure need to not be NULL (cr_zone), or we will panic.

The Solaris kernel provides a 'kcred' credentials structure for the
purpose of using "kernel" credentials for i/o. So just use that
instead, since kcred has existed at least since Solaris 8.

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

12 years agoWindows: Avoid race during PIOCtl DirNode allocation
Jeffrey Altman [Sat, 4 Feb 2012 22:26:02 +0000]
Windows: Avoid race during PIOCtl DirNode allocation

Use InterlockedCompareExchangePointer to assign the DirNode to
ObjectInfo->Specific.Directory.PIOCtlDirectoryCB.  Otherwise,
one thread could race with another thread when allocating the
pioctl object.

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

12 years agoWindows: Hold Fcb references prior to service call
Jeffrey Altman [Sat, 4 Feb 2012 17:48:24 +0000]
Windows: Hold Fcb references prior to service call

If the Fcb reference count hits 0 while the service is called
it is possible that the Fcb can be garbage collected prior to
the completion of the call.

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

12 years agoWindows: Do not build NSIS by default
Jeffrey Altman [Sun, 5 Feb 2012 17:58:22 +0000]
Windows: Do not build NSIS by default

NSIS installers are no longer up to date and do not support 64-bit
builds.  OpenAFS no longer distributes them for 1.7 and beyond.
Stop building them by default.

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

12 years agoWindows: add buf_InvalidateBuffers
Jeffrey Altman [Fri, 3 Feb 2012 16:35:33 +0000]
Windows: add buf_InvalidateBuffers

Add a utility function that invalidates all buffers for a
cm_scache_t object.

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

12 years agoWindows: fix cm_DirOpDelBuffer assert
Jeffrey Altman [Fri, 3 Feb 2012 16:21:45 +0000]
Windows: fix cm_DirOpDelBuffer assert

In cm_DirOpDelBuffer() the data version field for a buffer
in cm_dirOp_t.buffers[] can be CM_BUF_VERSION_BAD if the buffer
was added to the buffer list but was never fetched from the file
server.  If the buffer was recycled by buf_Get() an attempt to
remove an entry from the directory will be failed as opposed to
fetching the buffer from the file server and performing the local
removal.

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

12 years agoWindows: buffer DV ranges do not work for directories
Jeffrey Altman [Fri, 3 Feb 2012 16:17:40 +0000]
Windows: buffer DV ranges do not work for directories

In cm_MergeStatus, always set cm_scache_t.bufDataVersionLow
to the new data version because the cm_dir package does not
support version ranges.   All modified dir buffers have their
dataVersion field set to the current data version value.

Failure to update the bufDataVersionLow field can result in
B+ Trees being constructed from out of date directory information.

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

12 years agoWindows: update btree debugging code
Jeffrey Altman [Fri, 3 Feb 2012 16:16:04 +0000]
Windows: update btree debugging code

B+Tree key strings were changed to wchars for unicode support,
the debugging printf format patterns were not updated to match.
Do so now.

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

12 years agoWindows: Do not open file if shutdown in progress
Jeffrey Altman [Fri, 3 Feb 2012 16:14:50 +0000]
Windows: Do not open file if shutdown in progress

Perform the shutdown check earlier in AFSCommonCreate() to prevent
a request from being processed after the service indicates that
a shutdown has begun.

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

12 years agoWindows: AFSRedir DebugFlags Turn on BugCheck
Jeffrey Altman [Wed, 1 Feb 2012 03:34:30 +0000]
Windows: AFSRedir DebugFlags Turn on BugCheck

Turn on bug checking by default via the installation.
This permits sites to disable the functionality but will allow
us to capture more meaningful minidump output.

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

12 years agoWindows: Improve AFSNotifyDelete
Jeffrey Altman [Tue, 31 Jan 2012 20:51:34 +0000]
Windows: Improve AFSNotifyDelete

Do not call AFSNotifyDelete after the reference count on the
DirEntry->ObjectInformation is given up.

Log the Parent FID and file name since that is what are passed
to the service to perform a  delete.  Log the actual FID of the
object being deleted and not the address of the FID fields.

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

12 years agoWindows: do not lower case direct volume references
Jeffrey Altman [Tue, 31 Jan 2012 20:49:22 +0000]
Windows: do not lower case direct volume references

Not all volumes are lower case.  Do not lowercase the string.

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

12 years agocom_err: correctly deal with lack of libintl
Tom Keiser [Wed, 1 Feb 2012 08:31:23 +0000]
com_err: correctly deal with lack of libintl

On machines lacking a libintl, _intlize() currently fails to initialize
the output error string--leading to tools (e.g., translate_et) returning
a null string; make afs_com_err fall back to returning the en/US canonical
error text when we don't have any i18n support...

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

12 years agolinux: fix probing for noop_fsync
Christof Hanke [Sun, 29 Jan 2012 17:08:57 +0000]
linux: fix probing for noop_fsync

Commit 267934d0e6910c8d8166a6e78f93c1bab40857b8 introduced
probing code to deal with the renameing of simple_fsync
inside the linux-kernel.
This test does not take different parameter-lists
for noop_fsync or simple_fsync resp. into account.
Fix this.

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

12 years agoman-pages: add fs_getverify and fs_setverify
Jeffrey Altman [Sun, 29 Jan 2012 21:46:22 +0000]
man-pages: add fs_getverify and fs_setverify

Add man pages for two new Windows only commands

  fs getverify
  fs setverify -verify {on, off}

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

12 years agoWindows: do not panic if afsredir not ready during shutdown
Jeffrey Altman [Sun, 29 Jan 2012 19:41:06 +0000]
Windows: do not panic if afsredir not ready during shutdown

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

12 years agoWindows: Increase size of worker thread pools
Jeffrey Altman [Sun, 29 Jan 2012 15:39:28 +0000]
Windows: Increase size of worker thread pools

The size of the afs redirector worker thread pools should be
made configurable but for now just increase the pool size to
be in parity with the default worker pool created by the
afsd service.

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

12 years agoWindows: Run Workers until empty task queue
Jeffrey Altman [Sun, 29 Jan 2012 15:37:50 +0000]
Windows: Run Workers until empty task queue

Do not allow a worker thread to sleep until the task queue is
empty.  It is better for the running thread to pick up and process
a task then to sleep this thread and wait for another one to wake
up to perform the work.

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

12 years agoWindows: Release Notes for 1.7.5
Jeffrey Altman [Sun, 29 Jan 2012 05:22:03 +0000]
Windows: Release Notes for 1.7.5

Release notes updates for 1.7.5.

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

12 years agoWindows: Stop the thundering herd
Jeffrey Altman [Fri, 20 Jan 2012 19:43:06 +0000]
Windows: Stop the thundering herd

The afs redirector used notification events to wake up worker
threads when a task was added to a work queue.  Notification
events when signalled wake up all threads instead of just one.

Instead, use synchronization events to wake up a single thread at
a time and restructure the code to permit workers to wake up
additional workers if there is additional work to be performed
or during library shutdown.

Thanks to Peter Scott for his assistance.

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

12 years agoWindows: DriveSubstitution handle too small buffer
Jeffrey Altman [Wed, 25 Jan 2012 16:27:39 +0000]
Windows: DriveSubstitution handle too small buffer

If the buffer passed to DriveSubstitution is too small the
resulting file path will end up being truncated.  At the very
least log the fact that truncation is occurring.  In addition
return the fact that truncation occurred to the caller.

In NPGetUniversalName allocate a 4K buffer on the heap instead
of calculating a buffer based on the local name buffer size.
The local name buffer size has no relationship with the required
buffer size for the expanded unc or device path.

FIXES 130548

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

12 years agoWindows: Invalidate all volumes at library init
Jeffrey Altman [Tue, 24 Jan 2012 22:09:01 +0000]
Windows: Invalidate all volumes at library init

The afsredirlib.sys library driver is unloaded when the afsd_service
stops and is reloaded when the afsd_service restarts.  During the
shutdown window any objects known to the kernel are preserved by
afsredir.sys.  When the afsd_service restarts, there are no valid
callbacks on any objects so the afsredirlib.sys must invalidate all
status info to permit the service to request a callback from the
file server on next use.

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

12 years agoWindows: Refactor and consolidate afsredir invalidation
Jeffrey Altman [Tue, 24 Jan 2012 17:52:12 +0000]
Windows: Refactor and consolidate afsredir invalidation

Invalidation requests were being processed in an inconsistent
manner because different rules were being applied to volume root
directories and other objects and whether or not the invalidation
was a whole volume invalidation or not.

This patchset consolidates all invalidation logic for an object
in the new AFSInvalidateObject function.  AFSInvalidateObject
is then called from AFSInvalidateCache and AFSInvalidateVolume
as necessary.

AFSInvalidateVolume executes AFSInvalidateObject on all objects
in the volume object tree.  As a result, whole volume invalidations
whether triggered by the file server or "fs flushvolume" now work.

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

12 years agovlserver: Consolidate VLDB entry server flag definitions
Marc Dionne [Mon, 23 Jan 2012 02:21:51 +0000]
vlserver: Consolidate VLDB entry server flag definitions

Group the definitions of server flags for VLDB entries in one place,
and rename VLSERVER_FLAG_UUID to make its name consistent with the
other flags.
This makes it easier to see the complete set of flags and avoid
conflicts.

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

12 years agoviced: Remove the LWP fileserver
Simon Wilkinson [Mon, 7 Nov 2011 09:48:14 +0000]
viced: Remove the LWP fileserver

*) Remove all LWP specific code from the fileserver, and make pthread
   the default
*) Build the pthreaded fileserver in the 'viced' directory, rather than
   in tviced
*) Move the DAFS specific files from tviced to viced (arguably, these
   should move into dviced, but there are currently no source files in
   that directory)
*) Remove tviced from the build

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

12 years agovol: remove SYNC fatal_error processing
Andrew Deason [Fri, 13 Jan 2012 18:43:16 +0000]
vol: remove SYNC fatal_error processing

Currently SYNC clients will "disable" themselves on certain error
patterns. For example, if the server end closes its file descriptor
too many times, or takes too long and then closes the fd, the SYNC
client will return an error and set fatal_error. On any subsequent
SYNC requests, the request will immediately fail without contacting
the server, often making SYNC client programs effectively useless
until they are restarted.

There isn't really any reason to cause future requests to fail.
Transient problems in the fileserver can easily make this situation
possible (e.g. a fileserver can crash but still take several minutes
to close the SYNC fd while the core is written to disk), and so while
we may return an error for a specific problematic request, future
requests may be fine.

So, just remove everything related to fatal_error, so future SYNC
requests can continue to be attempted. Adjust some log messages to
reflect the new behavior.

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

12 years agolibafs: add replicated connection pool
Derrick Brashear [Thu, 12 Jan 2012 21:48:54 +0000]
libafs: add replicated connection pool

keep pool of connections to use for replicated volumes,
so we can have a separate idle time setting

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

12 years agoWindows: make lock reader history debug only
Jeffrey Altman [Sun, 15 Jan 2012 16:43:40 +0000]
Windows: make lock reader history debug only

The lock reader history on osi_rwlock is proving to be too
expensive.  Only use it for DEBUG builds.  Leave the data
structures the same so that DEBUG builds can be mixed with
a RELEASE build of afsd_service.exe.

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

12 years agoWindows: store data verification mode
Jeffrey Altman [Sun, 22 Jan 2012 23:42:32 +0000]
Windows: store data verification mode

Over the lifetime of OpenAFS a number of bugs have been discovered
that can result in data corruption.  This new mode (Windows only)
will double check that the data received by the file server does
in fact match the data that was written by the cache manager.

After a successful StoreData and status merge but before the BIOD
is released, a fetchdata is issued to read the data written by the
cache manager.  If the data fails to match, the StoreData operation
is repeated.

Data verification mode can be queried with "fs getverify" and set
with "fs setverify {on, off}".  The default value can be set with
the TransarcAFSDaemon\Parameters DWORD "VerifyData" registry value.

By default verification is disabled.

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

12 years agoWindows: VIOC_GETUNIXMODE = smb_IoctlGetUnixMode
Jeffrey Altman [Sun, 22 Jan 2012 23:38:49 +0000]
Windows: VIOC_GETUNIXMODE = smb_IoctlGetUnixMode

VIOC_GETUNIXMODE pioctl should execute smb_IoctlGetUnixMode not
smb_IoctlSetUnixMode.

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

12 years agoWindows: fix fs setcrypt help message
Jeffrey Altman [Sun, 22 Jan 2012 23:37:14 +0000]
Windows: fix fs setcrypt help message

Options are on, auth, and off.

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

12 years agoWindows; release BIOD after status merge
Jeffrey Altman [Sun, 22 Jan 2012 23:33:43 +0000]
Windows; release BIOD after status merge

Releasing the BIOD permits the accumulated buffers to be accessed.
Releasing the BIOD before the cm_MergeStatus() call creates a
window where the buffer data version is larger than the cm_scache
data version.  Release the BIOD after the status merge.

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

12 years agoviced: disable rx keepalives during disk io
Derrick Brashear [Thu, 5 Jan 2012 22:19:45 +0000]
viced: disable rx keepalives during disk io

when we are going to hit the backend storage, disable keepalives.
the net effect of this is that no idle dead time is needed; instead,
the normal dead time will result in a connection with no activity
simply dying naturally if i/o blocks forever.

it's important that keepalives be enabled during callback breaks,
so that is done.

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

12 years agoRevert "Windows: disable memory extent interface"
Jeffrey Altman [Sat, 21 Jan 2012 04:10:51 +0000]
Revert "Windows: disable memory extent interface"

This reverts commit 503bc56403baf741a4a7056a4077edc43812b9d1

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

12 years agoviced: remove FS_STATS_DETAILED
Marc Dionne [Tue, 4 Oct 2011 21:35:18 +0000]
viced: remove FS_STATS_DETAILED

FS_STATS_DETAILED has been unconditionally defined since the IBM days.
Adjust the code to assume it is set.

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

12 years agoWindows: failover and retry for VBUSY
Jeffrey Altman [Wed, 18 Jan 2012 00:46:30 +0000]
Windows: failover and retry for VBUSY

When a file server returns the VBUSY error for an RPC the
cache manager records the 'srv_busy' state in the cm_serverRef_t
structure binding that file server to the active cm_volume_t
object.  The 'srv_busy' was never cleared which prevents the
volume from being accessed.

Clear the 'srv_busy' flag whenever cm_Analyze() receives a
CM_ERROR_ALLBUSY error which means that all replicas have
been tried or whenever the error is not VBUSY or VRESTARTING.

FIXES 130537

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

12 years agoWindows: improved idle dead time handling
Jeffrey Altman [Fri, 25 Nov 2011 14:28:18 +0000]
Windows: improved idle dead time handling

RX_CALL_IDLE has been treated the same as RX_CALL_DEAD which is
a fatal error that results in the server being marked down.  This
is not the appropriate behavior for an idle dead timeout error
which should not result in servers being marked down.

Idle dead timeouts are locally generated and are an indication
that the server:

 a. is severely overloaded and cannot process all
    incoming requests in a timely fashion.

 b. has a partition whose underlying disk (or iSCSI, etc) is
    failing and all I/O requests on that device are blocking.

 c. has a large number of threads blocking on a single vnode
    and cannot process requests for other vnodes as a result.

 d. is malicious.

RX_CALL_IDLE is distinct from RX_DEAD_CALL in that idle dead timeout
handling should permit failover to replicas when they exist in a
timely fashion but in the non-replica case should not be triggered
until the hard dead timeout.  If the request cannot be retried, it
should fail with an I/O error.  The client should not retry a request
to the same server as a result of an idle dead timeout.

In addition, RX_CALL_IDLE indicates that the client has abandoned
the call but the server has not.  Therefore, the client cannot determine
whether or not the RPC will eventually succeed and it must discard
any status information it has about the object of the RPC if the
RPC could have altered the object state upon success.

This patchset splits the RX_CALL_DEAD processing in cm_Analyze() to
clarify that only RX_CALL_DEAD errors result in the server being marked
down.  Since Rx idle dead timeout processing is per connection and
idle dead timeouts must differ depending upon whether or not replica
sites exist, cm_ConnBy*() are extended to select a connection based
upon whether or not replica sites exist.  A separate connection object
is used for RPCs to replicated objects as compared to RPCs to non-replicated
objects (volumes or vldb).

For non-replica connections the idle dead timeout is set to the hard
dead timeout.  For replica connections the idle dead timeout is set
to the configured idle dead timeout.

Idle dead timeout events and whether or not a retry was triggered
are logged to the Windows Event Log.

cm_Analyze() is given a new 'storeOp' parameter which is non-zero
when the execute RPC could modify the data on the file server.

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

12 years agorx: RX_CALL_IDLE and RX_CALL_BUSY
Jeffrey Altman [Mon, 28 Nov 2011 17:58:02 +0000]
rx: RX_CALL_IDLE and RX_CALL_BUSY

Allocate new Rx error codes for Idle and Busy calls but do not
send these errors on the wire.  They are only intended for local
use.

RX_CALL_IDLE is an indication to an application that requests it
that the rx peer is maintaining an open call channel but has not
sent any actual data for the length of the registered idle dead
timeout.

RX_CALL_BUSY is an indication to an application that requests it
that the rx peer believes the selected call channel is in use by
a pre-existing call.

When either RX_CALL_IDLE or RX_CALL_BUSY are assigned as the call
error and an abort must be sent to the rx peer, the errors are
translated to RX_CALL_TIMEOUT.  This is necessary because it is
not possible to add new Rx error values in a method that is safe
for peers that are not expecting them.

This patchset also documents which Rx errors defined in rx.h are
used on the wire and which are not.

The Unix and Windows cache managers are updated to build with
these new error codes.

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

12 years agoWindows Asynchronous purging of file content after a DV change
Peter Scott [Thu, 19 Jan 2012 01:42:19 +0000]
Windows Asynchronous purging of file content after a DV change

Purge all regions of the file surrounding the extents which are to be
purged. If a failure occurs on the purge due to an existing mapping, flag
for purge during handle close

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

12 years agoWindows: cm_buf refcnt must hold buf_globalLock
Jeffrey Altman [Thu, 19 Jan 2012 20:25:44 +0000]
Windows: cm_buf refcnt must hold buf_globalLock

An assertion in buf_Recycle() was being triggered when a cm_buf_t
object was supposed to be in the free buffer list but wasn't.
buf_Recycle() was racing with another thread.  The test for
refCount == 0 was performed while holding the buf_globalLock
exclusively but the InterlockedDecrement(refCount) in buf_Release()
was performed without holding buf_globalLock at all.  buf_globalLOck
must be held at least as a read lock.  Otherwise, the refCount can
reach 0 prior to the thread blocking for exclusive access to the
buf_globalLock.  This provides buf_Recycle() which is holding
buf_globalLock the opportunity to race.

The solution is to make sure that buf_Release() always holds
buf_globalLock as a read lock and then use buf_ReleaseLocked()
to perform the actual decrement and test.

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

12 years agoWindows: Redesign daemon thread queue management
Jeffrey Altman [Thu, 19 Jan 2012 06:21:02 +0000]
Windows: Redesign daemon thread queue management

The daemon thread worker pool has some very poor properties.
The threads spend a significant amount of time polling for
ready to process tasks because so frequently a store/fetch data
request is accompanied by many other requests for the same FID
that would block.

Lets try a new approach. Create one queue for each worker thread
and assign the tasks to a thread by a hash of the FID.  This ensures
that all tasks for a single FID are serialized and prevents multiple
threads from attempting to perform the same task only to decide that
the thread would be forced to block.

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

12 years agoWindows: prevent race assigning Fcb in AFSInitFcb()
Jeffrey Altman [Wed, 18 Jan 2012 00:43:54 +0000]
Windows: prevent race assigning Fcb in AFSInitFcb()

AFSInitFcb() is executed when the ObjectInformation->Fcb pointer
is NULL.  More than one thread can make that determination at the
same time.  Use InterlockedCompareExchangePointer() to detect
a race and permit cleanup to be performed.

Remove the output parameter of AFSInitFcb() to avoid a double
assignment.

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

12 years agoWindows: cm_EndCallbackGrantingCall refactoring
Jeffrey Altman [Sat, 14 Jan 2012 15:32:51 +0000]
Windows: cm_EndCallbackGrantingCall refactoring

Refactor cm_EndCallbackGrantingCall to prevent assigning a
callback to the cm_scache object in the case where it is going
to be discarded.  If the race was lost the callback data was
already discarded by cm_RevokeCallback.  By assigning and then
discarding we are forced to issue an additional change notification
to the smb client or afs redirector.  Not only is this extra work
but the afs redirector notification can result in a deadlock with
a kernel thread that is waiting for the current thread to complete.

modify the function signature to return whether or not a race
was lost with a callback revocation.

rename 'freeFlag' to 'freeRacingRevokes' since that is what
the flag is meant to indicate.

create a new 'freeServer' flag to indicate when the server
reference should be released.  There was a leak of server
references when a race occurred.

modify all calls to cm_EndCallbackGrantingCall() that provide
an AFSCallBack structure on input to check for a lost race.
If a race occurs, cm_MergeStatus() should not be performed.

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

12 years agoWindows: deadlock bet. DirEntry lock + DirectoryNodeHdr.TreeLock
Jeffrey Altman [Sun, 15 Jan 2012 16:08:23 +0000]
Windows: deadlock bet. DirEntry lock + DirectoryNodeHdr.TreeLock

The DirectoryNodeHdr.TreeLock must be obtained before the
DirEntry->NonPaged->Lock.  In AFSLocateNameEntry(), the
DirEntry lock is obtained before the TreeLock when processing
a symlink object.  For that case obtain the TreeLOCK first.
Drop it if it is not required.

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

12 years agoWindows: Correctly mark extents dirty when using the non-persistent AFS
Peter Scott [Wed, 18 Jan 2012 19:04:29 +0000]
Windows: Correctly mark extents dirty when using the non-persistent AFS
cache

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

12 years agoWindows: Performing async work after cache invalidation
Peter Scott [Wed, 11 Jan 2012 13:49:23 +0000]
Windows: Performing async work after cache invalidation

The code now queues a work item to perform additional work on extent
processing after a cache invalidation has occurred. This additional work
involves walking the current list of extents and purging/flushing regions of
the system cache based upon the current state of the extent.
Additional changes to filter which invlidation events result in a queued
worker to perform asynchronous work.

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

12 years agoParallel build fixes
Marc Dionne [Wed, 18 Jan 2012 15:06:36 +0000]
Parallel build fixes

Assorted fixes for issues seen with parallel builds:
- bucoord must depend on butm, since it uses libbutm
- for most object files in roken and hcrypto, headers must be installed
  before building
- remove rules with 2 targets in rxkad and ubik
- budb: add dependencies for db_dump.o

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

12 years agoLinux 3.3: use umode_t for mkdir and create inode ops
Marc Dionne [Wed, 18 Jan 2012 16:22:35 +0000]
Linux 3.3: use umode_t for mkdir and create inode ops

The mkdir and create inode operations have switched to using
umode_t instead of int for the file mode.

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

12 years agoLinux: use standard macro for set_nlink configure test
Marc Dionne [Wed, 18 Jan 2012 15:25:03 +0000]
Linux: use standard macro for set_nlink configure test

A generic macro exists to test for functions in the kernel, use
it for set_nlink.

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

12 years agovolinfo: fix formating of placeholder printfs
Derrick Brashear [Tue, 17 Jan 2012 21:08:56 +0000]
volinfo: fix formating of placeholder printfs

needed to placate gcc-llvm on lion

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

12 years agorx: Correctly test for end of call queue
Marc Dionne [Wed, 18 Jan 2012 01:19:54 +0000]
rx: Correctly test for end of call queue

The intention of this condition is to check if the current call
being considered is the last one on the queue, but the test is
incorrect.  A null next pointer indicates a removed item, not
the end of the queue.

Use the queue_IsLast macro instead to correctly determine that
this is the last item in the queue and that a call has to be
selected, either the current one or a previously seen good choice.

This can cause calls to get permanently stuck in the call queue
and never get assigned to a thread, even when all threads are
idle.

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

12 years agoWindows: disable memory extent interface
Jeffrey Altman [Sat, 14 Jan 2012 15:44:56 +0000]
Windows: disable memory extent interface

There have been reports that the memory extent interface which
is used when NonPersistentCache is active can lead to data corruption.

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

12 years agoWindows: restrict service to 2 cpus by default
Jeffrey Altman [Sat, 14 Jan 2012 15:31:01 +0000]
Windows: restrict service to 2 cpus by default

Performance drops off considerably when the number of processors
increases due to lock contention and the cm_SyncOp wait processing.
If the MaxCPUs registry value is not set, limit ourselves to two.
Setting MaxCPUs to zero permits use of all CPUs.

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

12 years agoWindows: AFS_SERVER_FLUSH_DELAY AFS_SERVER_PURGE_DELAY
Jeffrey Altman [Sat, 14 Jan 2012 04:58:50 +0000]
Windows: AFS_SERVER_FLUSH_DELAY AFS_SERVER_PURGE_DELAY

Alter the flush delay to 5 seconds from 30 seconds

Alter the purge delay to 300 seconds from 5 seconds

Change-Id: I3f8e79d84582c4015e35d58cf1bedc9a023c0d73
Reviewed-on: http://gerrit.openafs.org/6554
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: AFSParseName edge cases
Jeffrey Altman [Sat, 14 Jan 2012 04:57:10 +0000]
Windows: AFSParseName edge cases

If the input path is \afs\ behave as if the path is \afs.

If the input path is \afs\*\ detect the wildcard and return
STATUS_OBJECT_NAME_INVALID.

Change-Id: I0ef4f30fb3b6245a52160b5e7f9233bc5f599485
Reviewed-on: http://gerrit.openafs.org/6553
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: afs root is always a directory
Jeffrey Altman [Sat, 14 Jan 2012 00:32:16 +0000]
Windows: afs root is always a directory

If the root is opened with the FILE_NON_DIRECTORY_FILE option,
fail the request with STATUS_FILE_IS_A_DIRECTORY.

Change-Id: Ic7d29f9032c2a19617276138833938fcf304838e
Reviewed-on: http://gerrit.openafs.org/6552
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agofix spelling in comments
Ken Dreyer [Mon, 16 Jan 2012 23:04:14 +0000]
fix spelling in comments

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

12 years agoDAFS: Fix SYNC_FAILED VScheduleSalvage_r log
Andrew Deason [Wed, 11 Jan 2012 15:28:56 +0000]
DAFS: Fix SYNC_FAILED VScheduleSalvage_r log

SYNC_FAILED is not an unknown protocol code, so stop saying it is.

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

12 years agovol: Fix VCreateVolume special inode cleanup
Andrew Deason [Wed, 11 Jan 2012 15:00:35 +0000]
vol: Fix VCreateVolume special inode cleanup

In order to dec the relevant special inodes, we need to know the
parent vol id in addition to the vol id itself. Use the appropriate
volume IDs when IH_DEC'ing special inodes after we fail to create the
volume, so we don't leave behind special inodes.

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

12 years agoWindows: dir buffers out of date - mark them as such
Jeffrey Altman [Wed, 4 Jan 2012 02:10:32 +0000]
Windows: dir buffers out of date - mark them as such

if cm_CheckForSingleDirChange() fails, mark the cm_scache_t
bufDataVersionLow as the current data version so that old directory
buffers are discarded.

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

12 years agoWindows: Avoid file server rpcs on deleted files
Jeffrey Altman [Thu, 5 Jan 2012 16:52:00 +0000]
Windows: Avoid file server rpcs on deleted files

If a file has been deleted, do not attempt to issue RPCs
to the file server in response to AFS redirector extent processing.
All RPCs will fail with VNOVNODE which will in turn trigger invalidation
requests to the AFS redirector which can deadlock.

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

12 years agoWindows: use local var for interlocked result
Jeffrey Altman [Wed, 4 Jan 2012 17:13:40 +0000]
Windows: use local var for interlocked result

Save the result of the interlocked operations for use in
debug logging.  Do not reference the incremented or decremented
object in the log messages, it may have changed.

Local assignment is provided even in functions that are currently
not logging to assist with debugging and as a reminder to use
the result variable in future log messages.

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

12 years agoWindows: AFSParseMountPointTarget buffer overrun
Jeffrey Altman [Wed, 4 Jan 2012 06:10:37 +0000]
Windows: AFSParseMountPointTarget buffer overrun

When parsing the AFS mount point string do not overrun
the buffer if the colon cell/volume separator is not
found.

Change-Id: Id7275cc8815223730f7c39bd11a6f495beb117c4
Reviewed-on: http://gerrit.openafs.org/6507
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Directory Enumeration, DVs, and TreeLocks
Jeffrey Altman [Wed, 4 Jan 2012 05:02:42 +0000]
Windows: Directory Enumeration, DVs, and TreeLocks

Hold the TreeLock exclusively across all operations that
enumerate, validate, or otherwise manipulate directory tree
lists or data versions.

Take the data version into account when deciding what to do
with directory data.  If a directory enumeration takes more
than one request to service and the DV has changed from the
time the directory snapshop was taken by the service and the
enumeration completion, merge in the changes and then mark
the directory as requiring verification.

If a directory change operation completes (create, rename, remove)
and the directory DV has changed by more than one force a full
directory verification.

Set the directory data version to -1 whenever a directory
verification is required.  Otherwise, the check to clear the
VERIFY flag will only update the metadata for the directory.

During a directory verification, if a new entry has been discovered
it is added to the directory.  Make sure the VALID flag is set so
that the entry will not immediately be removed as invalid.

Change-Id: I6be8d00126fccf88bde8ae5f97e850dfb9a2f60f
Reviewed-on: http://gerrit.openafs.org/6460
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: correct log messages in AFSCleanup
Jeffrey Altman [Wed, 4 Jan 2012 05:01:09 +0000]
Windows: correct log messages in AFSCleanup

Change-Id: I1e202547d82195f85e6de20e72f6b07c6c7475ba
Reviewed-on: http://gerrit.openafs.org/6506
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Return Dir Data Version from AFSCleanup
Jeffrey Altman [Wed, 4 Jan 2012 04:58:04 +0000]
Windows: Return Dir Data Version from AFSCleanup

This patchset returns the directory data version from AFSCleanup().
It does not do anything with it.

Change-Id: I86ac37f9e237bfec3ea612b896bec4ed7d43d068
Reviewed-on: http://gerrit.openafs.org/6505
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: reorg open handle counts and Fcb->NPFcb->Resource
Jeffrey Altman [Wed, 4 Jan 2012 04:43:30 +0000]
Windows: reorg open handle counts and Fcb->NPFcb->Resource

Reorganize when open handle counts are decremented in order
to avoid a race with worker threads performing garbage collection.

Change-Id: I07c1c5e80fad48cd3439dbc9c85bd6dff9b9bf44
Reviewed-on: http://gerrit.openafs.org/6504
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Permit renames of open files
Jeffrey Altman [Wed, 4 Jan 2012 04:39:53 +0000]
Windows: Permit renames of open files

AFS does not impose a restriction on renames of open files.
Failure to permit the rename can cause problems if an anti-malware
service opens the file immediately after the application performing
the rename does so.

Change-Id: Ib23a6a893c5c575e89b8a817faec4c11300a04b7
Reviewed-on: http://gerrit.openafs.org/6503
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Do not prime the service directory cache
Jeffrey Altman [Wed, 4 Jan 2012 04:36:50 +0000]
Windows: Do not prime the service directory cache

Performing a directory enumeration is an expensive operation
that we should be attempting to avoid.   The current directory
enumeration and evaluate target requests will use inline bulk
status RPCs to the file server which obtain status for 49 items
at a time from a single directory.

Change-Id: I78e08680fec9715c3c446d0c4c5226cd79db80bd
Reviewed-on: http://gerrit.openafs.org/6502
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: More specific error values
Jeffrey Altman [Wed, 4 Jan 2012 04:35:51 +0000]
Windows: More specific error values

When a mount point, symlink, or dfslink cannot be resolved
return STATUS_REPARSE_POINT_NOT_RESOLVED.

When an operation fails because the volume is readonly, return
STATUS_MEDIA_WRITE_PROTECTED.

Change-Id: Ib35f0d7851c087bf8aa25d4b0138ee72fb6f3c68
Reviewed-on: http://gerrit.openafs.org/6501
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: do not flush dirty extents without permission
Jeffrey Altman [Wed, 4 Jan 2012 04:12:34 +0000]
Windows: do not flush dirty extents without permission

When closing file handles, do not permit dirty extents to be
released back to the service if the current handle (Ccb) does
not have write permission.  The cleanup operation will fail with
STATUS_ACCESS_DENIED, the extents will be released and all of the
dirty data will be discarded.

Change-Id: Iceacf5319147d1bd6277ea160bc67d91f1a49d5b
Reviewed-on: http://gerrit.openafs.org/6500
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoopr: fix generated target
Derrick Brashear [Mon, 9 Jan 2012 02:02:04 +0000]
opr: fix generated target

we need opr for comerr, but we don't want it after. build,
then clean up.

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

12 years agolibuafs: only rebuild h directory when needed
Marc Dionne [Fri, 6 Jan 2012 22:22:35 +0000]
libuafs: only rebuild h directory when needed

A few changes to allow a "make all ; sudo make install ; make all..."
workflow to work without manually removing files in between.

Make the rebuilding of the h directory dependent on the source
files scanned to build it.  This prevents it from being rebuilt
for every "make install".

While we're here, use -f when removing linktest for the clean target.
This allows "make clean" to remove it without prompting when the user
doesn't have write access to the file, as is the case when make install
rebuilds it as root.

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

12 years agoopr: add buildtools target
Marc Dionne [Sat, 7 Jan 2012 20:40:42 +0000]
opr: add buildtools target

opr needs a buildtools target for "make generated". Make it install
the headers, which are needed by the other generated targets.

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

12 years agoMake libjafs buildable again
Andrew Deason [Sun, 8 Jan 2012 16:31:39 +0000]
Make libjafs buildable again

libjafs is surprisingly close to being buildable. Fix a few misc
things which have bitrotted over the years so it is possible to
actually build:

 - Add -I$SRC/config to the cflags, so we can include afsconfig.h

 - Remove references to the nonexistant rxkstats.o

 - Do not link with UAFS' AFS_component_version_number.o, since this
   gives us duplicate version number symbols

 - Include afs_vosAdmin.h in Group.c, to satisfy some missing symbols

Change-Id: Ie8da88872288073d080a58ed7fe8c8b52052488e
Reviewed-on: http://gerrit.openafs.org/6524
Reviewed-by: Steven Jenkins <steven@synaptian.com>
Tested-by: Steven Jenkins <steven@synaptian.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoafs: discard cached state when we are unsure of validity
Derrick Brashear [Wed, 4 Jan 2012 20:04:41 +0000]
afs: discard cached state when we are unsure of validity

in the event we got a network error, we don't know if the server
completed (or will complete) our operation. we can assume nothing.
a more complicated version of this could attempt to verify that the
state is what we expect it to be, but in extended callbacks universe
this is potentially easier to solve anyway. for now, return the
error to the caller, and mark the vcache unstat'd.

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

12 years agoafs: put back conn if not using in checkserver loop
Derrick Brashear [Fri, 6 Jan 2012 11:33:22 +0000]
afs: put back conn if not using in checkserver loop

we get a conn, check it for eligibility, and if not,
just abandon it. "oops"

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

12 years agorx: add and export a public keepalive toggle
Derrick Brashear [Fri, 6 Jan 2012 11:53:46 +0000]
rx: add and export a public keepalive toggle

make enabling and disabling keepalives a public function.
export the function

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

12 years agoMake src/opr objdir safe
Chaskiel Grundman [Thu, 29 Dec 2011 18:06:31 +0000]
Make src/opr objdir safe

Update the Makefile for src/opr to use $? to reference headers, so objdir
builds work correctly

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

12 years agoafs: increase idledead time
Derrick Brashear [Tue, 3 Jan 2012 20:57:14 +0000]
afs: increase idledead time

it's actually important this be more than the rx call dead time
so timing out server callbacks to clients don't result in us idle deading
a call to the server when callbacks need to be broken

FIXES 130327

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

12 years agoukernel: enable nat ping again
Derrick Brashear [Wed, 4 Jan 2012 18:21:43 +0000]
ukernel: enable nat ping again

if we're not root, no nat ping at all. fix that.

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

12 years agoafs: Negate codes using a clear, standard method
Simon Wilkinson [Wed, 4 Jan 2012 21:44:30 +0000]
afs: Negate codes using a clear, standard method

The bulk of our code uses 'code = -code' to negate an error code.
Use this, rather than 'code *= -1', as the latter form makes my
head hurt.

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

12 years agoUse offsetof() in set_header_word to get field offset
Marc Dionne [Thu, 5 Jan 2012 00:27:18 +0000]
Use offsetof() in set_header_word to get field offset

Use offsetof() to replace a few instances where the same logic is
open coded in set_header_word and inc_header_word macros.  In cases
where the field name involves a variable as an index to an array,
newer gcc gives a sequence point warning.

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

12 years agovol: initialize readmeinode
Marc Dionne [Wed, 4 Jan 2012 23:49:32 +0000]
vol: initialize readmeinode

Newer gcc complains about readmeinode being potentially used
uninitialized.  Doesn't look possible in the code, but initialize
it to quiet the warning.

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

12 years agoUnix CM: reset blacklist on hard-mount retry
Michael Meffie [Wed, 14 Dec 2011 17:52:51 +0000]
Unix CM: reset blacklist on hard-mount retry

Reset black-listed servers on a request when retrying due to a
hard-mount retry. When hard-mounts are in effect, a request may
retry indefinitely. If all the servers have been black-listed
due to a transient error, the request may never complete.

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

12 years agoDAFS: Atomically re-hash vnode in VGetFreeVnode_r
Andrew Deason [Fri, 18 Nov 2011 16:25:08 +0000]
DAFS: Atomically re-hash vnode in VGetFreeVnode_r

VGetFreeVnode_r pulls a vnode off of the vnode LRU, and removes the
vnode from the vnode hash table. In DAFS, we may drop the volume glock
immediately afterwards in order to close the ihandle for the old vnode
structure.

While we have the glock dropped, another thread may try to
VLookupVnode for the new vnode we are creating, find that it is not
hashed, and call VGetFreeVnode_r itself. This can result in two
threads having two separate copies of the same vnode, which bypasses
any mutual exclusion ensured by per-vnode locks, since they will lock
their own version of the vnode. This can result in a variety of
different problems where two threads try to write to the same vnode at
the same time. One example is calling CopyOnWrite on the same file in
parallel, which can cause link undercounts, writes to the wrong vnode
tag, and other CoW-related errors.

To prevent all this, make VGetFreeVnode_r atomically remove the old
vnode structure from the relevant hashes, and add it to the new hashes
before dropping the glock. This ensures that any other thread trying
to load the same vnode will see the new vnode in the hash table,
though it will not yet be valid until the vnode is loaded.

Note that this only solves this race for DAFS. For non-DAFS, the vol
glock is held over the ihandle close, so this race does not exist.
The comments around the callers of VGetFreeVnode_r indicate that
similar extant races exist here for non-DAFS, but they are unsolvable
without significant DAFS-like changes to the vnode package.

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

12 years agoafs: Grab a reference to setp in afs_icl_Event4
Andrew Deason [Tue, 27 Dec 2011 02:22:08 +0000]
afs: Grab a reference to setp in afs_icl_Event4

We can drop GLOCK in several places in afs_icl_Event4 and the
afs_icl_AppendRecord callee. To ensure that the given afs_icl_set does
not get freed while we have GLOCK dropped, grab a reference to the
set.

Thanks to Ryan C. Underwood for reporting an issue triggered by this.

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

12 years agolinux: fsync on a directory should return 0, not EINVAL
Geoffrey Thomas [Sun, 1 Jan 2012 00:51:29 +0000]
linux: fsync on a directory should return 0, not EINVAL

Directory writes are synchronous, so this is fine. There's a
mostly-convenient function in fs/libfs.c that returns 0 that we can use
to do what we want ("mostly" because it was renamed in 2.6.35).

FIXES 130425

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

12 years agorpm: Don't attempt to restart on upgrade when using systemd
Geoffrey Thomas [Sun, 11 Dec 2011 10:06:24 +0000]
rpm: Don't attempt to restart on upgrade when using systemd

systemd is actually rather capable of leaving the OpenAFS client in an
incredibly broken state, thanks to its willingness to track services and
kill their processes. We should not attempt to restart the client on
upgrade, whether a normal upgrade or a migration from SysV initscripts.
In the former case, it's fine (and correct) for the old AFS to keep
running; in the latter case, the unit file is capable of correctly
shutting down an initscript-launched client. The same is true for the
OpenAFS server.

This brings the packaging in line with the SysV initscript code in the
specfile, which does not attempt to restart the service, as well as with
e.g. Debian's packaging, which uses --no-restart-on-upgrade.

While we're here, clean up a redundant BuildRequires on systemd-units.

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

12 years agoWindows: Support correct status codes from service
Peter Scott [Fri, 30 Dec 2011 00:23:32 +0000]
Windows: Support correct status codes from service

When performing object verification, check for status failures corresponding
to parent object issues which require a validation of the parent

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

12 years agoWindows: Handle invalid node types
Peter Scott [Fri, 30 Dec 2011 00:30:45 +0000]
Windows: Handle invalid node types

In the case where the direntry data is invalid, construct an Fcb
of type INVALID so that the direntry can be displayed and the objected
deleted even if it cannot be evaluated.

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

12 years agoWindows: AFSFileUpdateResultCB ParentDataVersion
Jeffrey Altman [Sat, 31 Dec 2011 02:45:54 +0000]
Windows: AFSFileUpdateResultCB ParentDataVersion

Add the parent directory data version to the AFSFileUpdateResultCB
structure.

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

12 years agoWindows: renames that overwrite existing target
Jeffrey Altman [Sat, 31 Dec 2011 01:09:06 +0000]
Windows: renames that overwrite existing target

The Windows client up to this point has never correctly implemented
directory renames.  For the longest time it assumed that the file
server would not replace a pre-existing target.  As a result, when
the target name was already in use the contents of the directory
would end up with the target name existing but its previous file id
associated with it.

A second problem was that lookups for the source and target names
were not performed while the directory (or directories) were exclusively
held to ensure that competing changes could not occur.

This patchset corrects both issues in cm_Rename() and adjusts the
redirector interface to match the new behavior.

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

12 years agoWindows: AFSDirEnumResp and AFSDirEnumEntry changes
Jeffrey Altman [Fri, 30 Dec 2011 06:34:51 +0000]
Windows: AFSDirEnumResp and AFSDirEnumEntry changes

A directory enumeration is not an atomic operation.  The redirector
reads an enumeration a chunk at a time.  During the entire enumeration
it is possible that the data version of the directory object has
changed due to entries being added or removed.  This patchset adds
two data version values to the AFSDirEnumResp structure.

The first is the snapshot data version which is the dv of the
directory object at the time the entry list snapshot was taken.
The second is the current data version number of the directory
object.

If an object has been removed from the directory after the snapshot
was taken, attempts to fetch status information for the object will
fail with a VNOVNODE (aka CM_ERROR_BADFD aka STATUS_INVALID_HANDLE).
The NTStatus field has been added to the AFSDirEnumEntry structure
to permit notifying the redirector of such failures.

RDR_PopulateCurrentEntry() has been extended with an additional
cm_Error parameter that accepts the errorCode field provided by
the cm_direnum_entry_t object constructed during the enumeration.

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

12 years agoWindows: Add AFSFileEvalResultCB
Jeffrey Altman [Fri, 30 Dec 2011 06:24:27 +0000]
Windows: Add AFSFileEvalResultCB

In response to AFS_REQUEST_TYPE_EVAL_TARGET_BY_ID and
AFS_REQUEST_TYPE_EVAL_TARGET_BY_NAME, return the new AFSFileEvalResultCB
instead of a raw AFSDirEnumEntry.   AFSFileEvalResultCB includes
the data version number of the parent directory at the time the
node was evaluated.

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