Commit Graph

7173 Commits

Author SHA1 Message Date
Ben Kaduk
b811e4f91e Define osi_procname for FBSD
The kernel linker doesn't like to load modules with unresolved
(implicitly-defined) symbols (understandably).  Make it happy.

Change-Id: I23fdbb9c9e07a0c583580f5c5eee577a04fae278
Reviewed-on: http://gerrit.openafs.org/1925
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: sanket <sanket@sanketagarwal.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
2010-05-07 10:51:58 -07:00
Ben Kaduk
7ba5c7263d Actually fix build for FBSD80 after vcache refactoring
One more s/tvc/avc/

Change-Id: Ie99310bb08da5bf7aaee022e9c0ca43d1a33c3db
Reviewed-on: http://gerrit.openafs.org/1923
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-06 20:42:13 -07:00
Ben Kaduk
de68cdef9e Add entries for FBSD 8.1 and 9.0
Though neither have been released, yet, RELENG_8 and HEAD are
starting to get changes that we need to conditionalize on.

Change-Id: Ia3af3c38abe4d0d01e0cef974771b45a97d3d9aa
Reviewed-on: http://gerrit.openafs.org/1691
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-06 20:41:24 -07:00
Simon Wilkinson
07098dc670 Modernise use of AC_CHECK_TYPE
Prior to autoconf 2.13, AC_CHECK_TYPE took two arguments, the type
to check and the a default type to use if that type wasn't defined.
This usage has been deprecated since 2.13, and the AC_CHECK_TYPE
macro itself now behaves differently. Whilst there is a compatibility
mode, the autoconf documentation discourages its use.

We also have an occurence of a slightly more modern AC_CHECK_TYPE,
where we explicitly #define a default value if one isn't provided.
The autoconf manual also discourages this form, however, in favour
of using AC_CHECK_TYPES, and placing suitable typedefs in an
external header file.

Modify our code so we do things in the recommended way.

Change-Id: Ie28067f2c90e9a3aa25cfde45ef081da2d380ee1
Reviewed-on: http://gerrit.openafs.org/1914
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-06 12:23:22 -07:00
Simon Wilkinson
972a407282 Always include afsconfig.h in autogenerated files
Modify rxgen and compile_et so that the files they output always
contain afsconfig.h before afs/param.h. This avoids problems where
afs/param.h, or headers included from it, rely on having the results
of configure tests available.

Change-Id: I0198500a17abd31ee1057d6780cbe5a5e1bc8c59
Reviewed-on: http://gerrit.openafs.org/1913
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-06 12:22:31 -07:00
Antoine Verheijen
dc9bef83b0 OpenBSD: Use osi_obsd_Free() for all releases of OBSD
Use osi_obsd_Free() in afs_osi_Free() for all releases of OpenBSD,
not just releases from 4.4 onward. Otherwise, afs_osi_Free() will
use AFS_KFREE, which does not exist, since OBSD/osi_machdep.h is
not included, resulting in unresolved symbols when trying to load
the kernel module.

Change-Id: Ic9632c9df347cc17e122b6302ef14e63fa5b68b4
Reviewed-on: http://gerrit.openafs.org/1910
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-06 12:18:34 -07:00
Antoine Verheijen
8fe309e6b6 OpenBSD: Use FREE instead of KFREE
In OpenBSD releases prior to 4.2, use the system (kernel-specific)
FREE macro to release space in the kernel module, not KFREE. The
latter does not exist and results in unresolved symbols when trying
to load the kernel module. (This was undoubtedly a typo.)

Change-Id: Id66704ab4d0928e2ce1234de16bb74fe22f4f9c7
Reviewed-on: http://gerrit.openafs.org/1909
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-06 12:18:16 -07:00
Simon Wilkinson
8e27248698 Always include afsconfig.h
Our coding standards say that OpenAFS source files should always have
 #include <afsconfig.h>
 #include <afs/param.h>
at the start of the file. Including just param.h, or having these
includes in a different order can produce unexpected effects, because
param.h includes sysnames.h, which in turn includes stds.h, which may
rely upon having the results of configure tests available.

Fix the obvious places in the Unix build which get this wrong.

Change-Id: I081f04dab30a6bbb49fe71d3ac2d7c11e231e2f5
Reviewed-on: http://gerrit.openafs.org/1912
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-06 11:52:08 -07:00
Marc Dionne
3e449fccee Fix typo: LockType -> lockType
Fix simple typo that causes a build error.

Change-Id: I85f2899850383746094b7e9bab81dea13c2caeab
Reviewed-on: http://gerrit.openafs.org/1908
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-05 20:18:14 -07:00
Derrick Brashear
8b6550a090 fcntl write lock on readonly file error fix
apparently we return EROFS where we should return EBADF. Fix the
error the client gets; the RPC is unchanged (and indeed shouldn't
be changed)

Change-Id: I738f1ee36f39d03bf018c0f91c7de9c8ed8cc9a9
Reviewed-on: http://gerrit.openafs.org/1895
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-05 13:41:28 -07:00
Derrick Brashear
5c192d15ac afsdump scan kill warnings
make prototypes for all initialize error table functions appear

Change-Id: Icc72f5218a2f6e0444a325c7fc9a0c1c34843344
Reviewed-on: http://gerrit.openafs.org/1907
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-05 13:40:57 -07:00
Derrick Brashear
98d20e250d freebsd vcache splitting fallout
fix the vcache splitting to work again

Change-Id: I8833fc6655dcb79329835664d38f5330645b45f8
Reviewed-on: http://gerrit.openafs.org/1904
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-04 09:17:13 -07:00
tharidufernando
1e69ec9cfe Windows: Secure C String usage in src\WINNT\afsd\fs.c
The use of strlen, strcat, strcpy, strncpy and sprintf in
src\WINNT\afsd\fs.c does not effectively protect against buffer
overruns and string truncation errors.  This patchset replaces
their use with StringCbLen, StringCbCat, StringCbCopy,
StringCbCopyN, StringCbCopyEx and StringCbPrintf respectively from
strsafe.h.

The functions sscanf, fscanf and scanf do not check for the size of
the parameters so it is prone to buffer overruns. These functions
can be replaced by sscanf_s, fscanf_s, scanf_s when the Visual Studio
compiler version is 1400 or greater.  Also memcpy will be replaced
by memcpy_s which will check for the size of the destination buffer.

In all cases, failure conditions are handled.

Patchset development was mentored by Asanka Herath and Jeffrey Altman.

Change-Id: I01e9dfc616641c220b57d2871e3e140406df3653
Reviewed-on: http://gerrit.openafs.org/1736
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Tharidu Fernando <tharidufernando@gmail.com>
Tested-by: Tharidu Fernando <tharidufernando@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-04 04:35:34 -07:00
Jonathan A. Kollasch
fb50f2478c NetBSD 5.0 support.
Change-Id: I5b9c5b8204ef729d9719f195ddbaf83c5f9cb4b5
Reviewed-on: http://gerrit.openafs.org/1738
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-03 19:55:30 -07:00
Andrew Deason
7084e5ff7d Solaris: shutdown in freevfs, not unmount
Call the afs shutdown sequence (afs_shutdown()) in the VFS_FREEVFS
handler, instead of in the VFS_UNMOUNT handler. This way we shutdown
when the last reference to our vfs goes away, instead of when we are
unmounted. That doesn't make much of a difference right now, but doing
so will be required for supporting forced unmounts.

Change-Id: I4158865b139d05e2955e4809b93628df27b83922
Reviewed-on: http://gerrit.openafs.org/1899
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-03 17:12:28 -07:00
Andrew Deason
fc8ab5cfd6 Solaris: prevent AFS umount while busy
Return EBUSY from unmount if someone still references stuff in AFS.
This prevents kernel panics that can occur on shutdown if we umount
while there is a file in AFS open. Normally a process can hold a file
in AFS open, AFS is unmounted, and the file is closed, triggering our
code which explodes if called after we're unmounted.

This adds VFS_HOLD/VFS_RELE calls whenever we 'create' a vcache, or
retire an old one, to keep track if anyone has an open reference to
us.

Change-Id: I95d8cf7e7e4d32a05bee97e06832a530b40af217
Reviewed-on: http://gerrit.openafs.org/1880
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-03 17:11:44 -07:00
Andrew Deason
34b7fd4a49 Solaris: return ENOTSUP for force-unmounts
We don't support forced unmounts yet, so indicate as such.

Change-Id: I3a130a4a8d31eeffd012352f656c2b4e42b46f27
Reviewed-on: http://gerrit.openafs.org/1879
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-03 17:11:34 -07:00
Simon Wilkinson
9be76c0d31 Refactor afs_NewVCache
afs_NewVCache was a twisty turny maze of #ifdefs and duplicated code.
This makes a number of sweeping changes to simplify this code, and to
move platform specific elements out into their own directories.

*) ShakeLooseVCaches is refactored so that the same code can be used
   both for platforms that support dynamic vcaches, and those which
   don't.
*) afs_NewVCache, ShakeLooseVCaches, and afs_AllocVCache are all
   modified to remove platform specific code, and to call platform
   specific functions.
*) A new platform file 'osi_vcache.c' is created to hold a number of
   platform specific vcache operations:
   *) osi_TryEvictVCache handles the decision of whether a vcache can
      be evicted or not, and does so if required
   *) osi_NewVnode allocates a new vnode
   *) osi_PrePopulateVCache does the necessary population of the
      vcache, before it's threaded onto the VLRUQ and associated hash
      tables.
   *) osi_AttachVnode handles attaching an OS vnode to our vcache,
      where that is necessary
   *) osi_PostPopulateVCache handles the vcache population that must
      occur after we're on the VLRUQ and have a vnode attached.

Change-Id: I368e5fb500d012b44141aa8f8cf0516e63e58f57
Reviewed-on: http://gerrit.openafs.org/1881
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-03 17:11:20 -07:00
Michael Meffie
5e09bcd936 pts mem -expandgroups and -supergroups examples
Examples of the pts mem -expandgroups and -supergroups
options for the man page.

Change-Id: Idea0509797212397eff87aa5975eaf5364c8414c
Reviewed-on: http://gerrit.openafs.org/1896
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-03 17:04:17 -07:00
Antoine Verheijen
5e24220c3d OpenBSD: Fix bug in setpag() when group list is empty
In OpenBSD, the PAG uses the 2nd and 3rd group slots in the task's
group list. If an application sets en empty group list (such as Samba
does), any existing PAG is lost and any new one is NOT set because
the existing code will set the new group count to 2 instead of 3, and
it leaves the first group entry as garbage (whatever random value the
memory contained), thereby totally messing up the task's group list.
This patch fixes it so that it behaves as expected.

Change-Id: Ia718d55cbaad8ed372fba926dbfcb5db52ea684a
Reviewed-on: http://gerrit.openafs.org/1898
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-03 17:03:32 -07:00
Antoine Verheijen
0ec2239b73 Fix pattern to detect i386-based OpenBSD system type
When the pattern to detect OpenBSD system types (via MKAFS_OSTYPE) was split
into two separate ones for amd64 and i386 architectures, the pattern for
i386-based systems was not set quite right. As a result, i386-based OpenBSD
systems are no longer detected properly at this stage, resulting in an error
of "cannot find input file: src/libafs/MakefileProto..in" during configure.
This patch corrects the pattern.

Change-Id: I67079af74117fa3cdc765f19944e23223709ae6b
Reviewed-on: http://gerrit.openafs.org/1897
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-03 17:02:25 -07:00
Asanka Herath
98d9d6cf83 Windows: Show configuration pages for all types of MSI installations
The OpenAFS MSI installer wizard used to not show any configuration
pages for "Typical" and "Complete" installations.  Setting the
workstation cell and logon options during installation required
selecting the "Custom" option.  Many users choose the "Typical" option
during installation, and thus would never see the configuration pages.
Therefore, for these users, the workstation cell was being set to the
default.

This patch makes the workstation cell and logon option configuration
pages visible to all types of installations (except silent
installations which show no UI).

Change-Id: Ie3bc040607a8d6b636c884bfcb919d0fc69b0e06
Reviewed-on: http://gerrit.openafs.org/1797
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-03 06:25:07 -07:00
Tom Keiser
49c4200a9e Provide a queue_NodeInit() interface
Provide a queue_NodeInit() interface for the rx queue package.

Change-Id: I85f6caf3605b9a88113ff4d904012ed2aa12a679
Reviewed-on: http://gerrit.openafs.org/1860
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-03 04:45:27 -07:00
Jeffrey Altman
cec1b09ff7 Windows: Restructure cm_LookupInternal addition of Freelance entries
cm_LookupInternal creates Freelance mount points and symlinks
when queries cannot be found in the Freelance root.afs directory.
If the search name is a full cell name for which vldb information
can be obtained, then a mount point is added.  If the search name
is a left-most substring or the full cell name with a dot appended
to it, then a symlink was created.  This approach created a very
poluted Freelance name space.

This patchset makes the following changes:

 1. Do not create symlinks with a dot appended to the cellname

 2. Do not create symlinks where the left-most substring is not
    a full dot separated component of the cellname.

 3. Permit lookups to succeed when we would have created a
    symlink in the past without creating the symlink.

LICENSE MIT

Change-Id: I4573a2f13d4843878c3f5efc546df29a5023accc
Reviewed-on: http://gerrit.openafs.org/1894
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 12:48:27 -07:00
Jeffrey Altman
71f91cd93c Windows: Permit BPlus tree lookups within cm_ApplyDir
BPlus tree lookups are much faster than searching through
the native directory format on Windows because the case sensitive
hash tables cannot be used successfully.  Permit BPlus trees
to be used except when called with cm_BPlusDirFoo as the action
function because cm_BPlusDirFoo is used to build the BPlus trees
from the native directory format.

LICENSE MIT

Change-Id: I3f6f5ba7113e206c76fafd1ec83822adc7f42f9e
Reviewed-on: http://gerrit.openafs.org/1893
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 12:47:21 -07:00
Jeffrey Altman
ebbd415f28 Windows: Prevent cm_FreelanceAddSymlink from creating a symlink ending in a dot
Symlinks are ending up in the Freelance root.afs directory that
end with a dot.  Make sure it cannot happen.

LICENSE MIT

Change-Id: I8a19c0cf6c2a68c22839e15641206f7e9db8b15b
Reviewed-on: http://gerrit.openafs.org/1892
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 12:13:38 -07:00
Jeffrey Altman
ec35612ce9 Windows: normalize error codes from cm_FreelanceAddSymlink
Return all error codes from the end of the function.

LICENSE MIT

Change-Id: I7703c90884820ed7eb1f43183d80c7df038cfb8b
Reviewed-on: http://gerrit.openafs.org/1891
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 12:13:12 -07:00
Jeffrey Altman
da2db62342 Windows: Force rebuilding Freelance directory in AddMount and AddSymlink
cm_FreelanceAddMount and cm_FreelanceAddSymlink is supposed to
return the allocated FID of the entry that was added.  However,
cm_NameI is called to perform the lookup without forcing an update
of the Freelance fake directory.  As a result the entry may not be
found.

Force an update prior to calling cm_NameI() by using
cm_clearLocalMountPointChange() and cm_reInitLocalMountPoints()
if required.

LICENSE MIT

Change-Id: I08147b2ec61c810fdc718964362315af67d485b8
Reviewed-on: http://gerrit.openafs.org/1890
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 12:12:49 -07:00
Jeffrey Altman
f8efae8c70 Windows: normalize return codes from cm_FreelanceAddMount
Instead of returning an undefined CM error code, -1, which might
end up being confused with an Rx error, return legal CM_ERROR_xxx
values.

LICENSE MIT

Change-Id: Ie78e4e9cf00fa938806c8b355f54169a5691ff04
Reviewed-on: http://gerrit.openafs.org/1889
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 12:12:18 -07:00
Jeffrey Altman
1ff924e722 Windows: use cm_noteLocalMountPointChange whenever fakeDirVersion is changed
cm_noteLocalMountPointChange() is meant to be used when fakeDirVersion
is changed.  It previously wasn't used because cm_noteLocalMountPointChange()
would obtain the cm_Freelance_Lock.  Now that cm_noteLocalMountPointChange()
can be called while holding the lock, use it everywhere.

LICENSE MIT

Change-Id: I737f4572773a93a656ca0f58e07a55d250c368a1
Reviewed-on: http://gerrit.openafs.org/1888
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 12:11:03 -07:00
Jeffrey Altman
3a48bf73d3 Windows: add locked parameter to cm_noteLocalMountPointChange
If cm_Freelance_Lock is held set the 'locked' parameter to TRUE.
This avoids a requirement to drop the lock only to have it be
obtained when cm_noteLocalMountPointChange.

LICENSE MIT

Change-Id: Ic1e8a008639b33769a088c3b24ef7a7e7b09fb12
Reviewed-on: http://gerrit.openafs.org/1887
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 12:10:24 -07:00
Jeffrey Altman
f2b98e27f8 Windows: remove unused code from cm_FollowMountPoint
The variable 'tlen' is set to the length of the mount point
target string but is never used.  Remove it.

LICENSE MIT

Change-Id: I1e53831eff90962c93720831a210faa019e38d67
Reviewed-on: http://gerrit.openafs.org/1886
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 10:43:11 -07:00
Jeffrey Altman
4810026677 Windows: initialize to zero Freelance fake root directory
The Freelance fake root directory buffers were not zero-filled.
This results in random behavior that can cause the service to
terminate unexpectedly.

LICENSE MIT

Change-Id: If4e42f74bf07a7296319f3a73f8c7628de4e1fd8
Reviewed-on: http://gerrit.openafs.org/1885
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 10:41:10 -07:00
Jeffrey Altman
612bb07ae1 Windows: make cm_BPlusDirFoo public
Make cm_BPlusDirFoo so that the function pointer can
be referenced from cm_ApplyDir.

LICENSE MIT

Change-Id: Ic58ce47dbcd9d6348666b1767941d861cd860df5
Reviewed-on: http://gerrit.openafs.org/1884
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 10:40:41 -07:00
Jeffrey Altman
1b4b0b7576 Windows: correct "fs quota" pioctl validation check
The validation check for the response from the GetVolumeStatus
pioctl is incorrect.  The response is not simply a VolumeStatus
structure but also several C strings appended to it.

LICENSE MIT

Change-Id: Ieb0c0cd166f85e073431890f51f735958776eb74
Reviewed-on: http://gerrit.openafs.org/1883
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 10:40:04 -07:00
Jeffrey Altman
715670cbe9 Windows: getAFSServer wrong variable used in uncompiled code
In the uncompiled implementation of getAFSServer, the unmodified
'cellname' is used in the send_DNS_AFSDB_Query call instead of
the properly constructed 'query' variable.

LICENSE MIT

Change-Id: I9de506a2986872ab88aeea158aa43133efc75d50
Reviewed-on: http://gerrit.openafs.org/1882
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 10:38:55 -07:00
Jeffrey Altman
4f7bf8fb43 Windows: FlushFile ioctl should call cm_FSync, not buf_CleanVnode
When flushing a file, we need to commit the file length changes
as well as the dirty buffers.  Call cm_FSync instead of buf_CleanVnode
which is called by cm_FSync.

LICENSE MIT

Change-Id: Id21e49e0559d20fce3e1d65cb73496a8b6cb1fa1
Reviewed-on: http://gerrit.openafs.org/1875
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 10:38:28 -07:00
Jeffrey Altman
1844719127 Windows: add 'locked' flag to cm_FSync and call when dropping write locks
cm_FSync should be called when releasing file server write locks.
This ensures that all dirty buffers are stored before the lock
can be acquired by another client.

Since cm_Unlock holds the cm_scache_t->rw exclusively when calling
cm_FSync, add a 'locked' parameter to cm_FSync to avoid an unnecessary
release and reacquire of the rwlock.

LICENSE MIT

Change-Id: I70bbeffc24ec4238461281bab4006b3a57b275e2
Reviewed-on: http://gerrit.openafs.org/1876
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-02 10:38:11 -07:00
Marc Dionne
a1cbbccce3 Warning fix: cpp hates apostrophes
The compiler complains when the text in a #warning contains a
single apostrophe:
   error: missing terminating ' character

Change the text to avoid it.

Change-Id: Ibf1f4d2cb922b313545ed228a2a8d4eb6b134178
Reviewed-on: http://gerrit.openafs.org/1877
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-28 16:49:26 -07:00
Matt Benjmain
94c15f62d3 netbsd: rebase cm at NetBSD 4.0
Rebases the NetBSD client port at OpenBSD, which was originally
based on an original NetBSD client port by John Kohl.  The
platforms remain closely connected.

At latest milestone, the port builds as a NetBSD LKM, which was
loadable and can mount /afs (but much work remains past this
point).

Change-Id: I1381a60078794da03a82e7bf6e78127da82d61ee
Change-Id: I8e07e82796f6981c99d22ff50dd5b284aad88a9f
Reviewed-on: http://gerrit.openafs.org/1874
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-04-28 13:47:20 -07:00
Derrick Brashear
7f399f2cac upstream dumpscan changes
pull in code changes from upstream for dumpscan

Change-Id: Ib1bcba7a420d19c1bf27b2a5405aaee786e6cbd6
Reviewed-on: http://gerrit.openafs.org/1873
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-28 07:18:12 -07:00
Simon Wilkinson
d02f9a0b0b Linux: Register number sysctls only when desperate
The AFS sysctl interface was trying to register numeric system
calls whenever the kernel would let it. This is anti-social, as
we've never had sysctl numbers allocated to us. In kernels newer
than 2.6.24, this misbehaviour is detected and punished. In recent
kernels, the binary interface has gone away entirely.

Since 2.6.19, the kernel has supported allocated unnumbered system
calls. These are only available via /proc/sys (and not the using
the legacy, binary, API), but they're really the only interface
available to us.

Change the sysctl registration code to use unnumbered calls whenever
they are available. Unnumbered calls aren't available in 2.4.x, so
completely remove that code there.

Change-Id: I882117ca2250894f479292026fed84ff0b5e7972
Reviewed-on: http://gerrit.openafs.org/1871
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 21:43:15 -07:00
Marc Dionne
b1c6d709cb Linux: specify void argument for afs_try_to_freeze inlines
The new freeze inlines take no arguments, but need to be declared
as taking (void) to prevent warnings that it is not a proper prototype.

Change-Id: Ife675e69f566fabaee4bc41f2cc4fa9a20e816db
Reviewed-on: http://gerrit.openafs.org/1870
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 17:21:36 -07:00
Marc Dionne
009b547195 Linux autoconf: fix name for struct cred test
The new macro scheme changes the name of the tested define.
Update the code to match.

Change-Id: I0e9f04692d8fbb6e9452a9b169c191ce7148349b
Reviewed-on: http://gerrit.openafs.org/1868
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 16:41:28 -07:00
Marc Dionne
d88b0b9a7b Linux autoconf typo
The test for the new export ops has a typo which
makes the test fail where it should succeed: eops -> _eops

Change-Id: I97dd0707b911c51f6394ada426a98e06a83ad35e
Reviewed-on: http://gerrit.openafs.org/1867
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 16:41:03 -07:00
Tom Keiser
6c53cd7ad3 Add some directory package doxygen comments
Change-Id: I75c358f08c71b2de722de03bb65fb8696657d57f
Reviewed-on: http://gerrit.openafs.org/1861
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 14:37:09 -07:00
Simon Wilkinson
b7a94ae11d Linux: autoconf fallout
grap != grab - fix spelling of grab_cache_page_write_begin

Change-Id: I4032bff80b6d1d7568af8f9de59a56c0bd6a661a
Reviewed-on: http://gerrit.openafs.org/1859
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 14:36:04 -07:00
Matt Benjmain
c598e34fc3 netbsd: remove old (non-original) NBSD port
Prepare for rebase of NBSD port at the current OBSD port,
which is descended directly from the original NBSD port and
more closely resembles it.

Change-Id: I9ff67ebea04534ac5ddc11c0aa1d65028067806a
Reviewed-on: http://gerrit.openafs.org/1858
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 13:22:03 -07:00
Marc Dionne
14195f0f48 Linux: Remove unnecessary crhold on incomplete kernel credentials
When credentials debugging is active in the kernel, sanity checks
in various credentials functions such as get_cred or put_cred
require that they are called with full fledged kernel credentials.
This can be a problem with recent kernels in osi_Init where we
build our own credentials and try to "crhold" them.
Getting a reference doesn't make much sense anyway since we're
using a statically allocated structure that we never try to free
or modify.

As a minimal fix, just don't call crhold when we're using
the kernel credentials structure.

Change-Id: If4f843ad33526c6a42f1cf67c57763593ffa50ac
Reviewed-on: http://gerrit.openafs.org/1828
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 12:42:49 -07:00
Derrick Brashear
014821d281 flush changes on LOCK_EX unlock
right now, flock with LOCK_EX, on unlock, triggers an async store.
make it sync, but also, make sure to ask to have any in-memory
data sent to us (e.g. VM_StoreAllSegments); unlike Solaris
VMSYNC_INVAL, we don't want to invalidate the pages, just get copies
written back.

LOCK_SH did not, does not and AFAICT should not trigger writes.

Change-Id: Id4a72f73b685b5566bb31f6f610f22d806899280
Reviewed-on: http://gerrit.openafs.org/1846
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 12:40:58 -07:00