7089 Commits

Author SHA1 Message Date
Marc Dionne
71b3dd155c Fix #ifdef typo
Fix ifdef typo.  The compiler complains that the variable
is undefined.  Not sure what effect this may have had on
the intended preprocessor output.

Change-Id: Idef3f4ac42a96a096be25d31ff416f7a23560d70
Reviewed-on: http://gerrit.openafs.org/1635
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 15:04:01 -07:00
Marc Dionne
b835b48737 Define __USE_XOPEN conditionally
Only define __USE_XOPEN if not already defined.
In this part of the code it might now already be defined since
we enabled AC_USE_SYSTEM_EXTENSIONS.

Change-Id: I0651658d82550ee9be593d281bf50205815f9ef7
Reviewed-on: http://gerrit.openafs.org/1634
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 14:47:20 -07:00
Asanka Herath
b0a3d581a6 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.

Change-Id: I7822141aab1e12cc8e151be771f779284fa68465
Reviewed-on: http://gerrit.openafs.org/1602
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-03-23 14:31:10 -07:00
Derrick Brashear
afa12e265d remove vnop needs discon lock
right now, the discon lock never happens over a remove.
fix that. restructure the code to allow one unlock and exit.

Change-Id: I88fefa30c9ba8ad4a4ccce1a5b02e9fb8403b99d
Reviewed-on: http://gerrit.openafs.org/1629
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 14:17:42 -07:00
Claudio Bisegni
464b99b8ff 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

Change-Id: Ica4b705018722488613ac09586e60c69303d1076
Change-Id: I79ce1334d99f926544e865fbb563a1ffecaa969c
Reviewed-on: http://gerrit.openafs.org/1606
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 14:13:27 -07:00
Derrick Brashear
6f52f9493a kill MultiBreakVolumeCallBack too
this is also now unused. kill it.

Change-Id: Ie2f3edef4dc74ee874eb5aedaf2c0d2ee548ae6d
Reviewed-on: http://gerrit.openafs.org/1631
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 13:56:39 -07:00
Andrew Deason
368e07f736 Remove BreakVolumeCallBacks prototype
BreakVolumeCallBacks was a dead function that was removed from viced.
Remove the prototype for it.

Change-Id: I12a4d69719163d3e7be7dcae6f39df17b245c807
Reviewed-on: http://gerrit.openafs.org/1628
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 13:13:22 -07:00
Andrew Deason
6448d4edc8 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.

Change-Id: I332fe83b45b2b595e091c8eb9bdc57d89d5e36a8
Reviewed-on: http://gerrit.openafs.org/1550
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 12:28:35 -07:00
Russ Allbery
189a99e894 vldb_check man page should say -vheader, not -pheader
The option was given correctly in SYNOPSIS but not in the OPTIONS section.
Thanks, Rod Widdowson.

FIXES 126771

Change-Id: Ibd9694c066b6750ad04273c22e66c84fb7b4a1c6
Reviewed-on: http://gerrit.openafs.org/1589
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 12:27:59 -07:00
Derrick Brashear
51362aba7b make tryevalfakestat really not block
turns out this VerifyVCache can end up hitting other lockers. move it out
of the try path.

Change-Id: I073318a44b4da519413905b677fd439f1edd6c54
Reviewed-on: http://gerrit.openafs.org/1547
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 12:23:29 -07:00
Derrick Brashear
4d1bc8e998 viced remove dead BreakVolumeCallBacks function
this is no longer used. trash it.

Change-Id: I0ad5aa203924c6a16afd68bc8ef55663951917c3
Reviewed-on: http://gerrit.openafs.org/1315
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 12:20:39 -07:00
Andrew Deason
9af8d46e77 vos: Avoid LWP stack overflow error on SIGINT
vsproc's method of longjmp'ing out of a signal handler can thoroughly
confuse LWP. At the very least, the information on our stack becomes
incorrect, since we're no longer using the stack supplied by LWP. At the
very least, we seem to (almost) always fail the sanity check checking
for stack overflow. To prevent the test from happening, NULL the stack
pointer before the longjmp so we can attempt recovery.

FIXES 33360

Change-Id: Ie910cb1cc8564ac119c3b751fd8295bf312a3ce7
Reviewed-on: http://gerrit.openafs.org/1559
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 12:14:29 -07:00
Andrew Deason
bf2d0db680 vos: Use IOMGR_SoftSig for signals
When vsprocs tries to longjmp from the signal handler, use IOMGR_SoftSig
first, so sleeping processes are woken back up. Without this, IOMGR can
bail out since it finds no processes READY when we attempt to do
anything with RX.

Change-Id: I9089bc4d003786d4a2205cd97f722fbf85fd1aa8
Reviewed-on: http://gerrit.openafs.org/1558
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 12:14:04 -07:00
Andrew Deason
fe3ff8e912 vos: Mark longjmp-used variables as 'volatile'
vsprocs tries to do error recovery by calling longjmp from a signal
handler. Although this is quite error-prone since we call a ton of
non-async-signal-safe functions, make it a bit more likely to work by
marking variables that are used after the longjmp as volatile. This
reduces how often (depending on the platform) these values will be
completely worthless after a longjmp since they were cached in a
register or similar.

FIXES 125535

Change-Id: I8566f8cffde6cfdffd99a11d637645494e0a0514
Reviewed-on: http://gerrit.openafs.org/1557
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-23 12:13:33 -07:00
Russ Allbery
f2db78a346 Fix strict aliasing problems or add -fno-strict-aliasing
Create a new CFLAGS_NOSTRICT Autoconf substitution variable which
is set to -fno-strict-aliasing if we're using gcc to compile.  Add
@CFLAGS_NOSTRICT@ to the C compiler flags for source files that have
significant strict-aliasing issues.

Fix minor strict-aliasing issues elsewhere in the tree by using memcpy
to copy the data into a properly typed variable.

Change-Id: I43afdb5e33e06cb249b7db385a65daf8d2133a19
Reviewed-on: http://gerrit.openafs.org/1617
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-22 20:48:14 -07:00
Andrew Deason
129b6954a6 Use AC_USE_SYSTEM_EXTENSIONS
Instead of defining various symbols like _XOPEN_SOURCE, _BSD_SOURCE, and
the like, just use autoconf's AC_USE_SYSTEM_EXTENSIONS to define all of
the appropriate symbols for us. Deal with some fallout by removing some
of the existing defines.

Change-Id: I1c1968c89cc2dfda1293fd2566dac8e266325a72
Reviewed-on: http://gerrit.openafs.org/1582
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-22 15:15:56 -07:00
Derrick Brashear
ac85550c90 aix mount failure unlock and seterror
set an error usefully and drop the vfs lock

Change-Id: I9d901b50722c09e1b131077f0b19e2831e6a44c8
Reviewed-on: http://gerrit.openafs.org/1590
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-22 15:08:27 -07:00
Derrick Brashear
42a3eaae93 update link order
librx needs libsys on irix to get afs_syscall
libsys needs librx for xdr_mumble for rmtsys

Change-Id: I2e4d9771807546c14f8b16b8805c222d79aab8c1
Reviewed-on: http://gerrit.openafs.org/1386
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-03-22 14:56:43 -07:00
Simon Wilkinson
7293ddf325 XDR: Stop the madness
We currently attempt to align our XDR implementation with what may
be provided by the host system. This leads to a huge amount of parameter
fudging, and general pain and misfortune. However, the only place that
we still actually use the system XDR is for UKERNEL builds.

Change this so that we use our XDR everywhere. Fix all of our type and
function definitions so that they're standard. Remove the warning
inhibitions.

Change-Id: I53f4539e50eacb4e0691d8d3d6546bbfb7438358
Reviewed-on: http://gerrit.openafs.org/1340
Reviewed-by: Chaz Chandler
Tested-by: Chaz Chandler
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
2010-03-22 14:54:43 -07:00
Russ Allbery
162cf1c51d Use sigset_t and sigfillset instead of memset
Rather than using an arbitrary array memset to ones as our signal
mask, use the POSIX sigfillset function and eliminate the static
variable.  Fixes strict aliasing errors with --enable-checking and
gcc 4.4.3 on Linux x86.

Change-Id: Ic3e0499d03657d94f60808ed12e090dc62cce6fc
Reviewed-on: http://gerrit.openafs.org/1616
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-22 14:47:32 -07:00
Russ Allbery
9dbe48ac2d Move non-executable stack assembly code to end of file
The non-executable stack annotation used for Linux works by adding
an additional section to the generated object.  The annotation added
in 9bfd03d723a9cf17673f40513a7adde1d503bcbc was added to the beginning
of each assembly file.  This caused build failures on Linux s390
because the remainder of the assembly code was then put in that
section, which was discarded during linking.

Add the annotation to the end of each assembly file instead, following
the instructions at:

    http://www.gentoo.org/proj/en/hardened/gnu-stack.xml

Change-Id: I5bd2d8d0ac31932b59757dcec0a942c459d61cac
Reviewed-on: http://gerrit.openafs.org/1615
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-03-22 14:37:06 -07:00
Derrick Brashear
393820794c multibreak callbacks add host marking
to deal with refcounts, we have to mark hosts in a way other than holds.
do so. all other h_Enum callers don't use this feature.

FIXES 126497

Change-Id: I0fc008495b93d2c361d476c7fcb6b355c0dab825
Change-Id: I61128261b2e8c64fafbf7425d6a65dd48fd7e177
Reviewed-on: http://gerrit.openafs.org/1599
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-22 11:42:59 -07:00
Derrick Brashear
a724dc31d8 salvage variable initialization
root vnode creation change caused a new warning i missed. fix it now,
set rootvnode to NULL

Change-Id: I06fe7a60f2fcc48c498249142220f65291188baa
Reviewed-on: http://gerrit.openafs.org/1610
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-21 10:54:31 -07:00
Derrick Brashear
38fd725920 aix vfs table entry in rc script
add an entry to the aix vfs table so umount works

Change-Id: I29a27ca350b948da0283ae09df0acd30eb6384c4
Reviewed-on: http://gerrit.openafs.org/1611
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-21 10:54:14 -07:00
Andrew Deason
32ebc44f42 Create missing root directory when ORPH_ATTACH
When we are salvaging with ORPH_ATTACH, orphans are normally attached to
a volume's root directory. If the volume is missing a root directory,
however, nothing is attached, and the volume can appear empty or
unusable.

So, to make it possible to get a useful volume out of a volume that lost
(only) its root directory, create a new root dir, and attach orphans to
that root.

FIXES 94658

Change-Id: I946a60485b5793952707f44ac369ee243e8dc076
Reviewed-on: http://gerrit.openafs.org/1235
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-21 10:10:29 -07:00
Derrick Brashear
88a40ffd3b comment assumptions in lih0_r
previously, we checked for  (!held && !h_OtherHolds_r(host))
now, we want to confirm only we hold it, so comment that that's how
this works

Change-Id: I98a65fbb4f2d0532054c71699dc2168e4592668b
Reviewed-on: http://gerrit.openafs.org/1598
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-21 10:10:16 -07:00
Derrick Brashear
c9761464e7 aix krb5 error message handling
handle krb5 error messages for aix in aklog and lam plugin

Change-Id: Iac96dc62e7889d375db111d5c96d86cf09715ab6
Reviewed-on: http://gerrit.openafs.org/1609
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-21 09:51:55 -07:00
Derrick Brashear
a68104340b panic prototype for aix 6
aix does need a prototype for the lame version of the function

Change-Id: I636b734bb725c425b2b4c6e4ae3e9473e087c21d
Reviewed-on: http://gerrit.openafs.org/1608
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-21 09:03:35 -07:00
Simon Wilkinson
c4537f0442 Don't count root session keyrings against quota
AFS PAM modules can call setpag() as root, regardless of the UID
being authenticated. This leads to the session keyring being created
using roots quota - on some systems (RHEL5) this quota is both small,
and of a fixed size.

Modify our keyring allocation code so that when a keyring is created
by root, we don't do any quota checks.

Change-Id: I2ee151ec1166a78475047bffd2c1d31f45e8dbdf
Reported-by: Rainer Toebbicke <rtb@pclella.cern.ch>
Reviewed-on: http://gerrit.openafs.org/1577
Tested-by: Rainer Toebbicke <rtb@pclella.cern.ch>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-03-21 09:02:59 -07:00
Derrick Brashear
e2134caed1 macos fsevents hinting
add support for faking it. no exported interface exists, sadly.
currently does only authentication events, and is best-effort only,
however for people who get tokens after viewing directories in finder,
this is a drastic improvement.

also adds needed setting to afssettings plist

FIXES 23781

Change-Id: I46d5a6cf103c30a2134decccc929e1ef85a26726
Reviewed-on: http://gerrit.openafs.org/451
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-19 18:46:05 -07:00
Jeffrey Altman
65dcd0a7da afsadminutil: translate krb5 error messages on Windows
util_AdminErrorCodeTranslate() is used to translate error
code messages within the libadmin library set and is used
by translate_et.  This has in the past not translated
krb5 error codes.

This patchset conditionally adds support for using
krb5_get_error_message() or error_message() on the Windows
platform if KFW is installed.  This is accomplished by
adding new functions to afsutil.lib:

  initialize_krb5()
  fetch_krb5_error_message()

which are used within util_AdminErrorCodeTranslate()
only if AFS_KRB5_ERROR_ENV is defined.

Support for Unix is not provided at the present time
because doing this "right" will lead to a dependence on
kerberos libraries from this library, which we might want
to avoid.

Change-Id: I7caf7b8e41cfd806f4defc175aa45afb165ec244
Reviewed-on: http://gerrit.openafs.org/1531
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-03-19 13:09:39 -07:00
Andrew Deason
7595adc20b volume_inline.h does not need sys/file.h
src/vol/volume_inline.h does not need sys/file.h; at one point, it was
using macros from sys/file.h for locking constants, but now we use the
lwp/lock.h constants. So, include that instead. Also, only include it
for DAFS, since we only use the constants in the DAFS case. Thanks,
Jeffrey Altman.

Change-Id: I114b438d7fb1fbb3a35bdfa0717ac334c7f80355
Reviewed-on: http://gerrit.openafs.org/1596
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-03-19 08:50:23 -07:00
Derrick Brashear
e55f39053a macos uninstall redux
the rest of the uninstall changes. git add, sigh

Change-Id: I69e4f4a870e08b1796b4546776e373f0a82e0e8e
Reviewed-on: http://gerrit.openafs.org/1594
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-18 22:15:24 -07:00
Derrick Brashear
9c39116015 update macos uninstaller
make the uninstaller cope with the new receipts format and location

FIXES 125634

Change-Id: I6cf0cd3e979a34115f391477657ec37f0c3d8faa
Reviewed-on: http://gerrit.openafs.org/1593
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-18 22:11:55 -07:00
Dan Hyde
105481d334 VOL_LOCK needed when traversing DiskPartitionList
VLockPartition sets VOL_LOCK, opens (perhaps creating) the lock file
for a partition, and flock's it.  VUnlockPartition, sets VOL_LOCK, and
closes the lock file fd.

VLockPartition is called from the salvager.  Nothing ever calls
VUnlockPartition.

VPFullUnlock is called every 30 seconds, does NOT set VOL_LOCK, and
happily closes any lock file fd it finds, breaking any lock set with
flock.

Other routines use the VOL_LOCK when traversing DiskPartitionList.

Change-Id: I683547f574b1f760e72014f5d44ce3987f07b5df
Reviewed-on: http://gerrit.openafs.org/1213
Reviewed-by: Dan Hyde <drh@umich.edu>
Tested-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-18 20:53:55 -07:00
Ben Kaduk
028240329c Catch up with FBSD80's removal of thread argument to VFS calls
FreeBSD SVN rev 191990 removed the thread argument to
filesystem-dependent VFS calls.  Curthread is always assumed.
There is a __FreeBSD_version bump that we could check if
we felt like being precise, but FBSD80_ENV is probably good enough.

Change-Id: I4534f01999b61eaeaa014c41473c693e6d432fef
Reviewed-on: http://gerrit.openafs.org/1587
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
2010-03-17 20:21:53 -07:00
Derrick Brashear
4bcd24e190 aix vnode hold simplification
instead of special-casing aix's AFS_FAST_xxx *and* calling
VREFCOUNT_INC for AIX, make it all consistent; side effect, remove
now-superfluous AIX ifdef'd code

Change-Id: Ic6a91429aad26e17fd9e12884ba0eba86564c377
Reviewed-on: http://gerrit.openafs.org/1572
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-17 20:04:18 -07:00
Derrick Brashear
46099b6d0b regain glock on storedata error exit
if we bomb out with EFBIG, we must regain the GLOCK before returing

Change-Id: I3aec92f90abd665d86dcf413dad0e9cbb251a0af
Reviewed-on: http://gerrit.openafs.org/1584
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-17 20:00:41 -07:00
Derrick Brashear
da68c39de1 kill apsl afssettings and fstab
replace both

afssettings with something patterned from webdav's (BSD-licensed)
mount program with general plist reading code. the lists of
valid oid objects of course have to be the same. eject old
darwins. add the new one.

fstab with something from freebsd umount

Change-Id: I28f6765475314b9b78102c762daec19cda4988c3
Reviewed-on: http://gerrit.openafs.org/1583
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-17 19:57:55 -07:00
Evan Broder
b772bd7e3c Increase the maximum number of sysnames
Change-Id: I8438ca19649730260370d8b00fb0157e808abe31
Reviewed-on: http://gerrit.openafs.org/778
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-17 17:30:25 -07:00
Andrew Deason
3cffaee790 DAFS: Replace partition locks with volume locks
In DAFS, replace uses of the VLockPartition_r partition-level locks with
the approprivate VLockVolume*NB volume-level locks (and sometimes
FSYNC_VerifyCheckout). This allows for greater parallelization of
volserver attachment / volume creation, for volume operations to occur
during salvages, and for multiple salvages on a single partition to
occur simultaneously.

More architectural details of volume-level locks can be found in the
changes to doc/arch/dafs-overview.txt.

Change-Id: I4e8ef4c864002d7e7c976691824c53dfa9cfaf91
Reviewed-on: http://gerrit.openafs.org/1406
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-17 10:29:31 -07:00
Andrew Deason
57984286f3 Add code for locking individual volumes on disk
This adds the necessary APIs and associated changes to lock (on disk) an
individual volume on a particular partition. Nothing yet calls these new
functions.

Change-Id: Ibfa00293e7411f3f48eabdecb13b7e80e126a1ff
Reviewed-on: http://gerrit.openafs.org/1405
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-03-17 10:27:55 -07:00
Ben Kaduk
e42e0912d7 Avoid panic on shutdown with memcache and INVARIANTS
When running with memcache, the filesystem cache is not initialized,
so the file-local struct vnode *volumeVnode is never set to non-NULL.
However, shutdown_cache() unconditionally calls vrele(volumeVnode),
which triggers a KASSERT that the argument to vrele() is non-NULL.
For certain kernel configurations, this results in a panic.
Change this so that vrele() is only conditionally called if the
volumeVnode is non-NULL.

Change-Id: I80235f0d45ae11f26e9a09854bb34439f89bbb40
Reviewed-on: http://gerrit.openafs.org/1576
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-16 17:56:44 -07:00
Ben Kaduk
c9a4e11bba Allocate and free backing store for event mutices
Actually get memory for the event mutex.  With this and a locking
tweak, afsd actually starts (with memcache; the UFS cache still
has some locking issues).
Note that struct mtx is small enough that we may want to just
include it inline in afs_event_t and avoid having to do a separate
allocation/free step.  However, Derrick wants to merge the FBSD and
DARWIN versions of this file, so stick with the more compatible
version for now.
I find that without the memset(), mtx_init() will (sometimes?) complain
that the mutex is already initialized.  The glock should ensure
serialization here, though, so that we only allocate and initialize
one mutex per event.
Also remove an unnecessary cast while here.

Change-Id: Ib304f4301a478a82f0fb8c9ae3bfee98a2a28acd
Reviewed-on: http://gerrit.openafs.org/1560
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-16 17:54:13 -07:00
Derrick Brashear
d9cf88428a rx nat event connection reference
hold a conn ref for the nat ping event. don't renew if the connection
is being garbage-collected.

Change-Id: I45ebf7b8d0362e409094666f186e6b4d58cc906a
Reviewed-on: http://gerrit.openafs.org/1573
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-03-16 04:32:26 -07:00
Marc Dionne
be2c1ea5ef growlagent: remove generated Makefile with make distclean
Add the growlagent Makefile to the list that gets cleaned with
the distclean target.

Change-Id: I6c3385f3b839c436efb50d0fc7239c181e027be6
Reviewed-on: http://gerrit.openafs.org/1575
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-15 20:09:01 -07:00
Antoine Verheijen
8ba939e126 Remove return of value for afs_MarinerLogFetch()
afs_MarinerLogFetch(), a void routine, attempts to return a value.
While gcc (amongst others) merely issues a warning about this, the
Sun Studio C compiler gets cranky (at least on x86) and treats it as
a hard error, thereby aborting the build. Since there actually is no
value to return, this update simply removes the attempt.

Change-Id: Ic89fb05380a25a433f9c3b9fa57962f215348d95
Reviewed-on: http://gerrit.openafs.org/1574
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-15 13:14:24 -07:00
Derrick Brashear
6bfca9c06c freebsd per-event mutexes
use the same system for event mutexes macos does. this time for sure.

Change-Id: I18be653607490ba42f40a0b069460ece2f6ab416
Change-Id: I7e0a2f6042ef7f31612072c6625579de42b17f9b
Reviewed-on: http://gerrit.openafs.org/1554
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-03-15 09:58:37 -07:00
Andrew Deason
19670781ba vlserver: make rxinfo threadsafe
The vlserver has a function 'rxinfo' used for printing out information
about an RX call for logging purposes, which used a static string.
Change it to use a caller-passed buffer, so it is safe to use in
multiple threads.

Change-Id: I186010792e743bc9676ddd5b4c99f011b64988e6
Reviewed-on: http://gerrit.openafs.org/1545
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-03-15 09:57:45 -07:00
Derrick Brashear
81b7f1b010 afsdb lookup shouldn't leak memory on realname lookup
when looking up the "real" cell name, avoid leaking memory. the strdup
is inside a loop and would leak memory for each host returned above one.

Change-Id: I36cc9bd27ddc831121f47046daaab11f752012fe
Reviewed-on: http://gerrit.openafs.org/1538
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-15 09:57:23 -07:00