Andrew Deason [Mon, 12 Apr 2010 17:39:00 +0000 (12:39 -0500)]
Do not turn off AFS_HAVE_STATVFS for UKERNEL
Many param files turn off AFS_HAVE_STATVFS for UKERNEL. We obviously
still have statvfs() available whether we are running with UKERNEL or
not, so modify param files to enable it for UKERNEL if it was enabled
for non-UKERNEL.
The only places using this define are afsd and vol/partition.c, the
latter of which will not be affected.
Matt Smith [Sat, 10 Apr 2010 06:36:59 +0000 (01:36 -0500)]
Fix problems from afs_osi_gcpags reorganization
Corrections to mistakes made during the reorganization
of afs_osi_gcpags.c to per-OS directories. Includes fixes to
LINUX24 and whitespace corrections.
Michael Meffie [Sat, 10 Apr 2010 01:03:09 +0000 (21:03 -0400)]
afsmonitor: show busy counts
Update afsmonitor to display rx_nBusies, fs_nBusies,
sysname_ID, and fs_GetCapabilities, which where claimed from
spare fields long ago. Add a new group name called
Busies_group to show just the busy fields.
Marc Dionne [Sat, 10 Apr 2010 00:19:19 +0000 (20:19 -0400)]
Fix UKERNEL build error - include afs/afs_osi.h
Commit d0f2ffca breaks the build on my system because
afs/afs_osi.h no longer gets included for the UKERNEL + !KERNEL
case. This causes many errors as a result of missing definitions
such as afs_kmutex_t.
Pull out this include into a separate ifdef based only on "KERNEL".
Matt Smith [Fri, 9 Apr 2010 18:32:46 +0000 (13:32 -0500)]
Move contents of afs_osi_gcpags to per-OS files
Moved the relevant chunks from src/afs/afs_osi_gcpags.c
to osi_gcpags.c located in each of the OS subdirectories.
Also updated libafs and libuafs to reflect these changes.
Andrew Deason [Thu, 1 Apr 2010 18:55:51 +0000 (13:55 -0500)]
Correct incorrect type-punning fixes
Commit 549002c906795f978eebf81c706995116a04a8ff attempted to resolve a
few type-punning-related warnings, but did so using unions. Unions are
not guaranteed to work correctly with type-punning on non-gcc, so
partially revert and reimplement.
Michael Meffie [Thu, 8 Apr 2010 17:27:36 +0000 (13:27 -0400)]
afsmonitor: add fs callback xstats collection
Adds the capability to afsmonitor to display and process
thresholds for fileserver callback xstats collections. The
callback counters are placed to the right of the full perf
data. When afsmonitor is started without a configuration
file, the callback xstats data is retrieved and displayed,
since by default afsmonitor will show every field. When a
configuration file is given, poll the fileserver only for the
collections needed to display information requested by the
'show fs' commands.
Michael Meffie [Fri, 9 Apr 2010 15:46:10 +0000 (11:46 -0400)]
afsmonitor: avoid showing full perf stats garbage
Unfortunately, the full perf stats contain timeval structures which
do not have the same size everywhere. Avoid displaying gargbage,
but at least try to show the overall stats.
Andrew Deason [Thu, 8 Apr 2010 20:35:12 +0000 (15:35 -0500)]
UKERNEL: allow creation of non-detached threads
Make usr_thread_create create a non-detached thread by default, and
just have callers call usr_thread_detach if they want it detached. The
only current caller of usr_thread_create already calls
usr_thread_detach.
Also add usr_thread_join to make it possible to join a created thread.
Andrew Deason [Fri, 14 Aug 2009 21:17:11 +0000 (16:17 -0500)]
Make osi_GetTime work on 64-bit libuafs
libuafs was previously using an implementation of osi_GetTime (and
thus clock_GetTime) that required 32-bit time_t's to work properly.
Instead, just use the non-kernel osi_GetTime for UKERNEL, since we're
just in userspace either way.
The Debian packaging files in the tree were ancient. Update to the
packaging files from the just-uploaded 1.5.73.3-1 version, which should
build and correctly install the current development source.
The current packaging files no longer use a hard-coded version in
debian/rules, so remove the configure machinery for creating it. The
correct way of handling the version number is to generate a new
changelog entry. That work will come in a subsequent patch.
Michael Meffie [Wed, 10 Mar 2010 14:48:38 +0000 (08:48 -0600)]
pts mem -expandgroups option
Improve support for supergroups in the pts membership command
with a new option called -expandgroups. This option will
recursively show the complete membership of users and groups.
The expanded members of a group are all the users which are
members of all of the group's sub-groups. The expanded groups
of a user are all the groups which are supergroups of the
users's groups.
Change-Id: I811a4e5e73632e5e205fe10f3f3a36a98464d49e
Reviewed-on: http://gerrit.openafs.org/1601 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Tue, 6 Apr 2010 23:29:44 +0000 (00:29 +0100)]
Linux: kmap() not page_address()
Using page_address() will return NULL if the page is in highmem. To
avoid this, we must kmap() the page we're getting the address of,
and kunmap() when we are done. If the page isn't in high memory, then
kmap() is equivalent to page_address().
Explain in CellServDB man page that server lines can be omitted
It's possible to use AFSDB records only to locate the VLDB servers but
still list the cell in the client CellServDB so that the client is
aware of it and populates it into dynroot. Describe doing this in the
man page.
aklog was previously writing the magic AFS ID string into previously
alloated memory with sprintf, but the variable in question was only
as long as the username, so this code could overwrite memory and lead
to heap corruption. Free previously allocated memory and use
afs_asprintf to format the AFS ID string instead.
Add a caution to the fileserver man page explaining that traditional
and demand-attach require different configurations, and also mention
that there are two different server implementations. Add an example
of a bos create command for creating a demand-attach File Server to
the fileserver man page.
Add a caution to the bos create man page that a traditional fs node
won't work with demand-attach and vice versa. Document the necessary
arguments for the dafs type. Clarify in EXAMPLES which bos create
commands are traditional and which are demand-attach. Add an example
of changing from a traditional to a demand-attach configuration.
Change kaserver to ptserver in the example of a simple process.
Windows: Support new Cygwin docbook stylesheet location
Make the computation of the docbook stylesheet location
based upon testing for directory existence now that versions
of cygwin 1.7.2 and place the stylesheets in a new location.
Windows: cm_UpdateVolumeLocation !append exts to num vol names
cm_UpdateVolumeLocation will append ".readonly" to a volume
name if the base name cannot be located. However, this should
not be done if the base name is numeric.
Rx: Remove conn_call_lock contention between rx_NewCall and rx_EndCall
Add a new call state, RX_STATE_RESET, which permits us to
remove the conn_call_lock contention between rx_NewCall
and rx_EndCall. It is no longer necessary for rx_NewCall
to hold conn_call_lock across rxi_ResetCall which can block.
rx_EndCall is therefore always free to complete without
unnecessary delays caused by rx_NewCall.
The usage of RX_CALL_TQ_WAIT flag was not consistent within both
rx.c and rx_rdwr.c. When a thread is waiting on the transmit
queue it must not only set the RX_CALL_TQ_WAIT flag but also
increment the call->tqWaiters count. Upon waking up, it must
decrement call->tqWaiters and only clear RX_CALL_TQ_WAIT if
the tqWaiters count reaches zero.
Andrew Deason [Thu, 1 Apr 2010 21:42:25 +0000 (16:42 -0500)]
tubik: Correct use of flags_cond and version_cond
Waiters of flags_cond and version_cond were not doing so correctly;
the correct way is to acquire a lock prior to their respective checks,
and atomically drop/acquire that lock with pthread_cond_wait.
Otherwise, we could miss a wakeup if a flag changed between our check
and when we wait.
To make this possible, make versionLock a normal pthread mutex in
AFS_PTHREAD_ENV, so it is a lock we can pass to pthread_cond_wait.
Make the waiters pass versionLock to pthread_cond_wait, and eliminate
flags_mutex and version_mutex.
Andrew Deason [Thu, 1 Apr 2010 20:33:24 +0000 (15:33 -0500)]
Kill afs_inet_ntoa
Replace all calls to afs_inet_ntoa with the threadsafe
afs_inet_ntoa_r. afs_inet_ntoa was being used in a few places that may
be threaded (ubik), and in general should be avoided in case the
relevant code becomes threaded. Remove the definition of afs_inet_ntoa
to prevent anyone from using it.
Andrew Deason [Thu, 1 Apr 2010 18:18:41 +0000 (13:18 -0500)]
fssync-debug: fix strict-aliasing problems
We cannot type-pun pointers like that. Instead, declare a new struct
on the stack, and copy the memory into it. Remove the CFLAGS_NOSTRICT
suppression on fssync-debug.o.
Ben Kaduk [Thu, 1 Apr 2010 02:28:10 +0000 (22:28 -0400)]
Set a storeOps storeproc for the memcache case
Finish fixing the bug from 34ffc9cd that 57d8e454 only partially
fixed -- set a storeOps.storeproc element in rxfs_storeMemOps
as well as in rxfs_storeOps. This eliminates a NULL/uninitialized
memory dereference.
Ben Kaduk [Wed, 31 Mar 2010 15:27:38 +0000 (11:27 -0400)]
Fix build for FBSD80
The change to a dynamically-allocated group list came before
the change to allow the maximum size of that group list to
be set as a tuneable at boot. The 8.0 release happened to
come between them, so we must treat both cases.
(Note that AFS_FBSD81_ENV is not yet defined anywhere; that
will come later.)
Ben Kaduk [Wed, 31 Mar 2010 00:34:02 +0000 (20:34 -0400)]
Make GCPAGs_perproc_func cleaner for FBSD case
Partially rewrite 2cf1f10a to reduce code clutter.
Instead of accessing pproc->p_ucred directly in afs_GCPAGs_perproc_func(),
push this access into a FBSD-specific afs_proc2cred() function.
This is not quite right, since we do not lock the proc mutex, but
in the same way as the old version and with more reasonable preprocessor
conditionals.
This also eliminates a probably-needless call to osi_Panic.
Updated RedHat RPM spec file to include unreferenced files
Added the libkopenafs libraries and headers to the authlib package.
Added the afs_compile_et binary to the devel package
Removed the reference to .../man5/afszcm.cat.* because it is already
caught by the earlier reference to .../man5/afs* glob. This caused a
warning during the package build process.
Russ Allbery [Tue, 30 Mar 2010 05:17:31 +0000 (22:17 -0700)]
Update VCS instructions for Git
Rename README.CVS to README.GIT and update the references from CVS
to GIT. Refer readers to the wiki for the detailed instructions and
information about Gerrit.
Rod Widdowson [Wed, 24 Mar 2010 16:59:15 +0000 (16:59 +0000)]
Render the IP address for the "Ubik: Lost contact with sync-site" log
message in the same way that all other IP addresses are (via
afs_inet_ntoa, rather than stripping the buytes out in a manner which
assumes a specific endianism).
Done more as a way to test my understanding of the GIT/GERRIT
technology with a small non-important checkin.
Change-Id: I177e1288e8e23087aeebb7abe4ed63a7c2b88ccb
Reviewed-on: http://gerrit.openafs.org/1649 Tested-by: Rod Widdowson <rdw@steadingsoftware.com> Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com> Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Ben Kaduk [Tue, 23 Mar 2010 02:35:51 +0000 (22:35 -0400)]
Catch up to dynamically-sized cr_groups in FBSD80
In FreeBSD 8.0 and later, (struct ucred)->cr_groups is a pointer
to a dynamically-allocated array, and NGROUPS is now 1024 by default
(tuneable at boot).
Don't put a gid_t[NGROUPS] on the stack for the FBSD80_ENV case.
Also avoid keeping a function-local ucred structure (in
afs_osi_proc2cred()), by bypassing that function entirely
(though this accesses the process credentials directly, which may
require locking; thread credentials accesses can be safely done
lock-free). Add an osi_Panic() to ensure that it stays that way.
Don't pretend that we have a useful afs_osi_cred to export.
Don't blindly overwrite NGROUPS past cr_groups.
Jeffrey Altman [Sat, 27 Mar 2010 20:13:27 +0000 (16:13 -0400)]
Windows: buffers whose offsets are beyond EOF should be zero filled and locally allocated
When a buffer is being allocated for an offset that exceeds the
file length as known to the file server, that buffer should be zero
filled and it does not require server validation.
Previously all buffers were populated with a FetchData call.
This is wasteful of time and server resources when there is a
valid callback registration because the serverLength is known
to be valid.
LINUX: you dont need to memset() after allocating credentials
If you wanted to create a blank credential, you wouldn't want to make
it uid = 0. Anyone allocating a credential SHOULD properly fill in all
fields making this blanking operation moot. Regardless, this memset()
is before the allocation failure test and would/could panic.
Change-Id: Ia182a874a5e1bf28a2cd94898f67d81e5588d58c
Reviewed-on: http://gerrit.openafs.org/1080 Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Jeffrey Altman [Thu, 25 Mar 2010 05:23:23 +0000 (01:23 -0400)]
Windows: afslogon.dll vs windows 7
In Windows 7 the GINA is no longer used. As a result, when a
non-Heimdal realm is used for logon, the LogonDomain field
is no longer populated during the NPLogonNotify call. Instead
we must obtain the Kerberos realm from the UPN specified in
the Username field.
Jeffrey Altman [Thu, 25 Mar 2010 04:40:29 +0000 (00:40 -0400)]
Windows: aklog must reset viceId to 0 before pr_CreateUser call
If the viceId is not reset to 0, the ptserver believes the
client is attempting to request the anonymous id value
and fails the registration request with permission denied.
Booker Bense [Fri, 5 Mar 2010 15:11:41 +0000 (10:11 -0500)]
Updating UserGuide with Kerberos v5 authentication
This patchset contains updates to the OpenAFS UserGuide that
explains how to authentication OpenAFS using kinit/aklog
and uses language describing Kerberos outside the context
of the kaserver. References to applications such as telnet
have been replaced with more modern equivalents such as ssh.
Asanka Herath [Fri, 19 Mar 2010 01:13:35 +0000 (21:13 -0400)]
Windows: Monitor requests and gather diagnostics before a timeout
This patch monitors SMB requests that are being serviced and
automatically enables logging if a request takes longer than one
minute to complete. If the requst hasn't completed by the two minute
mark, the code generates a minidump. Once a minimump is generated, no
more minidumps will be produced for another 5 minutes.
SMB monitoring can be enabled/disabled using the new registry
parameter 'SMBRequestMonitor.'
Asanka Herath [Sat, 20 Mar 2010 20:46:05 +0000 (16:46 -0400)]
Windows: Make default mode bits configurable
Mode bits aren't directly exposed by the Win32 API. We were leaving
them to default to 0777 when creating new files and directories.
This patch introduces two configuration parameters;
'UnixModeFileDefault' and 'UnixModeDirDefault' which are DWORD
registry entries that are used to set the initial mode bits.
If the values are set to 0, then the behavior is identical to what we
had before.
Claudio Bisegni [Mon, 22 Mar 2010 22:35:22 +0000 (23:35 +0100)]
Develop Kerberos renew system for ticket
- In Preference pane has been added a tab called "Option" where are
showned the option for kerberos renew
- In AfsBackgrounder has been implemented the NSTimer that will call
the krb5 renew action according to user preference value
Andrew Deason [Tue, 9 Mar 2010 20:48:36 +0000 (14:48 -0600)]
vos: correct syncvldb -verbose server byte order
'vos syncvldb -verbose' outputs the before/after VLDB entries for
altered entries, but the 'after' output shows server addresses in NBO.
EnumerateEntry expects server IPs to be in NBO, so correct one location
where they were passed in HBO.