aklog uses encode_EncTicketPart and some other encode_* ASN.1 routines
when we're building against heimdal. Our krb5 autoconf logic from
c-rra-util is not guaranteed to include libasn1 in KRB5_LIBS, since
it's not required for functions in the krb5 API. So, specifically test
for it.
Related issue reported by Måns Nilsson.
Change-Id: I5d1ab07ec481e48710bafcdc53fe58f529cc6dde
Reviewed-on: http://gerrit.openafs.org/9693
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
The symbols StartDISK_GetFile and EndDISK_GetFile can be useful to
ubik users. Put them in the export list.
Change-Id: I6aa9c7261e68d66de19981154a7c42efc69e91f2
Reviewed-on: http://gerrit.openafs.org/9725
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
In almost all cases where an AFSCcb is present the associated AFSFcb
is also present. The AFSFcb has a direct pointer to the AFSObjectInfoCB.
This patchset replaces the Ccb->DirectoryCB->ObjectInformation references
with Fcb->ObjectInformation. This avoids one level of pointer indirection
and will make it easier to remove the DirectoryCB ObjectInformation
pointer in the future.
Change-Id: I2a6f5d2ed8ef1ad85691f07f425f99e3fb6cce31
Reviewed-on: http://gerrit.openafs.org/9724
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Hold the VolumeCB->ObjectInfoTree.TreeLock exclusively when calling
AFSAllocateObjectInfo() in order to protect the lists of child objects.
Change-Id: I16f104b8112e972fa8c60da2b0dbcb07ad42456c
Reviewed-on: http://gerrit.openafs.org/9723
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Switch to using interlocked operations for the SetFlag and ClearFlag
macros.
Change-Id: I2b071ae49f69d557c30d1280fb7877dde7f76f40
Reviewed-on: http://gerrit.openafs.org/9722
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
AFSDeleteDirEntry() frees the memory allocated to the DirectoryCB.
To ensure that an invalid memory pointer is not accidentally used
by the caller after the memory is freed, use
InterlockedCompareExchangePointer() to set the input parameter to
NULL prior to destroying the DirectoryCB.
Change-Id: I2e92d4277d1f9baee164bfb941821aa11a1ad738
Reviewed-on: http://gerrit.openafs.org/9721
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Periodically there is a lost race which results in a valid DirectoryCB
with a non-NULL ObjectInformation pointer that refers to freed memory.
This major reorganization simplifies the logic and attempts to close
potential loopholes.
First, the AFSExamineDirectory() function is removed and replaced by
a call to AFSDeleteDirEntry(). The AFSExamineDirectory() function
examined all of the children AFSObjectInfoCB objects which in turn
duplicated much of the logic of AFSExamineObjInfo at the cost of
increased complexity due to the additional layer of locked objects.
Once the AFSDirectoryCB is removed a subsequent pass of the worker
thread will free the AFSObjectInfoCBs.
Second, the AFS_OBJECT_REFERENCE_DIRENTRY category had been used for
both DirectoryCB references and the Pioctl references. A new
AFS_OBJECT_REFERENCE_PIOCTL category has been created to improve the
ability to track the allocations and releases.
Third, the AFSPrimaryVolumeWorker thread now attempts to hold onto the
VolumeCB TreeLock exclusively. Previously the lock was held shared.
However, it is not safe for both the garbage collection and the find
routines to both be shared. One has to be exclusive. Although holding
the TreeLock exclusively in the garbage collection processing will result
in the lock being held for extended periods of time, it is more likely
that there will be benefits from parallel access during AFSFindObjectInfo()
calls.
Attempts to obtain most other locks are non-blocking. If the lock cannot
be obtained, the object must be in use. Therefore, it should not be
garbage collected.
Change-Id: I75e0302c1737aadfbd9afc0c8a03e28513e785f5
Reviewed-on: http://gerrit.openafs.org/9720
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
AFSFindObjectInfo performed the search of Volume object tree protected by
the TreeLock but dropped the lock before incrementing the reference count.
This behavior contributed to a race with the AFSPrimaryVolumeWorkerThread
which has to drop the VolumeCB TreeLock periodically in order to safely
cleanup FCBs.
Change-Id: I0cba4a118e4835edee7702db97846567618e0adf
Reviewed-on: http://gerrit.openafs.org/9719
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Now that AFSDeleteDirEntry can be called with a DirectoryCB
whose ObjectInformation pointer can be NULL, protect against unintentional
dereference.
Change-Id: I6ffd21c35da5581a7ebac6987324e2ff3a8ccd2b
Reviewed-on: http://gerrit.openafs.org/9691
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Move the check for AFS_OBJECT_HELD_IN_SERVICE until after the TreeLock
is held.
Change-Id: I38d095c83dc5878770a7a31bee08048a777cb3cb
Reviewed-on: http://gerrit.openafs.org/9674
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Only permit AFSDeleteObjectInfo() to be called if the reference
count returned by AFSObjectInfoDecrement() is zero.
Change-Id: I6fd65ac41467ec2aa82d4f86f0d57f91595930c1
Reviewed-on: http://gerrit.openafs.org/9671
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Now that the reference counting is likely to be correct, do not
garbage collect objects with negative reference counts. If the
reference counts are wrong the objects will never be destroyed but
that is now a safer choice than freeing memory that might be in use.
Change-Id: Ic8e781c4a775f8bcc66227b6f08f894c2fb85157
Reviewed-on: http://gerrit.openafs.org/9670
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Many places in vos/vsprocs have code to delete a volume. Commit
f4e73067cd tried to refactor them by
consolidating the common "delete" code into DoVolDelete. However, not
all of the removed code had exactly the same behavior, and some of
these variants were not handled by DoVolDelete.
One such variation is that DoVolDelete always printed an error message
if the target volume did not exist. But for some call sites this
condition is not an error, and prior to the refactoring they did not
print such an error message. Commit
1092cbe34f tried to correct this by
suppressing the error message if the target volume does not exist.
However, this means that all DoVolDelete calls do not print such an
error, where some should and some should not print an error. This
means that in some edge cases when we encounter an unexpected VNOVOL
error, we now skip printing the specific error we got and instead go
right to cleanup/recovery/exit. For a few other cases, we used to
print an error and continue (because it is a non-fatal error or a
warning), but now we print nothing when we encounter a VNOVOL error.
Fix this by specifically printing an error for the VNOVOL error for
DoVolDelete call sites that used to print such an error. Do this for
all such sites except ones where we obviously print an error
immediately afterwards anyway.
This is just a quick targeted fix. A future more robust fix should
involve altering DoVolDelete to handle all of the different behaviors
expected by its various callers.
Change-Id: Ia79bce3d2fed4acd62d517064db5b6be77f6e987
Reviewed-on: http://gerrit.openafs.org/9704
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Instead of testing for Characteristics = FILE_READ_ONLY_DEVICE
which applies to the entire device, only return media protected
errors if the volume FileSystemAttributes include FILE_READ_ONLY_VOLUME.
Change-Id: Ice716083c7f0ecb9e80d0ca9e3e143249293d28e
Reviewed-on: http://gerrit.openafs.org/9699
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Set both FILE_DEVICE_SECURE_OPEN and FILE_DEVICE_REMOTE when
creating Device Objects for the AFS Redirector.
Change-Id: I336287817d913c612e2fe7cfbb4198900a846b0f
Reviewed-on: http://gerrit.openafs.org/9698
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
In an effort to declutter AFSFcbSupport.cpp, move AFSVolume
functions to a new source file, AFSVolume.cpp.
Change-Id: I663352d7bc4004c41bbab55fdf5bd8e36b373cf9
Reviewed-on: http://gerrit.openafs.org/9697
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
In an effort to reduce some of the clutter in AFSGeneric.cpp,
move the Name Array functions to AFSNameArray.cpp.
Change-Id: I97c9c5c67229851cbe937a603a93a2db97d6c12c
Reviewed-on: http://gerrit.openafs.org/9696
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Currently, VolXListOneVolume errors out with ENODEV if any attachment
error occurs with the specified volume. But VolListOneVolume always
returns success if it can find the indicated volume, and any
attachment errors and such are reported in the 'status' field of the
volume info structure.
These two functions do pretty much the same thing; VolXListOneVolume
just provides more info than VolListOneVolume. So make them behave the
same way, and provide more specific information, whether or not
somebody ran 'vos examine' or 'vos examine -extended'.
The 'vos' binary has always handled errors in the 'status' volume info
structure for both "extended" and non-"extended" queries. This
difference appears to just have been a mistake from OpenAFS 1.0.
Change-Id: Iab16ef6a25487d492fdb046db93973a1e64ca70a
Reviewed-on: http://gerrit.openafs.org/9680
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
In the 1.4 series, the volserver VolListOneVolume function always
returned success if the specified volume was found in any way, and
ENODEV otherwise. The VolXListOneVolume returned ENODEV if the volume
was not found, or if any error occurred.
DAFS (specifically, commit ed25934c1f)
changed these so they both behave the same way. That is, they both
return success if the volume was found at all, and ENODEV otherwise.
Commit 53cc2ebaea changed both of these
functions so that we always return an error on any attachment error.
These changes mean that a 'vos examine' for a volume with an existing
volume transaction now indicates that a volume is offline/unattached,
but in the 1.4 series, the volume was indicated as "busy".
So, restore the original 1.4 behavior of these functions, so the
volume status is reported as it always was. This effectively reverts
53cc2ebaea, and slightly changes the
post-DAFS code to look more like the 1.4 code. This also removes the
'code' variable from VolListOneVolume and adds an explicit comment
about what's going on, to make this a little more clear.
While changing the behavior of VolXListOneVolume to match that of
VolListOneVolume perhaps makes sense, for now just restore the exact
1.4 behavior, and make the function flow look a little more like the
1.4 code did. A future change may make them the same again.
Reported by Andy Malato.
Change-Id: I0e109ad97a1b1bd9b3b25677eb9744a4f7bd5412
Reviewed-on: http://gerrit.openafs.org/9679
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Correct the third parameter passed to InterlockedCompareExchangePointer
in AFSDeleteObjectInfo() which prevented *ppObjectInfo from being set
to NULL.
Change-Id: I4edc1d69114c02ffff8181b176a5f0bac82f6802
Reviewed-on: http://gerrit.openafs.org/9689
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Add missing cases of reference count value changes which were
not being logged.
Change-Id: I8bc26f31f2725e2c324831bce3da0b68a7fb91d9
Reviewed-on: http://gerrit.openafs.org/9690
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Add a new object reference category AFS_OBJECT_REFERENCE_FS_REQ which
is used to avoid overloading AFS_OBJECT_REFERENCE_DIRENTRY.
Change-Id: I428940005dd7b4502329d4171b7307282099af44
Reviewed-on: http://gerrit.openafs.org/9668
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Cache the volume size information for .readonly volumes which can
be reset when the volume callback is broken. This reduces the number
of RXAFS_GetVolumeStatus RPC calls issues on .readonly volumes.
Change-Id: Ie0e63ca9082a004da71098e28df1315d42d364ff
Reviewed-on: http://gerrit.openafs.org/9681
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Each of the btree enumeration bulk stat operations include the
directory object in the bulk stat list. If the only object in the
list is the directory object, do not perform the bulk stat rpc as
it just wastes time. All of the required objects are already cached
with current callbacks.
Change-Id: Ic0fac50f36bdca1e79f48ca308c373a2b3152675
Reviewed-on: http://gerrit.openafs.org/9675
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
The conversion of pam/ to use libtool introduced references to
file names with LT_CCRULE that are not subject to make's vpath
searching.
Sprinkle ${srcdir} accordingly to fix the build.
Change-Id: Ia500fe2a57813fdd93ca1767e243fd947d6b8e1e
Reviewed-on: http://gerrit.openafs.org/9677
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Commit 34fc86bcc7 changed several uses
of VBUSY to VOLSERVOLBUSY in order to detect retriable operations.
However, one such change did not change an Rx abort code, but instead
was used for the 'status' field for a volintInfo or volintXInfo
structure. That is not really a general error code, but a field with a
few specific known values (at least, that is how existing clients
interpret it).
Go back to using VBUSY, so clients indicate the volume as busy,
instead of as offline/unattached.
Reported by Andy Malato.
Change-Id: Ia569633d98266cb15c059e66150d8d7f91d20dca
Reviewed-on: http://gerrit.openafs.org/9678
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
The logic we use for using krb5-weak.conf to allow 'weak crypto'
requires us to know where the default krb5.conf is. The default
krb5.conf local can vary significantly depending on the platform, and
we don't have a good way of figuring out what it is, so we guess. We
may guess wrong.
To limit the cases where we guess wrong, only try to do this
workaround if the krb5-weak.conf file actually exists.
Change-Id: Id3905268b5cc22dafb4dd539b9f3d323a656fee2
Reviewed-on: http://gerrit.openafs.org/9667
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
In 1d8937b860 we added a function call to kauth_cred_unref in the
DARWIN100 case (replacing a macro), but added the inclusion of
sys/kauth.h only when using versions older than DARWIN80.
On DARWIN100 and above, clang detects that the now-implicit function
declaration is in conflict with the actual prototype, which is included
later through afs/sysincludes.h when compiling the kernel rx code.
Since including sys/kauth.h seems to have been harmless for old versions,
just include it always.
Change-Id: I4b65f5405a3de918091f8c25440801d0ce9f90b8
Reviewed-on: http://gerrit.openafs.org/9676
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
aklog tweaks the KRB5_CONFIG environment var when performing one of
our 'weak crypto' workarounds. We assume that the default krb5.conf is
/etc/krb5.conf, but for Solaris 11 libkrb5, krb5.conf is in
/etc/krb5/krb5.conf. Although this file could be anywhere, try
/etc/krb5/krb5.conf too, so we at least work on stock Solaris.
Change-Id: I1f53b9b58549da04f2a27f1f579dd0084796e51d
Reviewed-on: http://gerrit.openafs.org/9666
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
If while writing to the fsstate.dat file, it exceeds the current
size of the file (multiples of FS_STATE_INIT_FILESIZE (8MiB)),
we call fs_stateResizeFile. This un-mmaps, truncates, and
re-mmaps the file. Unfortunately, fs_stateMapFile() resets the
state->mmap.offset and .cursor, so any writes in flight over
the resize will overwrite the first bytes of the file (and leave
zeros in the file where the data should have been written).
Upon return from the write that caused a file resize, the offset
is eventually corrected and the state dump continues with a
silent failure. Eventually the state dump completes and the
file header is rewritten; this may conceal some or all of
the overwrite damage at offset 0. However, any zeros near the 8MiB
offset (and its multiples) remain as corruption.
Add a flag to fs_stateMapFile() to allow the caller to specify if
the offset and cursor should be preserved. Modify fs_stateResizeFile()
to use this capability.
testing note: temporarily reduced FS_STATE_INIT_FILESIZE to 256 bytes
during testing in order to make the problem easier to reproduce.
This problem would normally occur only on relatively large/active
DAFS fileservers.
Change-Id: I9b6c57ef7727837ae7cfc00d02192983355dad2b
Reviewed-on: http://gerrit.openafs.org/9599
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Improve JudgeEntry() detection of orphaned directories to
prevent unintentional deletion of their '.' and '..' entries.
This in turn prevents a later assert (opr_Verify) when we try to
delete and re-add '..' in order to attach the orphan.
In JudgeEntry(), 2 sources of information about a
directory entry are compared for consistency:
- vnodeEssence (unique) from its vnode index entry
- name, vnodeNumber and unique from its dir blob entry
A directory entry may be ignored, deleted, or repaired/replaced,
based upon the results of these and other tests (e.g. dirOprhaned).
The '.' and '..' entries are treated as special cases because
we do not want to delete them at this point if this directory
is orphaned. However, the current test for orphanhood
(vnodeEssence->unique == 0) is not sufficient; it could be
zero for other reasons. This commit now uses the dirOrphaned
flag to test for this.
However, we are still interested in doing the right thing
for '.' and '..' entries with vnodeEssence->unique == 0.
This may indicate that the dir blob entry is pointing at the
wrong vnode, and that vnode has unique==0. The current code
incorrectly ignores (returns 0) this case. This commit now
now falls through to the repair/replace code so that we can
find the correct vnode for this entry.
The current code assumes that the 'vnodeEssence == 0 &&
!dirOrphaned' case doesn't exist.
Thanks to Andrew Deason for his assistance.
Change-Id: Id7c466fcc0f031b8fccb52dc51493eeed040cf95
Reviewed-on: http://gerrit.openafs.org/9104
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
The top-level Makefile did not recurse into dvolser or tvolser for
FreeBSD. They compile just fine, so enable them.
Change-Id: Id85e3a72f53b85e6b155b224268e2fe587fe3406
Reviewed-on: http://gerrit.openafs.org/9598
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
When commit 9b0a7f5d13 added the variable
'clntEtcDir' it failed to assign it a value on Windows.
Change-Id: I02cfb994a28e3e1032741d1b2710acb5d40d9bfd
Reviewed-on: http://gerrit.openafs.org/9635
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Patchset 38cf31463e added a definition of
afs_ino_str_t stmp which should have replaced the b64_string_t stmp
declaration that was already present.
Thanks to Jason Madar for noticing.
FIXES 131620
Change-Id: I780efd55dea33f1f7893b68285c841e80660b3f3
Reviewed-on: http://gerrit.openafs.org/9608
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
This patchset enables AFS Symlinks and DFSlinks to be copied to
a local NTFS disk using robocopy's /SL option.
Separate print names and substitute names are now provided permitting
the reparse data copied from AFS to be applied to a local disk object
for recreation.
Change-Id: I7bab4e8352a069a14b9ac4b3b2e22819f3de7a23
Reviewed-on: http://gerrit.openafs.org/9655
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
The WN_ALREADY_CONNECTED error is only to be returned if a local
device name (aka drive letter) is provided in the request. Otherwise,
the proper return status is WN_SUCCESS if an unnamed connection is
requested.
Change-Id: I1e1ca47a84e353db66e2830ec11f968a3578c4f6
Reviewed-on: http://gerrit.openafs.org/9642
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
When canceling a network connection to a UNC path, do not match
connections that have drive letters assigned. Only cancel the connection
if there it matches the UNC path and has no local name.
Change-Id: I2c27c6d08cec65406f7e7f9eb61cd6d6c7be1f5c
Reviewed-on: http://gerrit.openafs.org/9640
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Use InterlockedExchangePointer to disconnect the ObjectInformationCB
pointer from the caller. This ensures that only one thread can
successfully call AFSDeleteObjectInfo on the same object at a time.
Change-Id: Ie70f52fc443f88c3cb4be41f12caa91466d92905
Reviewed-on: http://gerrit.openafs.org/9644
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Avoid a potential NULL pointer dereference if the ParentObjectInfo
object cannot be found. If the Btree lookup fails, do not call
AFSCreateSymlink() and do not decrement the ObjectInfo refcount.
Doing so will result in a BSOD.
Change-Id: Ibd3e4ebb343f6c3cff8bf1cb160e42938d0f906c
Reviewed-on: http://gerrit.openafs.org/9643
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Work items are now queued in an AFSRedir.sys data structure
and are not freed when AFSRedirLib.sys is unloaded. Therefore,
do allocate the memory with AFSLibExAllocatePoolWithTag().
The allocation by AFSLibExAllocatePoolWithTag results in a false
Driver Verifier warning of a memory leak on unload.
Change-Id: I268c4b6d20090e88114456a24b7648eef59f6289
Reviewed-on: http://gerrit.openafs.org/9641
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
When 'cm_directIO' is true, there are no RDR held buffers therefore
there is nothing for buf_ClearRDRFlag() to do. Do not pass 'Go',
do not obtain cm_scache.rw exclusive nor buf_globalLock shared.
Simply return immediately.
Change-Id: I4c6d1486e3a2bef987a3eb36d8de446e9009e0d2
Reviewed-on: http://gerrit.openafs.org/9638
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
If 'cm_directIO' is true, then no RDR buffers exist. Return immediately,
do not pass 'Go', and do not lock and walk the buffer hash table.
Change-Id: I9c6499d429d7591c8bd67ce3077ff4c4e7d6d62d
Reviewed-on: http://gerrit.openafs.org/9637
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
In the middle of the big loop do not obtain buf_globalLock unless
cm_buf.qFlags & CM_BUF_QREDIR is non-zero. buf_globalLock is heavily
contested and any reduction in contention is an improvement.
CM_BUF_QREDIR is never set when 'cm_directIO' is true (now the default)
so this is a huge win.
Change-Id: I0b150bf77a0f1d748f94026d3b74bc7d90e7c3c6
Reviewed-on: http://gerrit.openafs.org/9636
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
When evaluating symlinks for directory enumerations, the response
must properly set the FILE_ATTRIBUTE_DIRECTORY flag based upon the
file attributes of the target. At the present time the target is
not evaluated by the service and AFSQueryDirectoryQueryDirect does
not have the correct context in which to evaluate the target.
Instead of returning an incorrect result to the application, exit
AFSQueryDirectoryQueryDirect() returning STATUS_REPARSE_OBJECT which
is interpreted by AFSQueryDirectory() to perform a full directory
enumeration.
Change-Id: Ic35dcff31f1098b9f40f3a37534b79439e0e3f1f
Reviewed-on: http://gerrit.openafs.org/9633
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>