Simon Wilkinson [Wed, 4 Nov 2009 18:09:51 +0000]
Move vnode macros to their own directories
The tree is inconsistent whether macros for access to vnodes are
provided by the OS directories, or in afs_osi.h. This makes things
very confusing, especially in the Linux case where macros are
provided in afs_osi.h, and then promptly redefined in
LINUX/osi_machdep.h
Adopt a convention where default macros are conditionally provided
by osi_machdep.h. Where these aren't wanted, they should be disabled
in osi_machdep.h, and OS specific versions provided in the individual
OS's directory.
Change-Id: I47bc969af3f6670db9348689b5ce60181fd44f21
Reviewed-on: http://gerrit.openafs.org/784
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Marc Dionne [Sat, 7 Nov 2009 15:51:52 +0000]
Linux: always use afs_maybe_unlock_kernel
In one error case in afs_linux_lookup unlock_kernel() is called
directly instead of using the conditional "maybe" form.
If the config is such that the BKL is not taken, this can result
in an attempt to unlock when the lock has not been taken, and
can cause an oops.
Change-Id: I27d5db58e9b9d45d925b24e27bc43960499c6ead
Reviewed-on: http://gerrit.openafs.org/790
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Sat, 7 Nov 2009 01:10:22 +0000]
Add error_table.c to gitignore in comerr
error_table.c is a build product for comerr, should we should
gitignore it
Change-Id: Ie47ae4daec734b31c884e4732d053635ee1048bb
Reviewed-on: http://gerrit.openafs.org/788
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Wed, 4 Nov 2009 03:22:50 +0000]
Cleanup VOffline log message
Make the 'Volume X (Y) is now offline' messages appear more sanely in
the log; logging as one line at once.
Change-Id: I8a3cf986fb30e292e509237357bd1039f2f181b9
Reviewed-on: http://gerrit.openafs.org/782
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Wed, 4 Nov 2009 23:40:39 +0000]
Prevent VLRUQ race in ShakeLooseVCaches
When ShakeLooseVCaches is called from afs_Daemon, the xvcache lock
is not held. This means that if the GLOCK is dropped for any reason
(for example, whilst purging the dentry cache), then
ShakeLooseVCaches can be raced, end we can end up attempting to
flush the same vcache twice.
The symptoms of this in Linux are that we oops in clear_inode.
Get the xvcache lock in afs_Daemon(), before calling
ShakeLooseVCaches. Also, remove the conditional GLOCK code from
that function. If we don't have the GLOCK on entry, then we're really
in trouble (and both code paths - afs_Daemon and afs_NewVCache should
get the GLOCK for us, anyway)
FIXES 125589
Change-Id: I3fe5b41a661cd162ec73c51492925ad87c6d4c13
Reviewed-on: http://gerrit.openafs.org/781
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Rainer Toebbicke [Fri, 30 Oct 2009 11:10:21 +0000]
Correct diskused and files when cloning a volume
Recalculates a volume's disk space used and number of files upon
every clone where it is effortless. Even though tracked mostly
correctly, bugs and accidents leave their traces which only a
salvage would correct.
Change-Id: Ied6fb9eb3944b6e30eac175fe42649c5b7cfaefb
Reviewed-on: http://gerrit.openafs.org/756
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Derrick Brashear [Wed, 4 Nov 2009 00:26:33 +0000]
macos fstrace msgcat search path
everything else on osx will look for config in /var/db/openafs; make
fstrace do the same
Change-Id: I7b787435343b15c82cd8eb8f3ed00096d469e888
Reviewed-on: http://gerrit.openafs.org/772
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Derrick Brashear [Wed, 4 Nov 2009 00:25:23 +0000]
macos 10.6 64bit trace fixes
the 64 bit pointer massaging was incomplete for kernel
tracing on macos. add in the missing cases.
Change-Id: I38eb608c233819ab437adec25e2cd3afac3e234e
Reviewed-on: http://gerrit.openafs.org/771
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Marc Dionne [Wed, 28 Oct 2009 21:54:32 +0000]
Linux - Fix disk cache access for selinux/AppArmor constrained processes
Preserve the credentials used for cache initialisation and use then
whenever disk cache files are opened. This takes advantage of the
credentials separation work from David Howells available in kernels
2.6.29 and above.
Access to cache files was done under the security context of the
user process, causing processes constrained by selinux or AppArmor to
fail to access AFS cache files and causing the cache manager to panic.
Besides the RT tickets, should also fix the following Ubuntu bugs:
415766 429260 457779 459299
FIXES 92944,125544
Change-Id: Ief8acd65c1a3e4d8c951f80bfd65f8340b8cec34
Reviewed-on: http://gerrit.openafs.org/752
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Jeffrey Altman [Fri, 23 Oct 2009 14:54:35 +0000]
Check for (hostFlags & HOSTDELETED) after h_Lock_r
Many callers of h_Lock_r do not check if the HOSTDELETED flag is set,
even though it could have been set while waiting for the host lock. Add
checks for it everywhere we call h_Lock_r and we care if the host has
been deleted.
FIXES 125507
Change-Id: Id1430529a1afdb5e2af29d40148877f5e4260a41
Reviewed-on: http://gerrit.openafs.org/716
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Mon, 2 Nov 2009 18:19:45 +0000]
DAFS: Avoid SALVSYNC communication during shutdown
Avoid trying to contact the salvageserver for any reason while we are
shutting down. During shutdown the salvageserver may not be around
anymore, so any SALVSYNC communication will appear to hang.
Just set a global flag to indicate 'no-SALVSYNC' on shutdown, in
addition to the thread-local flag we already have.
Change-Id: Id96f20917fd0753b4934a0377b91032b2ea3d0dc
Reviewed-on: http://gerrit.openafs.org/765
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Mon, 2 Nov 2009 23:18:19 +0000]
DAFS: Wait for exclusive ops in FSYNC_VOL_OFF
In the FSYNC_VOL_OFF handler, fssync-server.c errors out if the call to
VGetVolumeByVp_r fails. However, this can fail if the volume is in an
error state such as SALVAGING. Normally we don't even call GetVolume
when the volume is salvaging, but the volume state can change to
SALVAGING inside GetVolume. This is particularly likely to happen on a
demand salvage, since we switch to the SALVSYNC_REQ state when
scheduling the salvage, and if we are still in that state when the
salvaged child requests a VOL_OFF, we will fail to get the heavyweight
ref.
Fix this in two ways. First, we VWaitExclusiveState_r before examining
states for the short-circuit logic so our view of the volume state is
more accurate. Second, re-examine the volume state after the call to
GetVolume, and perform the same short-circuit logic, since the volume
state may have changed during GetVolume.
Change-Id: I4ebb87691c28170b42e0056b342477a12d0f6888
Reviewed-on: http://gerrit.openafs.org/769
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Dan Hyde [Thu, 29 Oct 2009 16:07:47 +0000]
Add array bounds checking in h_Enumerate
When hostList is not properly NULL-terminated, the current code does
not protect from buffer overflow. The following patch prevents buffer
overflow, prints a message, and asserts.
On our Linux hosts, we never reached the original assert, as there is
a problem handling the segfault the buffer overflow causes.
FIXES 125506
Change-Id: Ifce92c593d17050e45add9e37a7a9ed4fbc377ef
Reviewed-on: http://gerrit.openafs.org/757
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Marc Dionne [Sat, 31 Oct 2009 17:27:18 +0000]
Linux: Fix write_begin configure test for recent RHEL kernels
Recent RHEL kernels now define simple_write_begin, which was used as
a test for the write_begin address_space op. This makes the test
succeed when it shouldn't, and breaks the build.
Rewrite the test to actually check the address_space operation.
Change-Id: Idac9b318ff716b61bf8ca4508d2dbdbfbad5b50d
Reviewed-on: http://gerrit.openafs.org/759
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Marc Dionne [Sat, 31 Oct 2009 12:54:52 +0000]
Fix memory allocation warnings at shutdown
At shutdown we check for unfreed memory allocated with AllocSmallSpace
and AllocLargeSpace and complain in the syslog if there are dangling
pieces. This patch takes care of a few cases that always showed up
as warnings, even after a simple start-stop of the client.
- The cacheInode file needs to be closed before the checks, since it
uses a large piece for its struct file.
- The ICL logging code allocates 6 small pieces that are never freed.
Add a shutdown_icl() function that releases everything. While we're
at it, correct one place where we allocated with afs_osi_Alloc but
freed with osi_FreeSmallSpace, confusing our accounting.
Change-Id: I4c28c848f155dec9d89e6199cde34209227ca5c9
Reviewed-on: http://gerrit.openafs.org/758
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Marc Dionne [Thu, 29 Oct 2009 21:11:34 +0000]
Linux: remove unused cr->next member in struct afs_cred
This field was once used to track allocations in a credentials pool.
That code was removed a few years ago but the field remained.
Change-Id: Ieac642d7d55c4da766a5a3aa8ff790a514b606d6
Reviewed-on: http://gerrit.openafs.org/753
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Thu, 29 Oct 2009 18:53:30 +0000]
Cleanup cache bypass
This patch cleans up the cache bypass code so that it uses a
consistent form of indentation throughout the file.
It also changes the do { } while(0); macros to omit the trailing
semicolon, as macro definitions with trailing semicolons break
normal coding conventions.
Change-Id: Id5161fe4b1ba27110e41ed27e14a2bb3c9cccd4a
Reviewed-on: http://gerrit.openafs.org/754
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Wed, 28 Oct 2009 16:06:47 +0000]
Avoid using released hosts
Since h_Release_r has the possibility of freeing a host, we should not
be using a host after it has been released. A few places can still use a
released host, potentially causing heap corruption, double frees, and
generally weird behavior.
So either move calls of h_Release_r until after we finish using a host,
or make sure to set the pointer to NULL after it has been released.
Change-Id: I3d5275c3862003e372d3c19a5462e62bf9cb269e
Reviewed-on: http://gerrit.openafs.org/747
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Thu, 29 Oct 2009 18:42:41 +0000]
Coding style cleanup
Our style for function definitions has the name of the function as
the first item on a new line - this means you can find a definition
by using grep ^functionName. Fix the disconnected code to follow this
style.
Change-Id: I925039070f2bbbd97f04fbee006ea08df92d7cf5
Reviewed-on: http://gerrit.openafs.org/751
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Wed, 28 Oct 2009 11:12:18 +0000]
Make afsd.pod reflect reality
9d396c4916fdac64fcface30e6637ca6e2911203 (from 2005) introduced
autotuning for afsd, and changed some of the defaults which aren't
autotuned. Update the afsd man page to reflect the autotuning, and
the new defaults.
Change-Id: Iea2035743cb45cca1c249bc2e838405039ad7d3a
Reviewed-on: http://gerrit.openafs.org/744
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Wed, 28 Oct 2009 18:24:33 +0000]
Move PMTU header block to top of file
1206e7538be86f073b21cd289266286b60a95d0a added linux/errqueue.h to
rx_user.c, but added the include in the middle of a function - which
means that the new structure is out of scope for the rest of the file,
which breaks the build on Linux.
Put the header include at the start with all of its other friends.
Cc: Alf Wachsmann <alfw@slac.stanford.edu>
Change-Id: Id932ff63b59e6cd62eda3df4f01e4eef354736ca
Reviewed-on: http://gerrit.openafs.org/748
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Marc Dionne [Mon, 26 Oct 2009 22:23:00 +0000]
afs_buffer.c: fix uninitialized variable warning
Squash a warning about lt being potentially used uninitialized.
Change-Id: I41bfccfd1a0db925a4d728a217b154f45c28b112
Reviewed-on: http://gerrit.openafs.org/742
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Mon, 26 Oct 2009 19:52:48 +0000]
Use fewer #ifdefs for dynamic vcaches
When we're not in AFS_MAXVCOUNT_ENV, make afsd_dynamic_vcaches a
static 0, which allows the removal of a scattering of #ifdef's in
the middle of conditionals in afs_vcache.c, and generally improves
the code browsing experience.
Also, move the externs for this variable to afs.h, where they belong,
and fix related formatting.
Change-Id: I4d56ebae63fe1855ac80f8511b9fc76f7e5a326f
Reviewed-on: http://gerrit.openafs.org/741
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Mon, 26 Oct 2009 23:17:36 +0000]
Make cache bypass build again
Recent commits had left cache bypass somewhat behind, make it
build again.
Change-Id: I500372f4584f4d0d90f6ea9f98a9ac3fb05f5185
Reviewed-on: http://gerrit.openafs.org/743
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Mon, 26 Oct 2009 18:52:52 +0000]
Remove hardcoded maximum time
When iterating across the buffer list, afs_newslot used a hardcoded
maximum time to find the oldest. Instead of using this, just use the
accesstime of the first unused buffer that we find as the oldest, and
continue as normal.
Change-Id: Ifeacb8a407901b46a23fbc838b1fca761108ebbb
Reviewed-on: http://gerrit.openafs.org/738
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Mon, 26 Oct 2009 19:36:53 +0000]
Fix dynamic vcache / rxmaxmtu cmd id collision
Both dynamic vcaches and rxmaxmtu had been committed as using the
35th command entry. Fix this according to the order they are in
the command list (35 and 36, respectively). Tidy up the command list
so it's easier to read, and remove the #ifdef notdef entry from it,
as adding it back in would just cause chaos.
Change-Id: I3fce403aa0ab01c42f0e1a48ae401503b0e21c24
Reviewed-on: http://gerrit.openafs.org/740
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Mon, 26 Oct 2009 17:06:20 +0000]
Fix locking in afs_buffer.c
Back in 2002,
0eb68f307aac84472a13523a0ce8b7a865f01ac7 was committed
to fix locking problems in dir/buffer.c.
Sadly, similar changes were never made to afs/afs_buffer.c, so the
same problems remain in the cache manager.
The issue here is with two processes racing in afs_newslot. Calls to
afs_newslot protect buffers with a zero reference count using
afs_bufferLock. If we release afs_bufferLock, before we increase the
reference count of the vcache, then we can end up with newslot
picking the same buffer for two different purposes.
The GLOCK actually protects us from the worst of this, but this fix
is necessary both for correctness, and for symmetry with the file
server buffer code.
Change-Id: I7f1c7d6571559c5f1784926c39d4889b77677231
Reviewed-on: http://gerrit.openafs.org/737
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Mon, 26 Oct 2009 19:46:09 +0000]
Remove pininodes
The pininodes option has been commented out of afsd since the
original OpenAFS commit. Enabling it now would cause chaos, due to
the way that cmd orders its arguments. Just remove the sections
of code to avoid this danger.
Change-Id: I9e9944d4470fd21d2ec9e36e17771b499d7c8e0b
Reviewed-on: http://gerrit.openafs.org/739
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Mon, 26 Oct 2009 19:04:48 +0000]
Dec old special inodes in inode convertROtoRW
The convertROtoRW code for the inode fileserver makes copies of the
volume's special inodes, but leaves the old (RO) inodes around. If the
RO is created again, this will result in duplicate special inodes for
the same volume, which freaks out the salvager (and possibly other
things).
So IH_DEC the old RO special inodes after converting, so they go away.
Change-Id: Ifefa2cb69c5b2960b81dbee9d54e5ea8401b240e
Reviewed-on: http://gerrit.openafs.org/735
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
matt@linuxbox.com [Mon, 3 Aug 2009 16:36:25 +0000]
viced (non atomic) refcount/more-threads
Replace host-hold bitmap with reference counting, phase 1, not atomic.
Increase viced MAX_THREADS.
NOTE: This code has been tested on Centos 5.3 x86_64, on VMWare, 2 physical,
2 logical CPUs.
LICENSE BSD
Change-Id: Id62dcc786619dfd99e1a7b69a196bbaa0b45158c
Change-Id: I8ee2ec645402f02fdba0920815409b56172d393b
Reviewed-on: http://gerrit.openafs.org/268
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Jeffrey Altman [Mon, 26 Oct 2009 14:13:00 +0000]
ubik_VL_GetAddrsU does not accept a VLCallBack parameter
ubik_VL_GetAddrU accepts a pointer to a uniqifier and not
a pointer to a VLCallBack structure. Remove an incorrect
cast and provide the correct parameter in src/volser/vos.c.
Change-Id: I4b12cf2d4c65f115fdef76f0a4306960b5cd0413
Reviewed-on: http://gerrit.openafs.org/733
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Fri, 23 Oct 2009 20:02:12 +0000]
Avoid 'salvageserver -client -showlog' segfault
Running salvageserver with the -client and -showlog options will
currently segfault, since -client does not open logFile, and -showlog
will attempt to rewind logFile on exit.
Fix this by not allowing -client and -showlog together (since it won't
work anyway, as -showlog tries to read SalvageLog), and by making
showlog() check logFile for NULL-ness.
Change-Id: I30f43ef1696f1e7e8873b9e1cc3867b4e06d1980
Reviewed-on: http://gerrit.openafs.org/734
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Jeffrey Altman [Mon, 17 Aug 2009 16:23:57 +0000]
Updates to Jake's RTT based server ranking (Gerrit 317)
Remove check on powerStateSuspend in cm_Daemon()
Update the server Reference lists if the ranking changes.
Change-Id: Id290e0f98c616a12f4f8b1746dca58ad7a0f06ce
Reviewed-on: http://gerrit.openafs.org/729
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jacob Thebault-Spieker <summatusmentis@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Jacob Thebault-Spieker [Wed, 12 Aug 2009 05:32:06 +0000]
Adds cm_RankUpServers() and cm_RankServer()
This adds the functions cm_RankUpServers() and cm_RankServer() to
the Windows cache manager. cm_RankUpServers() steps through the
list of servers, and calls cm_RankServer(), which in turn re-ranks
the servers that are currently up based on rx peer statistics as
exposed by rx_GetLocalPeers().
cm_RankUpServers() is called every 10 minutes by the cache manager
daemon, so as to allow re-ranking of the servers.
Also added is the struct server->adminRank data structure, to
allow for the modification of the rank that the admin has set,
without but basing this modification on the admin-set rank.
Change-Id: I118b885e179e4f84901dd9a3180ce821f194feb8
Reviewed-on: http://gerrit.openafs.org/317
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Simon Wilkinson [Mon, 26 Oct 2009 12:49:11 +0000]
Clean up console message
Clean up the 'all buffers locked' console message so that it's
clear that it comes from AFS, and so it has a trailing newline.
From a bug report by Rainer Toebbicke to openafs-info
Change-Id: I3f69e57e37a91ae3e6e8822ccfe72dddc06b4359
Reviewed-on: http://gerrit.openafs.org/732
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Fri, 23 Oct 2009 15:34:33 +0000]
Don't return AOP_WRITEPAGE_ACTIVATE to write()
When we're called from write(), we don't have the option
of deferring the writing of a page by returning AOP_WRITEPAGE_ACTIVATE.
Instead, write() simply sees this as the output of 0x8000 bytes of data.
So, whilst we can mark a vcache as being output, we can't defer the
processing of one which is already being written (by, for example, an
earlier writepage()).
This problem only affects files which are have mmap() and write()
called in quick succession, but it does break the fsx utility.
Change-Id: I750a186de38da9873665a862f5b584a78e6979ad
Reviewed-on: http://gerrit.openafs.org/725
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Sat, 24 Oct 2009 09:54:32 +0000]
Use user credentials for Linux writepage()
We have no control over the context in which the kernel calls our
writepage routine. It may be from the process which original wrote the
page, from any other process on the system which is writing and goes
over the dirty page threshold, or from the flush thread (pdflush /
flush-afs). Therefore, we cannot use the credentials of the current
process to perform the writeback. This is an issue both for afs_write
(which, in our current MM model, may need to contact the fileserver
to read missing chunks), and for DoPartialWrite (which needs to be
able to store chunks when the local cache is getting full)
This patch stores the credentials of the first process to open a file in
the vcache structure. Whenever writepage() is used to writeback pages
for this file, the cached credentials are used rather than those of the
current context.
Thanks to Marc Dionne for his work in testing and refining this patch.
FIXES 125471
Change-Id: I2900f711150fd81b2b4839bbc2bf77623bde3b64
Reviewed-on: http://gerrit.openafs.org/724
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Derrick Brashear [Fri, 23 Oct 2009 21:50:09 +0000]
windows 1.5.66
make 1.5.66 for windows
Change-Id: I04902106c35eea2dccf6db594c496302cde3f15b
Reviewed-on: http://gerrit.openafs.org/723
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Derrick Brashear [Fri, 23 Oct 2009 21:35:37 +0000]
make 1.5.66 for unix
push version changes for 1.5.66
Change-Id: I5302e9aa83b4aba0081130934f0d6df0786ce43c
Reviewed-on: http://gerrit.openafs.org/722
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Michael Meffie [Thu, 22 Oct 2009 19:51:33 +0000]
volser transaction object race conditions
Fix the transaction object races between VolMonitor and the
volume operation procedures which can cause the volume
server to crash.
Add a per transaction object mutex to safely set the
transaction call pointer and name. Fix VolMonitor to safely
traverse the transaction list and to access the call pointer
and last proc name while copying info to send to the vos
client. Fix the sleep thread to safely access the last proc
name.
FIXES 125479
Change-Id: I59595b93522d111b6a771d3d93c246bfc2ce65de
Reviewed-on: http://gerrit.openafs.org/718
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>
Andrew Deason [Thu, 22 Oct 2009 16:12:30 +0000]
Avoid prematurely destroying callback_rxcon
Currently, h_GetHost_r and removeAddress_r can destroy the
callback_rxcon of a host. Having a NULL callback_rxcon can cause
segfaults in code that does not properly check if a host has been
HOSTDELETED before trying to use it.
Although such code is incorrect and should be fixed, we can still avoid
a segfault in those situations by not destroying callback_rxcon until we
destroy the host itself. This just prevents destroying callback_rxcon in
h_GetHost_r and removeAddress_r, leaving it to h_TossStuff_r to destroy
when it destroys the host.
Change-Id: I6fd5cbb924053446689c576026f9044f78ba71be
Reviewed-on: http://gerrit.openafs.org/717
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Fri, 23 Oct 2009 11:42:19 +0000]
Resolve error return issues in writepage
The writepage_sync changes get error returns wrong in a couple of places. In
particular, they return a 0 code from dopartialwrite in preference to the
length return from page_writeback
Change-Id: I34a848fed5f799aa6844e9ef0339321f91c7e59b
Reviewed-on: http://gerrit.openafs.org/721
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Jeffrey Altman [Thu, 22 Oct 2009 14:38:23 +0000]
Remove warning from all calls to afsconf_GetExtendedCellInfo
Fix 'afsconf_GetExtendedCellInfo' : different types for formal
and actual parameter 5
Change-Id: I922d653a88a9d0c04ed6dbd1c9c0b3fc90719337
Reviewed-on: http://gerrit.openafs.org/715
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 [Fri, 23 Oct 2009 07:16:01 +0000]
Windows: Notes for 1.5.66
ChangeLog description for 1.5.66 on Windows.
Reviewed-on: http://gerrit.openafs.org/720
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Jeffrey Altman [Fri, 23 Oct 2009 07:04:52 +0000]
Windows: Updates to Release Notes
Add support for Windows 7 and Server 2008 R2.
Improve text in a variety of areas.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/719
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Simon Wilkinson [Tue, 20 Oct 2009 11:38:53 +0000]
Refactor writepage_sync
This change refactors writepage_sync into 4 functions -
*) prepare_writeback() readies a vnode for writeback, and performs
the anti-recursion check.
*) dopartialwrite() intialises a request and performs the call to
DoPartialWrite
*) page_writeback() does the actual work of writing an AFS page into
the disk cache page
*) complete_writeback clears the writeback flag from a vnode
There should be no change to the current behaviour of writepage_sync,
these modifications are the first part of a fix to our writepage()
behaviour.
Reviewed-on: http://gerrit.openafs.org/712
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Jeffrey Altman [Thu, 22 Oct 2009 14:27:41 +0000]
Windows: no longer use WinExec in afscreds
WinExec is a compatibility interface for 16-bit applications.
It is not compatible with Windows 7. Replace it with ShellExecuteEx.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/714
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Derrick Brashear [Wed, 21 Oct 2009 18:42:23 +0000]
pthread pid casting
in rx, we use pthread_self (which can return a pointer) as a pid;
in order to not cause problems, cast it as we do elsewhere
Reviewed-on: http://gerrit.openafs.org/703
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Jeffrey Altman [Thu, 22 Oct 2009 14:10:12 +0000]
rx lwp include assert.h where AFS_NT40_ENV builds can see it
Reviewed-on: http://gerrit.openafs.org/713
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Jeffrey Altman [Thu, 22 Oct 2009 12:57:04 +0000]
Windows: Update Control Panel to use ShellExecuteEx instead of WinExec
WinExec is for 16-bit application compatibility. Starting with
Windows 7 it cannot be used to execute a process that requires
elevated privileges. ShellExecute[Ex] must be used instead.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/711
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Derrick Brashear [Thu, 22 Oct 2009 12:07:43 +0000]
remove spurious log in icl
fstrace should not log sets to the kernel message log
Reviewed-on: http://gerrit.openafs.org/710
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Wed, 21 Oct 2009 23:34:50 +0000]
Add -Wpointer-arith to warning and checking builds
GCC doesn't catch issues with performing pointer arithmetic on
(void *)s, unless the -Wpointer-arith warning flags is supplied.
Enable it for warning and checking builds.
Reviewed-on: http://gerrit.openafs.org/708
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Derrick Brashear [Wed, 21 Oct 2009 18:43:26 +0000]
rx don't exit
exiting in library code is antisocial. if rx encounters an error
which cannot be returned and would otherwise indicate a service thread
has gone away, assert.
Reviewed-on: http://gerrit.openafs.org/668
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Simon Wilkinson [Wed, 21 Oct 2009 23:31:10 +0000]
Fix fall out from removal of memset casts
In places where we're doing pointer arithmetic, we must cast to (char
*), because pointer arithmetic on a void * isn't permitted by the C
standard. Sadly gcc lets us get away with it 'for convenience'.
Reinstate the necessary casts.
Reviewed-on: http://gerrit.openafs.org/707
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Jeffrey Altman [Wed, 21 Oct 2009 22:51:09 +0000]
Windows: Update MSI installer properties
Reference useful web pages such as docs.openafs.org for help,
www.openafs.org/windows.html for upgrade info, etc.
Reviewed-on: http://gerrit.openafs.org/706
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Jeffrey Altman [Wed, 21 Oct 2009 22:41:59 +0000]
Windows: ports in the cache manager are stored in network byte order
When assigning ports from SRV/AFSDB lookups, convert to network
byte order when assigning them to cm_server objects.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/705
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Asanka Herath [Wed, 21 Oct 2009 19:56:12 +0000]
Windows: Set the ARPINSTALLLOCATION property when installing
The WiX based Windows Installer package for OpenAFS should set
the ARPINSTALLLOCATION property when installing. This property
contains the main installation directory for the product and is
necessary for Windows Logo compliance.
Reviewed-on: http://gerrit.openafs.org/704
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Simon Wilkinson [Wed, 21 Oct 2009 16:34:30 +0000]
Don't cast the pointer past to memset
memset() takes a void * as it's first argument. Don't explicitly cast
what we're passing in to (char *), as this may mask other errors.
Reviewed-on: http://gerrit.openafs.org/701
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
matt@linuxbox.com [Mon, 12 Oct 2009 00:52:26 +0000]
Make typedefs of AFS_UCRED and AFS_PROC with renaming
Make typedefs of AFS_UCRED and AFS_PROC, with a corresponding name change.
The names afs_ucred_t and afs_proc_t are chosen since these appear to be
the best available choices. The names cannot actually collide with anything
which POSIX might later introduce. For UKERNEL, the preprocessor is used
to redirect references. This seems not easily avoidable at present.
LICENSE BSD
Reviewed-on: http://gerrit.openafs.org/645
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Tue, 20 Oct 2009 17:43:42 +0000]
HPUX: Do not sigwait on critical signals
On HPUX, it is possible for 'critical' signals such as SEGV, ABRT, etc
to be delivered to the softsig thread when we sigwait(). The current
code marks these as 'fatal' and just exit(0)s when they are received,
preventing us from getting cores in the case of a SEGV, ABRT, etc.
To work around this and keep behavior on other platforms the same, just
do not wait on 'critical' signals on HPUX in the softsig thread.
Reviewed-on: http://gerrit.openafs.org/693
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Jeffrey Altman [Wed, 21 Oct 2009 13:14:51 +0000]
Windows: Add registry entries for rx_SetMinPeerTimeout, rx_SetMaxRecvWindow, rx_SetMaxSendWindow
Permit the new rx settings to be configured via the registry and
set at startup.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/700
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Jeffrey Altman [Wed, 21 Oct 2009 13:13:22 +0000]
Add rx_SetMinPeerTimeout and rx_GetMinPeerTimeout
Permit the minimum peer timeout value to be adjusted at runtime.
The default remains 350ms.
LICENSE BSD
Reviewed-on: http://gerrit.openafs.org/699
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Tue, 20 Oct 2009 14:30:33 +0000]
Use real names for page lock operations
Call a spade a spade. Don't use macros to rename lock_page as LockPage,
and unlock_page as UnlockPage. Instead use the same names as the kernel,
which makes it a lot easier for people familiar with kernel code to read
ours.
Reviewed-on: http://gerrit.openafs.org/692
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Jeffrey Altman [Thu, 15 Oct 2009 03:43:46 +0000]
Windows: Modify afscreds.exe and afs_config.exe to be UAC compatible
afscreds.exe:
1. disable the drive mapping and advanced tabs.
2. on exit, remove the option to stop the service.
afs_config.exe:
1. disable the drive mapping tab
Removing this functionality by default will address some of the
problems while permitting users that wish to continue using these tools
to do so. The drive mapping tab can be re-enabled setting the registry
value to be non-zero:
{HKCU,HKLM}\Software\OpenAFS\Client DWORD "ShowMountTab"
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/663
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Jeffrey Altman [Wed, 21 Oct 2009 13:02:04 +0000]
Windows: Do not permit infinite attempts to obtain a pioctl file handle
The recent change to detect sharing violations and initiate retries
permits infinite attempts. Change this to a limit of 100 attempts
and increase the sleep period between attempts from 1ms to 100ms.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/697
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Jeffrey Altman [Wed, 21 Oct 2009 13:07:47 +0000]
Windows: digital signatures are required for resource dlls
Windows 7 logo requirements state that all dlls including
resource only dlls be digitally signed.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/698
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Jeffrey Altman [Thu, 15 Oct 2009 02:06:38 +0000]
Windows: Adjust error return values
Do not return STATUS_TIMEOUT to the smb redirector, doing so
results in an undesireable disconnect.
Map RXKADNOAUTH to STATUS_CLOCK_SKEW as that is the most
frequent cause of rx level authorization failures.
Map CM_ERROR_UNKNOWN to access denied since there is no
better error choice.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/661
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Derrick Brashear [Tue, 29 Sep 2009 09:34:30 +0000]
rx window size increase
window size was previously pushed to 64; push to 128. as this increases memory
use, anything further should be arguably tied to rx-using-program's
resource allocation preferences, e.g. fileserver -LL should be willing to
up this
Reviewed-on: http://gerrit.openafs.org/549
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Derrick Brashear [Tue, 20 Oct 2009 19:03:09 +0000]
afscp warnings cleanup
make the copy of afscp in src/tests compile with fewer warnings
(and provide needed prototype for RXAFSCB_ExecuteRequest)
Reviewed-on: http://gerrit.openafs.org/694
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Jeffrey Altman [Tue, 20 Oct 2009 20:16:47 +0000]
prevent rx peer timeout from reaching 0.0 seconds
The rx peer timeout is computed from the round trip time
calculation. It traditionally has had a lowerbound of 350ms.
The computation in rxi_ComputeRoundTripTime() was incorrect
and instead used 350ms as an upperbound.
rxi_ComputeRoundTripTime() had a second problem wherein if
the actually RTT is shorter than the resolution of the clock
then the RTT would quickly approach 0.0 seconds. Enforce
a lowerbound of 1ms if the RTT for a given packet appears
to be 0.0 seconds.
LICENSE BSD
Reviewed-on: http://gerrit.openafs.org/696
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Jeffrey Altman [Tue, 20 Oct 2009 19:08:51 +0000]
Rx warning removal
This patch set removes many but not all of the warnings
in the rx library.
- use AFS_PTR_FMT in dpf debugging output
- fix many signed vs unsigned warnings
- on Windows, the first parameter to select() is ignored.
Passing an osi_socket produces an unnecessary warning.
- In rx_SlowReadPacket and rx_SlowWritePacket, use 'r' the
unsigned value for internal computation and 'resid' for
holding the original value. This avoids many signed vs
unsigned warnings.
LICENSE BSD
Reviewed-on: http://gerrit.openafs.org/695
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Jeffrey Altman [Tue, 20 Oct 2009 16:32:22 +0000]
Windows: AFS_PTR_FMT is just 'p'
The printf format specification for a pointer of any size is
just 'p'. The 'I' is only to be used for [duox].
Reviewed-on: http://gerrit.openafs.org/690
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Andrew Deason [Mon, 19 Oct 2009 03:48:56 +0000]
Avoid 'static __inline' on HPUX
'static __inline' functions on HPUX can segfault the /opt/ansic compiler
(unless we lose debugging symbols). So, just use 'static' for those
functions on HPUX. Also revert
a9368a6c3dfe4435ec2ae63fff4a3325104ed9f7,
so we get a static inline function on other platforms.
Reviewed-on: http://gerrit.openafs.org/691
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Tue, 20 Oct 2009 12:38:08 +0000]
Remove pageoff macro
The pageoff macro is now unused. Remove it.
Reviewed-on: http://gerrit.openafs.org/689
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Jeffrey Altman [Mon, 19 Oct 2009 22:43:44 +0000]
Add server prefix to bumon.xg; avoid rx_call * vs rx_connection * warning
When compiling src/bubasics/bumon.ss.c a warning would be produced
due to an rx_call* being passed into BC_Print which in its client
form requires an rx_connection*. The server implementation and client
stub each were called BC_Print because there was no server prefix
specified in bumon.xg. Add prefix 'S' and update bucoord/server.c
to match.
Reviewed-on: http://gerrit.openafs.org/686
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Mon, 19 Oct 2009 22:56:12 +0000]
Return both error codes for rxfs_fetchInit
The FetchStore refactoring was causing the result from rx_EndCall to
be discarded. This change will cause that to be returned to the caller
if rx_Error() returns 0
Reviewed-on: http://gerrit.openafs.org/687
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Fri, 16 Oct 2009 15:39:24 +0000]
Always unlock pages when returning from writepage
Writepage has a return path which returns an error with a locked
page. However, all returns that are not AOP_WRITEPAGE_ACTIVATE must
unlock their pages - using this codepath would leave a stray page lock,
which would eventually hang the machine.
The logic behind the -EIO return was also incorrect. In the Linux page
cache model, truncates simply reduce the size recorded in the inode. If
there are pages pending writeback then they may still have writepage() called
upon them - it's up to the writepage routine to discard the write
request (rather than returning an error)
Reviewed-on: http://gerrit.openafs.org/685
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Thu, 15 Oct 2009 18:15:44 +0000]
Fix a couple more unlink()s in vol-salvage.c
There are a couple more unlink() calls in vol-salvage.c that were using
relative paths. Fix them to use absolute paths and to log a warning if
the unlink() fails.
Reviewed-on: http://gerrit.openafs.org/684
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Asanka Herath [Mon, 19 Oct 2009 21:12:32 +0000]
Windows: Add a token status icon to the NIM plug-in
The Network Identity Manager plug-in for OpenAFS replaces
afscreds.exe for token management. However, unlike afscreds.exe,
the plug-in did not indicate the status of AFS tokens using an
icon in the notification area.
This patch adds a token status icon to the plug-in so that while
the plug-in is used, a familiar padlock icon in the notification
area will indicate the status of tokens as well as the OpenAFS
service.
There are four possible states indicated by the icons:
- No tokens: indicated by a padlock with a bright red 'X' beside
it.
- At least one valid token: indicated by a normal padlock.
- Service is not running: indicated by a grayed out padlock with
a black square beside it.
- Service error: indicated by a padlock broken in half.
The 'Service error' state means that the OpenAFS client service
is technically running (as reported by Windows), but is not
responding to requests.
In addition to the icon, hovering the mouse cursor over the icon
will show details about the current state (such as the list of
cells for which valid tokens exist) and the version of OpenAFS
running on the machine.
Reviewed-on: http://gerrit.openafs.org/683
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Claudio Bisegni [Mon, 19 Oct 2009 15:34:09 +0000]
AFSPreference Pane Mounts View refresh issue
Resolved the bug that prevented to show the link description after it was added.
Now the table is refreshed at any operation(add/remove).
Reviewed-on: http://gerrit.openafs.org/682
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Claudio Bisegni [Sun, 18 Oct 2009 18:39:21 +0000]
OpenAFS Preference Pane 64bit and Symbolic Link features implemented.
Now the OpenAFS preference pane is compiled with 32 and 64 bit snowleopard support, so the preference
windows is no more restarted in 32 bit mode.
The tab for symbolic link creation has been implemented. Now the user can create and delete link.
For create a link both name and destination path must be set. AFSBackgrounder has been updated to
manager in a separate thread the link creation and destroy operation, according to the vaule of
checkbox "Enable Symbolic Link" in "Mounts" tab.
Reviewed-on: http://gerrit.openafs.org/677
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Mon, 19 Oct 2009 02:05:58 +0000]
Prototype encode_krb5_enc_tkt_part for aklog
Prototype encode_krb5_enc_tkt_part in aklog_main.c, since it is a
private interface so we don't get a prototype from the krb5 headers.
Reviewed-on: http://gerrit.openafs.org/680
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Mon, 19 Oct 2009 03:20:59 +0000]
Fix format warnings in tviced/state_analyzer.c
state_analyzer.c assumes subtracting two char*s will result in an
unsigned int, which can cause warnings. Lacking a portable format
specifier, just use %ld and cast to long.
Reviewed-on: http://gerrit.openafs.org/681
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Mon, 19 Oct 2009 01:46:27 +0000]
Fix a couple of size_t warnings
fsprobe/fsprobe.c and kauth/ka-forwarder.c were trying to print size_t's
without using AFS_SIZET_FMT. Fix that.
Reviewed-on: http://gerrit.openafs.org/678
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Mon, 19 Oct 2009 01:47:43 +0000]
Prototype ka_log
Prototype ka_log in kauth/kalog.h to prevent warnings. While we're at
it, only prototype kalog_log and kalog_Init when they actually get
implemented.
Reviewed-on: http://gerrit.openafs.org/679
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Sun, 18 Oct 2009 11:07:37 +0000]
Fix warnings in tviced
Prototype hpr_Initialize and hpr_End to remove warnings in the tviced
build.
Reviewed-on: http://gerrit.openafs.org/675
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Fri, 16 Oct 2009 19:30:34 +0000]
Log error messages in volser i/o errors
Currently, in various places in src/volser/, we log/print an error
message when some disk i/o error occurs, but we don't log what error was
returned. Log that little bit more info to make debugging easier in some
cases.
Reviewed-on: http://gerrit.openafs.org/671
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Fri, 16 Oct 2009 22:15:52 +0000]
More warning fixes for kauth
Resolve more minor warnings from the kauth directory.
*) kaux_read takes an unsigned for the number of failures
*) The COUNT_REQ macro generates an unused variable (this_op)
*) kas is missing some headers
*) Add some more prototypes to kauth_internal.h
*) Add the standard boilerplate to kauth_internal.h
*) recvfrom takes a socklen_t * as its 6th argument
This make kaprocs.c, kaauxdb.c, kas.c, klog.c, and ka-forwarder.c
warning clean. Mark them as such.
Reviewed-on: http://gerrit.openafs.org/673
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Fri, 16 Oct 2009 21:45:50 +0000]
Update warning management
This change tidies up after the recent slew of warning reduction. It
updates README.WARNINGS to reflect the current state of the tree,
disables warnings for a couple of files that are now warning clean,
and ensures that the libuafs and libafsrpc Makefiles match the state
of the rest of the tree in terms of which warnings are enabled.
Reviewed-on: http://gerrit.openafs.org/672
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Sun, 18 Oct 2009 11:44:56 +0000]
Use ranlib -c for Mac OS X Leopard
Building with --enable-demand-attach-fs requires that ranlib -c be
used on Leopard (it is already the default for Tiger)
Reviewed-on: http://gerrit.openafs.org/676
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Sat, 17 Oct 2009 07:49:03 +0000]
afs_Conn must be called within the analyze loop
afs_Analyze calls afs_PutConn, so each pass through the
afs_Analyze loop must call afs_Conn to get a new connection handle.
afs_CacheStoreVCache (part of the fetchstore refactoring) wasn't doing
this, and so producing garbage data upon retries.
Reviewed-on: http://gerrit.openafs.org/674
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Jeffrey Altman [Fri, 16 Oct 2009 19:28:04 +0000]
Windows: Always compute time remaining in cm_Analyze
In cm_Analyze, the time remaining for processing the request
is used to determine if a retry should requested upon return.
If the request's CM_REQ_NORETRY flag is set, cm_Analyze can
still permit a retry if a new rx connection is to be forced.
This cannot happen if the time remaining is not calculated
when the CM_REQ_NORETRY flag is set.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/670
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Jeffrey Altman [Fri, 16 Oct 2009 19:31:02 +0000]
Windows: mark volume status online during cm_MergeStatus
During cm_MergeStatus, if the volume status is not vl_online
mark it vl_online. The volume must be online because an
AFSFetchStatus was just processed. This change reduces the
amount of work that must be performed by the daemon thread's
volume status check.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/669
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Marc Dionne [Fri, 9 Oct 2009 01:53:03 +0000]
Linux: kmem_cache_create fix and cleanup
Fix the kmem_cache constructor function to match the current
expected prototype, and cleanup related code. This has been wrong
for a while, but since we were just passing extra parameters the
only effect was to generate a warning.
- Add a new configure test to detect the new constructor function
signature
- Define the older versions of the constructor in osi_compat.h,
making them call the current version
- Move a few compatibility #defines to osi_compat.h
Reviewed-on: http://gerrit.openafs.org/657
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Thu, 15 Oct 2009 17:48:08 +0000]
Fix rxgen-generated warnings
Prevent rxgen from generating code that produces warnings at compile
time.
* Add print_ifarg_with_cast(). Used within print_ifstat() to generate
a member in an argument list complete with a type cast. The type
cast may be a pointer to the type or the type depending on the value
of the 'ptr_to' parameter.
* When print_ifstat() generates the output for an opaque vector, cast
the object to 'caddr_t' as xdr_opaque() accepts an argument of type
'caddr_t'.
* When print_ifstat() generates the output for an opaque array, cast
the object to 'char **' because xdr_bytes() accepts an argument of
type 'char **'.
* When print_ifstat() generates the output for any array that is not
opaque or string, cast the object to 'caddr_t' because all of the
xdr_XXX() functions other than xdr_opaque and xdr_bytes accept an
argument of type 'caddr_t'.
* When print_ifstat() generates the output for an alias, cast the
output to a pointer to the specified type because xdr_<type> accepts
an argument of type '<type> *'.
This addresses warnings generated when compiling fsint/Kvice.xdr.c and
fsint/afsint.xdr.c.
Reviewed-on: http://gerrit.openafs.org/664
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Derrick Brashear [Fri, 16 Oct 2009 14:44:58 +0000]
exit less
start cleanup of calls to exit scatter into library code. ugen_ callers handle
error returns correctly; rmtsys already deals with errors; and rx_pthread can
already deal with errors in the case that's fixed
Reviewed-on: http://gerrit.openafs.org/667
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Derrick Brashear [Thu, 15 Oct 2009 23:21:54 +0000]
snowleopard 64 bit warning death
make all errors from warnings when compiling on snowleopard die
as a note, the ukernel pid, and pthread self as id changes, probably
should be revisited, but for now i have changed nothing. it should
be a separate change.
Reviewed-on: http://gerrit.openafs.org/666
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Mon, 12 Oct 2009 02:55:05 +0000]
Detect and use %zu for size_t when available
Commit
db949b7fade69d7eb1e38ad85d5b822c443306cb was incorrect and
generated warnings on many platforms; we cannot determine the correct
format string for a size_t at compile-time. Instead use the %z length
modifier when we can detect that it is safe to use. Otherwise, fall back
to just %lu on Unix, since it is reasonable to assume
sizeof(size_t) == sizeof(unsigned long) on Unix.
Reviewed-on: http://gerrit.openafs.org/647
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Thu, 15 Oct 2009 03:43:27 +0000]
Fix unitialized variable warning in cfghost.c
Initialize cellentry. It does not appear to be possible to actually hit
code that references an uninitialized cellentry, but the compiler can
still complain.
Reviewed-on: http://gerrit.openafs.org/665
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Jeffrey Altman [Wed, 14 Oct 2009 03:36:26 +0000]
Windows: AFSVolSync creationDate based readonly volume versioning
Implement readonly volume versioning based upon the .readonly
volume creation date as reported in the AFSVolSync output
parameter of every RXAFS RPC.
Whenever a new callback is obtained for an object stored within
a .readonly volume, the volume creation date is recorded in the
cm_volume object along with the callback expiration time and
a reference to the server that issued it. These values are
used to determine if a callback is present when the cm_scache
object's volume creation date matches the cm_volume object's
volume creation date. If there is no match, the cm_scache
object's individual callback information is used to determine
whether a callback has been registered.
This mechansism ensures that the whole-volume callback issued
in response to a RXAFS_FetchStatus request against a .readonly
volume can be applied to all objects that are cached from the
same version of the .readonly volume instance.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/654
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>