openafs.git
6 years agodoc: Add 'fs nukenfscreds' manpage
Andrew Deason [Sat, 19 Oct 2013 20:12:03 +0000]
doc: Add 'fs nukenfscreds' manpage

Change-Id: I51c6cd56f463e10ab51adf20a0cf8505e3361326
Reviewed-on: http://gerrit.openafs.org/10414
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: Add 'fs precache' manpage
Andrew Deason [Sun, 13 Oct 2013 03:55:09 +0000]
doc: Add 'fs precache' manpage

Change-Id: Ib4101fdb37cf91a547974216425e4a005392d988
Reviewed-on: http://gerrit.openafs.org/10413
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: Symlink all dafssync-debug pages
Andrew Deason [Thu, 5 Sep 2013 05:48:02 +0000]
doc: Symlink all dafssync-debug pages

For every fssync-debug subcommand, provide a symlink for the
associated dafssync-debug subcommand. This way, running e.g.
"man dafssync-debug_attach" will actually give you a manpage, instead
of needing to specifically run "man fssync-debug_attach".

Change-Id: I83d71dc14f9f838d9a9900fcc62817677898dd27
Reviewed-on: http://gerrit.openafs.org/10412
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: Fix livesys output formatting
Andrew Deason [Mon, 4 Nov 2013 16:04:42 +0000]
doc: Fix livesys output formatting

If we indent text here, the formatting codes are not interpreted, and
the text is output "raw". So currently, we actually see
"I<system_type>" in this section, which is a bit confusing.

Saying the actual output with string substitutions and stuff here
doesn't seem very helpful when the output doesn't have any constant
text in it. Just describe what the output is instead; an example
immediately follows if this is unclear.

Change-Id: Ib3e0f0c5143afa2dd41a655ff3908c791026a426
Reviewed-on: http://gerrit.openafs.org/10411
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: butc manpage fixes
Andrew Deason [Thu, 5 Sep 2013 05:26:00 +0000]
doc: butc manpage fixes

Add missing -rxbind option.

Change-Id: I25fb205dc058ed345bda4d86bd1d344457432939
Reviewed-on: http://gerrit.openafs.org/10410
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: pt_util manpage fixes
Andrew Deason [Sat, 27 Jul 2013 03:14:07 +0000]
doc: pt_util manpage fixes

Add missing -help option.

Change-Id: I2edd7bcaf5b5799ba1216777200580df2cd9ca7f
Reviewed-on: http://gerrit.openafs.org/10409
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: kdb manpage fixes
Andrew Deason [Sat, 27 Jul 2013 03:10:16 +0000]
doc: kdb manpage fixes

Add the missing -numeric and -long options.

Change-Id: I83776e64a161bc0a3ca9260944570799c506bbac
Reviewed-on: http://gerrit.openafs.org/10408
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: volinfo manpage fixes
Andrew Deason [Sat, 27 Jul 2013 02:49:05 +0000]
doc: volinfo manpage fixes

We now have a -checkout option, but no -online option. Document
-checkout and remove -online.

Change-Id: Ie8d6e35c6e09abf994b8417b3bb20ee379095a25
Reviewed-on: http://gerrit.openafs.org/10407
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: rxdebug manpage fixes
Andrew Deason [Sat, 27 Jul 2013 02:00:14 +0000]
doc: rxdebug manpage fixes

Add missing option -long.

Change-Id: I23e3bc38e6962b7727a2aaa07bab7b0818ebcee0
Reviewed-on: http://gerrit.openafs.org/10406
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: vldb_check manpage fixes
Andrew Deason [Wed, 24 Jul 2013 23:00:25 +0000]
doc: vldb_check manpage fixes

 - Add missing option -fix

 - Don't use brackets in the option list; we don't do this in most
   other manpages.

Change-Id: Ifd87dd749aaab2987b2f9c3224b8e931b7bc221c
Reviewed-on: http://gerrit.openafs.org/10403
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: upserver manpage fixes
Andrew Deason [Sat, 27 Jul 2013 01:54:20 +0000]
doc: upserver manpage fixes

Add missing option -rxbind.

Change-Id: I1e6057c3747cf6c502bf14e1d094b8b64691615d
Reviewed-on: http://gerrit.openafs.org/10405
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: afsmonitor manpage fixes
Andrew Deason [Sat, 27 Jul 2013 01:40:50 +0000]
doc: afsmonitor manpage fixes

Add missing option -debug.

Change-Id: I48b37cce536987f5cbf3905e1de70238e83664b5
Reviewed-on: http://gerrit.openafs.org/10404
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: Make all vos pages =include common options
Andrew Deason [Sun, 30 Jun 2013 02:06:51 +0000]
doc: Make all vos pages =include common options

Many manpages for "vos" subcommands were not using the "common" vos
fragments, and instead were just repeating the information directly in
their manpage. Make them all use the "common" vos fragment to avoid
duplication.

Change-Id: I62d84a1164b4ba46082e33a6d27fd24e3722014c
Reviewed-on: http://gerrit.openafs.org/10398
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agodoc: vos manpage fixes
Andrew Deason [Thu, 20 Jun 2013 22:45:05 +0000]
doc: vos manpage fixes

 - Add missing -config option to 'common' vos options, and to the
   synopsis for all commands

 - Remove brackets in the options descriptions for vos_shadow,
   vos_create, and vos_clone. We don't do this in other manpages.

 - vos_create: Add missing -id, -roid to synopsis

 - vos_clone: Add missing -readwrite option

 - vos_shadow: Add missing -toid option

Change-Id: I41fd56509e78116698c82a2f3f4fd07f26cdc95f
Reviewed-on: http://gerrit.openafs.org/10397
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: fs manpage fixes
Andrew Deason [Sat, 29 Jun 2013 20:59:51 +0000]
doc: fs manpage fixes

 - fs_whichcell: Fix formatting typo

 - fs_setcbaddr: Change -host to -addr

 - Add missing -help to fs_setcbaddr and fs_rxstatproc

 - fs_getfid: Add missing -literal to synopsis

 - fs_exportafs: List on/off options in single =item. Doing this in
   two separate consecutive =items confuses the manpage generator.

 - fs_exportafs: Add missing -clipags and -pagcb

Change-Id: I4e986543292f1000fc00456fde486d7da573c9c3
Reviewed-on: http://gerrit.openafs.org/10396
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: restorevol manpage fixes
Andrew Deason [Sun, 30 Jun 2013 22:59:02 +0000]
doc: restorevol manpage fixes

 - Remove nonexistent -verbose option from synopsis

 - Add missing options -umask and -help

Change-Id: Iedddf78c074ead9ab3454bf151adb90138a562b6
Reviewed-on: http://gerrit.openafs.org/10402
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: bosserver manpage fixes
Andrew Deason [Mon, 4 Nov 2013 01:04:30 +0000]
doc: bosserver manpage fixes

Fix -noauth documentation. The current documentation is referring to
the client-side -noauth option, but this is actually the server-side
-noauth option, which is very different.

Change-Id: I65154aef4734e69bb0f3ae485baacac11a718488
Reviewed-on: http://gerrit.openafs.org/10401
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: vlserver manpage fixes
Andrew Deason [Mon, 4 Nov 2013 01:03:42 +0000]
doc: vlserver manpage fixes

 - Indent synopsis formatting

 - Add missing options -trace, -noauth, -smallmem, -rxmaxmtu,
   and -syslog

 - Fix some formatting typos in the synopsis

 - Document the -db alias by putting it next to the -database option,
   separated by a pipe "|"

Change-Id: I4c84baf53d346cb47416cb2843e8b7de2437d147

vlserver: -database option

Change-Id: I7f5539aeebee71441a3901a183033fac05fa411f
Reviewed-on: http://gerrit.openafs.org/10400
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: ptserver manpage fixes
Andrew Deason [Mon, 4 Nov 2013 01:02:50 +0000]
doc: ptserver manpage fixes

 - Indent synopsis formatting

 - Document the -db and -depth aliases by putting them next
   to -database and -groupdeth (respectively) separated by a pipe "|"

Change-Id: Ic40fa0001feee293afe6c22ade7b85dc46fde938
Reviewed-on: http://gerrit.openafs.org/10399
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: Add -help option to fssync-debug manpages
Andrew Deason [Thu, 20 Jun 2013 22:20:17 +0000]
doc: Add -help option to fssync-debug manpages

Change-Id: Id90554b1c56437c62ff9982681ac8a64d4d34948
Reviewed-on: http://gerrit.openafs.org/10395
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: volserver manpage fixes
Andrew Deason [Thu, 31 Oct 2013 04:27:19 +0000]
doc: volserver manpage fixes

 - Fix synopsis formatting, so option arguments are on the same line
   as the option name

 - Add missing options -rxmaxmtu, -rxbind, -syslog, and -sleep

Change-Id: I6e6f06d716e7f78be288bfebde97a3701f086924
Reviewed-on: http://gerrit.openafs.org/10394
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: fileserver manpage fixes
Andrew Deason [Fri, 14 Jun 2013 21:54:01 +0000]
doc: fileserver manpage fixes

 - Fix typo in -syslog option formatting

 - Add missing -nobusy

 - Add missing -vlrudisable

 - Add missing -sync in synopsis

Change-Id: Id63c3228af619c2da5ef88a40e9c2e91888535bb
Reviewed-on: http://gerrit.openafs.org/10393
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: kaserver manpage fixes
Andrew Deason [Fri, 14 Jun 2013 21:15:03 +0000]
doc: kaserver manpage fixes

 - Add missing -rxbind

 - Add missing -crossrealm

 - Fix synopsis formatting, so option arguments are on the same line
   as the option name

Change-Id: I8c73d0f14396aad83651c3037fde1137d83e6692
Reviewed-on: http://gerrit.openafs.org/10392
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: voldump manpage fixes
Andrew Deason [Fri, 14 Jun 2013 21:03:40 +0000]
doc: voldump manpage fixes

Add missing documentation for the -time and -help options.

Change-Id: I04ca0fe6d4a5c298415e450a38a19b719dca4800
Reviewed-on: http://gerrit.openafs.org/10391
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: bos manpage fixes
Andrew Deason [Fri, 14 Jun 2013 20:58:45 +0000]
doc: bos manpage fixes

Add missing documentation for the -mode option.

Change-Id: I360dc3d4cc6d7405feb655bbf2a05aee27a41d46
Reviewed-on: http://gerrit.openafs.org/10390
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: buserver manpage fixes
Andrew Deason [Fri, 14 Jun 2013 20:33:19 +0000]
doc: buserver manpage fixes

 - Add missing -ubikbuffers

 - Remove -enable_peer_stats and -enable_process_stats; we don't
   actually accept these options

 - Fix synopsis formatting, so option arguments are on the same line
   as the option name

 - Fix the -noauth documentation. The current text is referring to the
   client-side -noauth option, but this is actually the server-side
   -noauth option, which is very different.

Change-Id: I11e557e54a8539627ae7bb79cb7af3e8fbc77d25
Reviewed-on: http://gerrit.openafs.org/10389
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agodoc: Fix udebug -port bullet list
Andrew Deason [Sun, 3 Nov 2013 23:58:02 +0000]
doc: Fix udebug -port bullet list

The formatting gets screwed up if we have multiple =item tags together
like this. To just have each one be a bullet point, just have a bare
=item before each one, without a "tag" or "key" for the =item.

Change-Id: I5cb7a98bd16f5999d529a42a0f822835f6d2f66e
Reviewed-on: http://gerrit.openafs.org/10388
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: pts manpage fixes
Andrew Deason [Wed, 12 Jun 2013 23:22:27 +0000]
doc: pts manpage fixes

 - Mention the -help, -auth, -encrypt, and -config options for all pts
   commands in their synopsis

 - Add the -auth option to the pts.pod page

 - Reference the -auth, -encrypt, and -config options from all
   subcommand pts pages

 - pts_removeuser: Replace -name with -user

 - pts_sleep: Add missing -delay

 - pts_source: Add missing -file

Change-Id: I4f0889d661c46f6bdd2a9604d8423d809a632d2d
Reviewed-on: http://gerrit.openafs.org/10387
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agodoc: add linked cells description to man pages
Ken Dreyer [Mon, 14 Oct 2013 17:39:02 +0000]
doc: add linked cells description to man pages

The man pages previously described linking DCE cells to AFS cells.
OpenAFS and YFS also allow linking between two AFS cells. Update the
description of linked cells in CellServDB(5), aklog(1), and
fs_newcell(1) to refer to AFS instead of DCE.

Add a linked cell example to the CellServDB man page with an
explanation.

Change-Id: Ic9b1c643861b7307c09fcc5a1775f4abf4cb4155
Reviewed-on: http://gerrit.openafs.org/10342
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoafs: afs_CacheIsTooFull macro refs wrong constant
Jeffrey Altman [Sat, 7 Sep 2013 17:55:58 +0000]
afs: afs_CacheIsTooFull macro refs wrong constant

When afs_CacheIsTooFull tests the number of free blocks it should
use CM_DCACHESPACEFREEPCT (90%) instead of CM_DCACHECOUNTFREEPCT (95%).

Change-Id: I1c9ac4f9a6d03077047837af6ef9a09e256ea07d
Reviewed-on: http://gerrit.openafs.org/10235
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agoafs: CacheTruncateDaemon work until Cache Drained
Jeffrey Altman [Mon, 9 Sep 2013 13:20:32 +0000]
afs: CacheTruncateDaemon work until Cache Drained

The afs_CacheTruncateDeamon() thread will not sleep until both
'afs_CacheTooFull' and 'afs_WaitForCacheDrain' are true but the
thread will stop freeing space in the cache when 'afs_CacheTooFull'
is true which prevents 'afs_WaitForCacheDrain' from ever becoming
true if it is not already.

Make the conditional for doing work include 'afs_WaitForCacheDrain'.

Change-Id: I9a60da6db65511c8bf2391a53a6f76043f825078
Reviewed-on: http://gerrit.openafs.org/10238
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agoafs: afs_CacheTruncateDaemon wake waiters !too full
Jeffrey Altman [Sat, 7 Sep 2013 18:04:32 +0000]
afs: afs_CacheTruncateDaemon wake waiters !too full

When processing afs_CacheTruncateDaemon() if the cache is no longer
too full, then wake the waiters.

Change-Id: I114341f8a71654b0a064d6dad2a704dd1fa8dbe2
Reviewed-on: http://gerrit.openafs.org/10236
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agoafs: afs_FlushDCache avoid dup cache drained check
Jeffrey Altman [Sat, 7 Sep 2013 17:27:54 +0000]
afs: afs_FlushDCache avoid dup cache drained check

afs_WakeCacheWaitersIfDrained is called as the last statement
of both afs_DiscardDCache and afs_FreeDCache.  There is no need
to perform the same check again before exiting afs_FlushDCache.

Change-Id: I11b4c42868ca67e4717fd431b1d33a85ce57bd0f
Reviewed-on: http://gerrit.openafs.org/10234
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agoafs: Introduce afs_WakeCacheWaitersIfDrained
Jeffrey Altman [Mon, 9 Sep 2013 16:17:36 +0000]
afs: Introduce afs_WakeCacheWaitersIfDrained

Consolidate common code into afs_WakeCacheWaitersIfDrained().

Change-Id: I10e35afbc1f1469038e111a7bbd209c8897c8972
Reviewed-on: http://gerrit.openafs.org/10233
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agoafs: FreeDCache test afs_blocksDiscarded
Jeffrey Altman [Sat, 7 Sep 2013 16:26:52 +0000]
afs: FreeDCache test afs_blocksDiscarded

For consistency with afs_FlushDCache and afs_DiscardDCache
include afs_blocksDiscarded in the free space test.  When afs_FreeDCache
is called it should be zero.

Change-Id: Ic9063280d88eb28d84851cbe6b7e4867a1110659
Reviewed-on: http://gerrit.openafs.org/10232
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agoWindows: RDRLib Worker Thread shutdown
Jeffrey Altman [Mon, 28 Oct 2013 05:06:47 +0000]
Windows: RDRLib Worker Thread shutdown

The thread waiting to unload the library is polling the state of
the AFS_WORKER_INITIALIZED flag in the PoolContext->State field
for each worker.  Ensure that the thread performs no actions other than
PsTerminateSystemThread() after clearing the AFS_WORKER_INITIALIZED flag.

Change-Id: I0baa92f05a5d5f00219a2cc63ca71c7a6a1f52b5
Reviewed-on: http://gerrit.openafs.org/10383
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: Uninitialized TargetNameLength/Offset
Jeffrey Altman [Tue, 29 Oct 2013 12:24:06 +0000]
Windows: Uninitialized TargetNameLength/Offset

In RDR_PopulateCurrentEntry it is possible for TargetNameLength and
TargetNameOffset to be uninitialized resulting in stack garbage being
returned to the redirector.  This can result in a blue screen.

Change-Id: Ifa306ba54bea3f26f1938cbd6bdc28521065299d
Reviewed-on: http://gerrit.openafs.org/10373
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: cm_NewSCache skip in hash recycled entries
Jeffrey Altman [Fri, 18 Oct 2013 23:26:56 +0000]
Windows: cm_NewSCache skip in hash recycled entries

If cm_RecycleSCache returns an in-hash entry it means that either
it wasn't recycled properly or somehow we raced this entry with
another thread.  Just skip it and keep searching.

Change-Id: Ia443a04b063a019003662639d31f96db486d673c
Reviewed-on: http://gerrit.openafs.org/10353
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: cm_RemoveSCacheFromHashTable scp not found
Jeffrey Altman [Fri, 18 Oct 2013 23:14:00 +0000]
Windows: cm_RemoveSCacheFromHashTable scp not found

If the cm_scache_t has CM_SCACHEFLAG_INHASH flag set but cannot be
found in the CH_SCACHE_HASH(&scp->fid) hash chain then search the
entire hash table for the object.  At the end of the function we
will know that the CM_SCACHEFLAG_INHASH flag is safe to clear.

Change-Id: I92bfad98b7d3cdc42b5aa6b8fae24d47557465e7
Reviewed-on: http://gerrit.openafs.org/10352
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: EOF for Synchronous Deferred Writes on XP/2003
Rod Widdowson [Sun, 20 Oct 2013 18:29:35 +0000]
Windows: EOF for Synchronous Deferred Writes on XP/2003

The Windows IO Manager is not supposed to issue multiple
outstanding cached writes to a file system for a synchronous
file object.  To do so would risk out of order application
of writes that extend the end of file and in turn risk data
corruption.  It turns out that on Server 2003 SP2 and more
than likely XP and 2000 as well, if a file system returns
STATUS_PENDING because a write was deferred due to the
Windows Cache Manager failing CcCanIWrite(), the IO Manager
will happily continue issue subsequent write requests.

On OSes older than Vista disable the use of deferred writes
and sit in a spin loop waiting for the Windows cache manager
to make room.  This is much less efficient and increases the
write latency but it is safe.

Change-Id: Ic47d62749bdb4d0475661967fcbfd25834f21a72
Reviewed-on: http://gerrit.openafs.org/10351
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: Store OS version as a global
Jeffrey Altman [Mon, 21 Oct 2013 15:26:16 +0000]
Windows: Store OS version as a global

In DriverEntry() RtlGetVersion() is used to obtain the OS version
information.  Store the result in a global structure that can be
used elsewhere to make run time decisions based upon the OS.

Change-Id: I194e7da6858d1dea755d8de82a9bee70e63ade4d
Reviewed-on: http://gerrit.openafs.org/10350
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoRemove bucoord/expire.c
Ben Kaduk [Fri, 25 Oct 2013 21:45:38 +0000]
Remove bucoord/expire.c

It was not compiled into anything.

Correct references in bucoord_internal to command.c.

Remove the forward declaration of struct cmd_parmdesc and make cmd.h
a prerequisite for this header, since all but two consumers had cmd.h
already.

Change-Id: Id60a550871643610ccd96c226ecf0a3c4acb3955
Reviewed-on: http://gerrit.openafs.org/10363
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agoauth: prevent uninitialized key list in AFS config
Mark Vitale [Fri, 4 Oct 2013 01:42:10 +0000]
auth: prevent uninitialized key list in AFS config

_afsconf_OpenInternal() may exit early for a number of reasons
before properly initalizing afsconf_dir->listKeys.
This leads to a crash when _afsconf_CloseInternal() attempts
to clean up listKeys.

Prevent this situation by calling afsconf_InitKeys() before any
possible exit from _afsconf_OpenInternal().

Change-Id: I6911427817a2518a576c00a7ea56351f9fb4fd19
Reviewed-on: http://gerrit.openafs.org/10323
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agoubik: fix include quotes
Michael Meffie [Fri, 25 Oct 2013 17:47:59 +0000]
ubik: fix include quotes

Include the generated header in the current directory.

Change-Id: Iaa22fcfd0e22e5f33e7c9bf8a26a838b25668160
Reviewed-on: http://gerrit.openafs.org/10361
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

6 years agovos: Remove pthread send/receive select()
Andrew Deason [Wed, 23 Oct 2013 20:32:19 +0000]
vos: Remove pthread send/receive select()

Commit 65e701fee4968b17066bb81e25b7adaa4024d4f3 introduced a couple of
select() calls when the pthreaded vos writes to or reads from a usd
pipe, corresponding to the IOMGR_Select() calls in LWP. However, these
select() calls are unnecessary, since the read() or write() calls
themselves will block anyway. The reason they are there for LWP is so
the IOMGR can run another process while we're waiting for the file
descriptor to be ready.

The select() in ReceiveFile currently incorrectly waits for the output
to be ready for reading, even though we're trying to write to it. As a
result, if we try to 'vos dump' to a pipe with the pthreaded vos (such
as stdout), we will hang forever, since it will never be ready for
reading.

To fix this, just get rid of the select() calls, since they don't
really do anything.

FIXES 131749

Change-Id: Ibe8841e0c01f1e55ac4ca1a8a99ab71083654662
Reviewed-on: http://gerrit.openafs.org/10360
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agoafs: Clarify comment
Perry Ruiter [Tue, 22 Oct 2013 12:46:10 +0000]
afs: Clarify comment

Fixing a couple typos and rewording a comment for clarity in afs_segments.c

Change-Id: Ic631b6f8d59e4e9a56f61e583a8ef0f8f8794d8b
Reviewed-on: http://gerrit.openafs.org/10364
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoSysname and param.h for FreeBSD 9.2 and 11.0
Ben Kaduk [Tue, 15 Oct 2013 20:56:07 +0000]
Sysname and param.h for FreeBSD 9.2 and 11.0

9.2 is newly released and HEAD is now 11-current.

Change-Id: Ic79ff26aa39e08940b6035770fe4c6f15b02c418
Reviewed-on: http://gerrit.openafs.org/10341
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoAdjust for microtime() ABI on all XBSD
Ben Kaduk [Tue, 15 Oct 2013 20:00:01 +0000]
Adjust for microtime() ABI on all XBSD

On the BSDs, struct timeval is not two 32-bit integers like our
struct clock, so the ABI is quite incompatible.  Use the native type
for the function call and translate to our local type accordingly.

This lets us get rid of a workaround for the FreeBSD kernel build,
wherein particular compiler flags masked the stack corruption that
can occur due to this ABI mismatch.

Change-Id: I68f9947b0875dca7343ecd41a4c529d5c5bc3be5
Reviewed-on: http://gerrit.openafs.org/10340
Reviewed-by: Jeffrey Hutzelman <jhutz@cmu.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Antoine Verheijen <apv@ualberta.ca>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoFix build for FreeBSD 10.0
Benjamin Kaduk [Wed, 25 Sep 2013 20:57:41 +0000]
Fix build for FreeBSD 10.0

Move a rmlock.h inclusion up a bit so that the vm headers can get the
rmlock assertion (and other) macros they need.

The filedesc structure has been expanded on FreeBSD to support a
stronger capabilities system; getting to the actual file descriptor
requires another structure access.

limits.h and stdarg.h need sys/ and machine/ prefixes for inclusion in the
kernel on FreeBSD.  Fixing this lets us get rid of some unnecessary -I
arguemnts in the kernel module build, which seem to have not been functioning
as expected, anyway.

Catch up to VM layer changes.

This builds, but crashes at runtime due to some ABI incompatibilities
that appear in the rx event layer; those will be fixed in a separate patch.

Change-Id: Icc253b1e938a58a7ab8d1b789c82b9b940d263fd
Reviewed-on: http://gerrit.openafs.org/10339
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoviced: Improve client error log messages
Andrew Deason [Fri, 18 Oct 2013 00:22:48 +0000]
viced: Improve client error log messages

Commit 6c41b1f740e16b5b9adfe9026630595be6f0699e improved a few log
messages to include the client ip and port of the request triggering
that log message. Include the viceid and fid (if applicable), too, so
an administrator may more easily identify the cause.

This creates the function LogClientError, so we can use a common
function for logging very similar information. This also modifies
h_FindClient_r to give the viceid to the caller, even in the case of
error. In addition, this modifies CallPreamble to accept a fid and
modifies all callers to accomodate.

Change-Id: I326e17538265ea3251db27a05ede25c33e9a230d
Reviewed-on: http://gerrit.openafs.org/10347
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agotabular_output: enable compilation on Windows
Christof Hanke [Wed, 9 Oct 2013 06:06:03 +0000]
tabular_output: enable compilation on Windows

Add the required directives to the makefile.

Change-Id: I7a6e612b37cbf1f6cb61faf55d7c248f8f85808c
Reviewed-on: http://gerrit.openafs.org/10328
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agotabular_output: move public headers
Christof Hanke [Wed, 9 Oct 2013 06:01:35 +0000]
tabular_output: move public headers

from tabular_output.h to afsutil_prototypes.h
Like this, tabular_output.h does not have to be included
in any devel-package.

Change-Id: I9e3089fe4a65b2a801c45ba513a8f5dc49ce609b
Reviewed-on: http://gerrit.openafs.org/10327
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoConvert buserver to libutil's logging
Ben Kaduk [Thu, 10 Oct 2013 17:50:26 +0000]
Convert buserver to libutil's logging

The primary motivation is to get automatic log rotation, but we
also get built-in locking for the logging calls.

This does have a side effect of changing the format used to print
timestamps in the log file.

Export WriteLogBuffer from liboafs_util so as to be mostly compatible
with the ... idiosyncrasy of LogError()'s previous behavior.

Garbage-collect the unused (and un-exported) printHashTable() and LogNetDump().

Change-Id: I860370e60082ea355806b3f1945eee76db7c32e3
Reviewed-on: http://gerrit.openafs.org/10333
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Karl Ramm <kcr@1ts.org>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agosalvager: Ignore linktable-only RW volumes
Andrew Deason [Thu, 3 Oct 2013 17:38:08 +0000]
salvager: Ignore linktable-only RW volumes

In general, the salvager will try to salvage any volume if we find an
inode for that volume. However, for namei, we'll always have at least
one inode for the RW volume, even if we only have e.g. an RO volume at
a particular site, since the linktable special inode is always marked
as for the RW volume id. So, if we salvage a volume group that only
has an RO, normally we would also try to salvage the corresponding RW,
even if it doesn't exist. We would then recreate the "missing"
metadata files, so after salvaging, the RW appears to exist as a
normal volume.

The salvager currently tries to avoid this by skipping salvaging the
RW if we find more than one volume in the volume group, and if the RW
only has one special inode, and that one special inode is the
linktable. This solves the problem most of the time, but misses a few
corner cases:

 - If we found more than one linktable, we'll try to salvage the RW
   anyway. This shouldn't happen, but certain cases of corruption can
   cause incorrectly-named linktables, resulting in multiple
   linktables.

 - If we only find one volume (the RW), we'll still salvage the RW,
   even if the only inode for it is a single linktable. This can
   happen due to botched salvages in the past, or interrupted deletes
   and such. It's just cruft.

In any situation like those, we cause an RW volume to be created where
there previously was none. This can be a problem, since the RW volume
is unknown to the administrator, and does not appear in the VLDB. Such
"phantom" volumes can be very confusing and can cause problems in the
future. For example, if that same RW volume is moved to the server
with the "phantom" RW volume, we now have two of the same RW volume on
the same server on different partitions, which is a big problem.

So, to avoid these corner cases, check all of the special inodes to
see if all of them are linktables. Also perform this check if we don't
have any non-special inodes (even if we only see 1 volume), to catch
the "cruft" case above.

Change-Id: I00df021ebedce44f69302a48ed2716bd9bda124e
Reviewed-on: http://gerrit.openafs.org/10321
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agonamei: Set inconsistent linktable linkCount to 0
Andrew Deason [Tue, 1 Oct 2013 22:31:44 +0000]
namei: Set inconsistent linktable linkCount to 0

Currently, if we detect an inconsistent linktable filename (where the
filename indicates it's for a different volume than the directory path
indicates), we don't set the linkCount for the inode info. This means
that our caller will get random garbage for the linkCount.

In many cases this value is ignored, but for the salvager, if this is
the only linktable file we find, we treat it as the linktable we
should be using. Thus, if linkCount contains undefined data, we might
try to INC or DEC the linktable a bunch of times, depending on what
random stack garbage the linkCount is filled with.

The salvager shouldn't be INC/DEC'ing these linktables according to
the their linkCount anyway, but in the meantime, at least ensure that
this doesn't contain stack garbage, so we ensure that we won't try to
INC or DEC this thousands or millions of times.

Change-Id: Ib5e7f45d5739878434cbe57b6f2ab532f002e5b8
Reviewed-on: http://gerrit.openafs.org/10320
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoReorder bosserver startup prior to pthreads
Ben Kaduk [Mon, 29 Jul 2013 18:22:46 +0000]
Reorder bosserver startup prior to pthreads

The rx calls will take locks when built in pthreaded mode, and must go
after rx_Init().  Some other setup would benefit from using time-domain
locking and should run before we go multithreaded.

In particular, initialize bozo_confdir while single-threaded, as it is
otherwise protected by the afsconf internal locking.  While here, pass
NULL to afsconf_SetCellInfo -- bozo_confdir would always be NULL there,
anyway.

Change a couple globals into local variables in main; they are just
used to defer setup after argument parsing.

ReadBozoFile will create worker threads to monitor child processes,
so it cannot move up too far.

Change when we daemonize, too.

Change-Id: If7b6883748919270c9a5a41cd8e6fb724e95aa36
Reviewed-on: http://gerrit.openafs.org/10285
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agobozo: Remove dead code and minor cleanup
Ben Kaduk [Wed, 17 Jul 2013 19:00:11 +0000]
bozo: Remove dead code and minor cleanup

This stuff has been #if 0'd for ages; put it out of its misery.

While here, remove the global bnode_waiting which is not used for anything.

bnode_SoftInt claims to return a pointer, so return NULL instead of 0.

Change-Id: Ie7b32bbc606a105190d246355f47bd7ea885c6f8
Reviewed-on: http://gerrit.openafs.org/10284
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoviced: Avoid endless BCB loop
Andrew Deason [Mon, 12 Aug 2013 22:37:29 +0000]
viced: Avoid endless BCB loop

Without this commit, when we break callbacks for a fid, we loop over
all callbacks for the fid, break a few of them, and then start over.
We do this repeatedly until we run out of callbacks. If a client sees
a callback break, and then establishes a new callback promise while
the fileserver is still breaking callbacks, the fileserver can break
the same callback for the same host again and again. This can continue
forever, if the client establishes its new callback promises quickly
enough.

So to avoid this, when we start breaking callbacks, flag all of the
callback structures that we want to look at. Then when we repeatedly
loop through all of the callbacks for the fid, only look at the
flagged callback structures.

This adds a 'flags' field to struct CallBack, and defines a single
flag, CBFLAG_BREAKING.

This is an alternative fix to the issue also fixed in 843d705c. This
implementation avoids allocating extra memory under locks, and has the
slight benefit of not breaking callbacks that were elsewhere deleted
during the BCB. This comes at the cost of a single extra traversal
through our callback list, and the cost of claiming one of the bits in
the CallBack structure.

Change-Id: I6418bd404de61ec7a531261ecf581eeea719a2d4
Reviewed-on: http://gerrit.openafs.org/10172
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoRevert "Atomically collect callbacks to be broken"
Andrew Deason [Wed, 21 Aug 2013 01:51:04 +0000]
Revert "Atomically collect callbacks to be broken"

This mostly reverts commit 843d705ca6f0250c3760ec2aa1f3403d19de3df1.
That commit causes each callback-breaking thread to potentially use up
a large amount of memory, as well as possibly causing large memory
allocations under H_LOCK, which isn't great.

There are other ways to allow for atomic callback breaks. Revert that
commit to allow for alternative methods to be implemented in separate
subsequent commits. Do this in separate commits so pullups to stable
branches are easier.

This does not revert the change in the definition of MAX_CB_HOSTS.
That value can still be large due to the improved multi_Rx
implementation.

Change-Id: I14024b4d80696b0361658b1c5ae7af308629fab4
Reviewed-on: http://gerrit.openafs.org/10171
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agosalvager: Improve comments
Andrew Deason [Mon, 30 Sep 2013 23:12:21 +0000]
salvager: Improve comments

"these used to be asserts" is not a useful comment. This area of code
does maybe look a little confusing at first glance, though, so replace
these with comments that are more informative.

Change-Id: I4e0b9dff3d010931e02559e82165ffbd61c5b189
Reviewed-on: http://gerrit.openafs.org/10313
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agosalvager: Fix in-memory invalid linktable counts
Andrew Deason [Mon, 30 Sep 2013 22:53:36 +0000]
salvager: Fix in-memory invalid linktable counts

When we have a nonexistant or invalid linktable, we manually set all
of the linkcounts to 1, since we're recreating the link table from
scratch. However, we also have a linkCount count in our in-memory
allInodes array, which could be populated by garbage if we had a
garbage linktable. So make sure to set our in-memory linkCount to 1
for each inode, so we don't use garbage linkcount data.

Change-Id: I8f4873e12f70f81ee6f2c764957e77136b0a385e
Reviewed-on: http://gerrit.openafs.org/10312
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agosalvager: Whitespace formatting
Andrew Deason [Mon, 30 Sep 2013 22:51:40 +0000]
salvager: Whitespace formatting

The whitespace here is pretty weird. Clean it up a little.

Change-Id: Ia558d453301ee1231cfb21ee87dc7f190dc905d7
Reviewed-on: http://gerrit.openafs.org/10311
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoFBSD: plug refcount leak in pioctl
Ben Kaduk [Wed, 29 May 2013 23:18:22 +0000]
FBSD: plug refcount leak in pioctl

When gop_lookupname_user returns a non-NULL vnode, the vnode came
from afs_GetVCache (by way of afs_lookup) which takes a reference
on the vnode entry.  There's no need to take another spurious
reference here.  The existing code already knows that there's a
reference in place, as there is an AFS_RELE down where FBSD80_ENV
unlocks the vnode if it's locked (that code is also suspicious).

Prior to this patch, things like 'fs flush /path/to/file' would
leak a reference on that cache entry, preventing clean shutdown.

Change-Id: Iefb7be16bb76b709ffd7cfc082ef9078adf9e354
Reviewed-on: http://gerrit.openafs.org/9957
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agolinux-kernel-module: move keyring-specific
Christof Hanke [Tue, 8 Oct 2013 09:53:17 +0000]
linux-kernel-module: move keyring-specific

function afs_set_session_keyring into
if defined(LINUX_KEYRING_SUPPORT)
block. Otherwise compilation fails.

Change-Id: I44bb015990782793eac9326b983b704b2248b230
Reviewed-on: http://gerrit.openafs.org/10324
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoprocmgmt: Introduce spawnprocve_sig
Marc Dionne [Sat, 22 Sep 2012 19:29:52 +0000]
procmgmt: Introduce spawnprocve_sig

Introduce spawnprocve_sig, a variant of spawnprocve that allows
a caller to spawn a process with a specific signal mask.
This is useful when we want to set a mask that is different
from the current one.  It needs to be done after the fork()
so that the current thread is not affected.

Change-Id: I900c85cb70d22756b78562618b0e853dcedf8235
Reviewed-on: http://gerrit.openafs.org/8749
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoihandle: Make sure we don't ih_attachfd invalid FD
Andrew Deason [Thu, 12 Sep 2013 20:58:34 +0000]
ihandle: Make sure we don't ih_attachfd invalid FD

Right now, if you give ih_attachfd_r an invalid fd, and fdLruHead is
NULL, we'll return an FdHandle_t* for an invalid fd. Nowhere in the
code is this possible right now, but the implementation of
ih_attachfd_r and ih_attachfd doesn't make this very clear.

Ideally the "close some fds and retry" behavior in ih_attachfd_r will
be split out, so this code could be easier to follow, and we could
implement open() EMFILE retrying for icreate operations. But for now,
just make the current behavior clearer, so future modifications do not
introduce such mistakes.

Change-Id: Ibc80b32bc6f50480d12e3241fe198bc0587a962c
Reviewed-on: http://gerrit.openafs.org/10249
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoDOC: afsd man page: give an example of the direct volume mount syntax
Jason Edgecombe [Fri, 27 Sep 2013 02:07:39 +0000]
DOC: afsd man page: give an example of the direct volume mount syntax

The syntax is a little confusing, so an example is needed to clarify it.

Change-Id: I413a5f2af6ccf48e780007c658c35a34384d09e0
Reviewed-on: http://gerrit.openafs.org/10281
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agovos: more details in vos release -verbose output
Michael Meffie [Fri, 1 Feb 2013 15:57:07 +0000]
vos: more details in vos release -verbose output

When running vos release with the -verbose flag, print the reasons for a
complete release, and the reasons for doing a full dump of the volume.  When
doing a full dump, have the verbose output print 'entire volume' instead of
'full release', to avoid confusion with a complete release.

Change-Id: I041da692bfea5d7eb0c96d51a5a794e3eeeb6d72
Reviewed-on: http://gerrit.openafs.org/9018
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agofix linux build error in osi_probe
Michael Meffie [Fri, 27 Sep 2013 17:35:07 +0000]
fix linux build error in osi_probe

Fix a build error for older versions of linux, introduced by
commit 7694f536d3997768b69a635616b0cf24d71a595a
(scsi_command_size became scsi_command_size_tbl)

Fixes a build error on RHEL/CentOS 5.9; 2.6.18-348.3.1.el5.

Change-Id: I7e6f08e7f7cbba47034701e6137eb91fa567dbda
Reviewed-on: http://gerrit.openafs.org/10282
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agovos: complain if no fields are passed
Christof Hanke [Tue, 24 Sep 2013 09:01:08 +0000]
vos: complain if no fields are passed

to vos "setfields". It might be a misleading if it exists
sucessfully when clearly invoked wrongly.

Change-Id: Ic92f4e17fde0a0dfc182f9713350800c72fa165e
Reviewed-on: http://gerrit.openafs.org/10271
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agodoc: state klog.krb is obsolete
Michael Meffie [Tue, 24 Sep 2013 01:23:27 +0000]
doc: state klog.krb is obsolete

State upfront that klog and klog.krb (v4) are obsolete.

Update the klog.krb description and remove some redundant
text.

Change-Id: I6ede8084aebbd49c5a27aa427ef9782d99a347aa
Reviewed-on: http://gerrit.openafs.org/10270
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoCatch up to FreeBSD VM object read/write locks
Ben Kaduk [Fri, 22 Mar 2013 17:51:02 +0000]
Catch up to FreeBSD VM object read/write locks

Upstream r248084 changed the vm_object mutex to be a rwlock,
allowing for future optimizations.  This is a KPI change, so
introduce conditionals to be compatible with both versions of the KPI.

Change-Id: I6e3101bc80262480035dee4c5b2d1b9cbc44b57b
Reviewed-on: http://gerrit.openafs.org/10295
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agobuild: compile_et rules for parallel make
Michael Meffie [Tue, 10 Sep 2013 02:25:50 +0000]
build: compile_et rules for parallel make

Change all makefile rules which run compile_et in order support parallel
make.  The compile_et generates two outputs, so special care must be
taken in rules which run compile_et.

All the rules for compile_et have been changed to the form:

    foo.c foo.h: foo.et
        compile_et foo.et -h foo
    foo.h: foo.c

The above rules are equivalent to:

    foo.c: foo.et
        compile_et foo.et -h foo

    foo.h: foo.et foo.c
        compile_et foo.et -h foo

therefore a parallel make will serialize the builds of foo.c and foo.h,
and should detect that the second is no longer needed once the first is
over.  This form works since foo.et is not a phony target, and does not
depend on a phony target.

Previously, the rules for compile_et were of the one of the two forms:

    a)  foo.c foo.h: foo.et
            compile_et foo.et -h foo

or

    b)  foo.h: foo.c
        foo.c: foo.et
            compile_et foo.et -h foo

Form a) is problematic for parallel makes, since it is equivalent to:

        foo.c:
            compile_et foo.et -h foo
        foo.h:
            compile_et foo.et -h foo

In a parallel make, compile_et will be run concurrently, clobbering
each other's output files.

Form b) is better, but is problematic when foo.h is removed, since foo.h
will not be updated.

Thanks to Russ Allbery for pointing out the automake documentation which
describes issues with commands that produce multiple outputs, and
portable solutions.

http://www.gnu.org/software/automake/manual/automake.html#Multiple-Outputs

Change-Id: I14c056606084f80270e05592d3d09a600f804e24
Reviewed-on: http://gerrit.openafs.org/10237
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoWindows: fix libafscp build directory
Jeffrey Altman [Wed, 11 Sep 2013 14:44:37 +0000]
Windows: fix libafscp build directory

NTMakefile specifed the directory as libacl not libafscp

Change-Id: I12af68a19155d0764967f9cd2e8eb2d8795530d5
Reviewed-on: http://gerrit.openafs.org/10299
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: Freelance Do not chase mount points
Jeffrey Altman [Wed, 4 Sep 2013 19:53:57 +0000]
Windows: Freelance Do not chase mount points

When adding mount points or symlinks do not chase mount points
when attempting to determine the FID of the added object.

Change-Id: Ic4e070d687cc56407a19c41f185f3e28db7671bd
Reviewed-on: http://gerrit.openafs.org/10298
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: cm_MergeStatus avoid lock recursion
Jeffrey Altman [Fri, 27 Sep 2013 22:02:52 +0000]
Windows: cm_MergeStatus avoid lock recursion

It is possible for cm_MergeStatus() to be called while the
cm_buf_t.mx is already held.  If it is a panic occurs.  Test for
refcount == 0 before acquiring the lock in addition to afterwards.
If the refcount is not zero, then we do not need to acquire the
lock in any case.

Change-Id: I1b73a03f4745e524d7fdf8f9b231b420895ff0fa
Reviewed-on: http://gerrit.openafs.org/10297
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: AFSCreate avoid race leading to NULL dereference
Jeffrey Altman [Wed, 4 Sep 2013 17:11:24 +0000]
Windows: AFSCreate avoid race leading to NULL dereference

If a test for NULL is performed ahead of an assignment and then
use of the assigned value, there is a race which can result in
the assigned value being NULL if the value being assigned is
altered by another thread.

Perform the assignment first then test based upon that.

Change-Id: I6d50619dab168c2aa12542b14217779f1be08ee9
Reviewed-on: http://gerrit.openafs.org/10296
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoProbe directly for com_err.h
Andrew Deason [Wed, 11 Sep 2013 16:22:20 +0000]
Probe directly for com_err.h

com_err.h can be in com_err.h, et/com_err.h, or krb5/com_err.h (for
netbsd 6.1 and possibly other netbsd). aklog currently only includes
either com_err.h or et/com_err.h, depending on autoconf probes
performed by the krb5.m4 macros.

So, also look for krb5/com_err.h. The krb5.m4 macros currently only
look for com_err.h at all if certain other libkrb5 tests return
certain results, so just look for all of them directly in some of our
openafs-specific krb5 probing logic in configure.ac.

Also remove the duplicate check for et/com_err.h in acinclude.m4 while
we're here. We only use et/com_err.h if krb5 support is enabled, so
only check for it in the second of krb5 probes.

FIXES 131716

Change-Id: Ic454b9bf7043f91654dcd1c262ab3790bf2ad272
Reviewed-on: http://gerrit.openafs.org/10244
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoWhine if single-DES keys are in use
Andrew Deason [Wed, 25 Sep 2013 05:25:48 +0000]
Whine if single-DES keys are in use

If we are using single-DES keys in our KeyFile, yell at the
administrator, so they have a chance at realizing that they should
migrate to stronger crypto.

Change-Id: Ic37d9e1cea7ee7e12594be0dec02000f11efc896
Reviewed-on: http://gerrit.openafs.org/10273
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agovol: Nuke parent vol special inodes
Andrew Deason [Wed, 18 Sep 2013 21:56:23 +0000]
vol: Nuke parent vol special inodes

When we "nuke" a volume, we delete all inodes we can find that are for
the given volume id. This currently means that if we nuke an RW volume
id, we delete all of the inodes for file data for the entire volume
group (since they're all stored in the VG id), but we do not delete
the special inodes for any non-RW volumes in that volume group. Those
special inodes left behind are not very useful, since we just deleted
all of the actual file data.

Currently this means that on namei, it's impossible to nuke the
special inodes for non-RW volumes, since the namei nuke will only look
in the subdir for the given volume id. If you give it the RW volume
id, it won't delete the special inodes as menioned above; if you give
it the RO volume id, it will only look in the RO subdir, and won't
find the RO special inodes in the RW subdir.

If a volume group is damaged in such a way that the salvager cannot
fix it (due to a bug), this means that it is impossible to get rid of
that volume group completely from the partition on namei without
manually running "rm -rf" on the relevant AFSIDat directory. Normally
we have a failsafe of running 'vos zap -force', but that doesn't work
for non-RW special inodes, as mentioned above.

So, in order to allow this 'vos zap -force' failsafe to work in
hopefully all situations, also delete the special inodes for the
parent volume. Use similar logic as exists in the salvager's
OnlyOneVolume function.

Change-Id: Id29da48a548c70b2b9ada1dd09f41cb59452bd11
Reviewed-on: http://gerrit.openafs.org/10256
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agorxgen: cast bool properly
Chaskiel Grundman [Fri, 20 Sep 2013 19:08:30 +0000]
rxgen: cast bool properly

The C type for xdr's bool is bool_t. When casting, use the correct type

Change-Id: I562ee1e48eeffa8fece66176cf13013630d157aa
Reviewed-on: http://gerrit.openafs.org/10261
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agobozo: cap retry delay
Michael Meffie [Tue, 20 Aug 2013 20:48:34 +0000]
bozo: cap retry delay

Cap the retry delay to a reasonable amount of time instead
of just doubling the delay until it reaches 16 hours.

Change-Id: Ibc7dd75670a9b02f34050842b6e54df4f5a7c315
Reviewed-on: http://gerrit.openafs.org/10148
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agorx_multi: free the quantity of memory we allocated
Jonathan A. Kollasch [Sat, 21 Sep 2013 00:46:05 +0000]
rx_multi: free the quantity of memory we allocated

Change-Id: I3a666bb5c3b8b9ab222d1170095e46116fac4229
Reviewed-on: http://gerrit.openafs.org/10266
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agotkt_MakeTicket5: Use correct bitmask operator
Chaskiel Grundman [Fri, 20 Sep 2013 20:47:33 +0000]
tkt_MakeTicket5: Use correct bitmask operator

tkt_MakeTicket5 tries to avoid returning heimdal asn1 error codes,
but uses an incorrect expression that's almost always true. Use
bitwise & instead of logical && to fix.

Change-Id: I59bffe8c9b98c6f32b967bc37a7989c98c5720b6
Reviewed-on: http://gerrit.openafs.org/10264
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoAdd missing clean rules
Chaskiel Grundman [Fri, 20 Sep 2013 19:27:27 +0000]
Add missing clean rules

do libtool cleanup in src/afsd, src/kauth, and src/venus
remove ordinary objects in src/opr

Change-Id: Iddf6bb017a38e20e971b9faf576ee2f9e39625c0
Reviewed-on: http://gerrit.openafs.org/10262
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoRemove AFS_NBSD40_ENV block within AFS_HPUX110_ENV block
Jonathan A. Kollasch [Sat, 21 Sep 2013 00:36:30 +0000]
Remove AFS_NBSD40_ENV block within AFS_HPUX110_ENV block

Change-Id: Id679f07c811c36b9f47556a9e7be94fe7ba303f3
Reviewed-on: http://gerrit.openafs.org/10265
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agorx: Always call rxi_StartListener
Andrew Deason [Fri, 20 Sep 2013 20:13:43 +0000]
rx: Always call rxi_StartListener

Commit c10f5296 made rx_Init only call rxi_StartListener in the kernel
if we have RXK_LISTENER_ENV. But this doesn't make any sense, since
rxi_StartListener only does anything if RXK_LISTENER_ENV is _not_
defined. As a result, for any non-rxk-listener non-rx-upcall platform,
we never receives rx packets in the kernel, since we never set up our
rx packet callback. The only such platform appears to be AIX, since
while other platforms (HPUX, FBSD, IRIX) have a non-rxk-listener mode,
they also implement an rxk-listener mode that we always turn on.

So, just always call rxi_StartListener, and let the ifdef guards for
the various implementations of rxi_StartListener do the right thing.

FIXES 131725

Change-Id: I209a89bda06f2c790aca2682468066c7b0bb7edd
Reviewed-on: http://gerrit.openafs.org/10263
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoAdd config glue for amd64_nbsd70 and i386_nbsd70 sysnames
Jonathan A. Kollasch [Thu, 19 Sep 2013 00:37:32 +0000]
Add config glue for amd64_nbsd70 and i386_nbsd70 sysnames

Change-Id: I2d0b6848f96aab8d68a41fb6d5892284fca987ad
Reviewed-on: http://gerrit.openafs.org/10257
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agolinux: core dump requires write fop
Derrick Brashear [Fri, 13 Sep 2013 15:13:05 +0000]
linux: core dump requires write fop

turns out not just writev is unhappy with aio_write (only); core dumping
wants a write file op. always provide it.

FIXES 131729

Change-Id: If099f83973825981b4c568db7572bf30d399c089
Reviewed-on: http://gerrit.openafs.org/10251
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoafsd: check if mountdir is an absolute path
Christof Hanke [Fri, 13 Sep 2013 09:47:08 +0000]
afsd: check if mountdir is an absolute path

if the mountdir in the cacheinfo file is not absolute,
it can confuse commands like "df". Thus, force it to
be absolute.

Change-Id: Idb098b7c83fef6931fe71dd53a85569a953e5e3f
Reviewed-on: http://gerrit.openafs.org/10250
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoLINUX: Keyring deal with suse-specific key_type op
Christof Hanke [Thu, 12 Sep 2013 07:25:31 +0000]
LINUX: Keyring deal with suse-specific key_type op

instantiate_prep used for checking for
STRUCT_KEY_TYPE_HAS_PREPARSE

Change-Id: Ia7411e85467ba418dfefa5cd7c2d570fe20a5a68
Reviewed-on: http://gerrit.openafs.org/10194
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agotabular output: fix segmentation fault
Christof Hanke [Wed, 4 Sep 2013 12:59:04 +0000]
tabular output: fix segmentation fault

inititalize  Table->numAllocatedRows=0;

Change-Id: I72c6a687fde69cad3bf9aedd43d59d382455045b
Reviewed-on: http://gerrit.openafs.org/10225
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agolibuafs: return error on symlink to self
Derrick Brashear [Tue, 10 Sep 2013 01:27:54 +0000]
libuafs: return error on symlink to self

if we are symlinked to ourself directly, return ELOOP.

Change-Id: I408012c4a9afb6bab0e917677c940f65ad59c697
Reviewed-on: http://gerrit.openafs.org/10240
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agolibuafs: move code for uafs_LookupLink
Derrick Brashear [Tue, 10 Sep 2013 01:22:02 +0000]
libuafs: move code for uafs_LookupLink

in order that we can make a future version static, move the code.

Change-Id: I67e50ef5f14db3567ecd437b694b62b2c8fdb760
Reviewed-on: http://gerrit.openafs.org/10239
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agolibafs: update uio resid in bypasscache
Derrick Brashear [Sun, 8 Sep 2013 04:11:47 +0000]
libafs: update uio resid in bypasscache

when we do a no cache read, we should decrease the resid as we use
up buffer... otherwise we have no idea in the caller how much data
actually got transferred

Change-Id: I50072fddcde1681b3760002d5065b1c2d9b97605
Reviewed-on: http://gerrit.openafs.org/10231
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoclient: flag in cachemanager if rmtsys is enabled
Christof Hanke [Thu, 12 Sep 2013 11:34:04 +0000]
client: flag in cachemanager if rmtsys is enabled

when processing "fs sysname" on a client, a rmtsys-related
checks are executed by default. These prevent a user with gid
2750 and 274i8 (0xabc and 0xabe) from executing this command.
Add a new flag inside the cachemanager for the rmtsys-
functionality. This flag is set through a new ioctl by the afsd
on startup.

Change-Id: Idf95aa81cc1dbb46c70a11b9ae2ccfa04bfb4c4f
Reviewed-on: http://gerrit.openafs.org/10245
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoauth: fix cellservdb update check
Michael Meffie [Sat, 7 Sep 2013 03:58:39 +0000]
auth: fix cellservdb update check

Fix a bug introduced by the check to avoid excessive stats of the
cellservdb.  Fixes a bug where cached cell config data is served for up
to one second after a write.

Check the timeRead field which is reset after a write to indicate the
data should be read.

Fixes commit 0e3bfa033ed230fcb46ad8e3c26c8b7aae6e00af

Change-Id: I209e93a1bc4107a878eefaae92ec0e5e4ada2518
Reviewed-on: http://gerrit.openafs.org/10230
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agolinux: provide read and write ops even when we have aio
Derrick Brashear [Thu, 12 Sep 2013 12:09:34 +0000]
linux: provide read and write ops even when we have aio

read/write will fall back to aio ops but e.g. writev will
fail if there is not either a write or writev op explicitly.

force the fallback via do_sync_read/do_sync_write

required with 2.6.18-348.x rhel kernels but probably not newer ones

Change-Id: I773a8e38df435015e4bc9fc353d930d14b3e6791
Reviewed-on: http://gerrit.openafs.org/10246
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoLinux Keyring error handling
Christof Hanke [Wed, 28 Aug 2013 12:51:13 +0000]
Linux Keyring error handling

honour the returncode of key_instantiate_and_link() to avoid
having non-working pagsh without an error.

Change-Id: Ia62c1c24b22e833cd5dc2689181397965901d34e
Reviewed-on: http://gerrit.openafs.org/10179
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoLinux 3.11: Adapt to d_count changes
Marc Dionne [Tue, 3 Sep 2013 11:55:14 +0000]
Linux 3.11: Adapt to d_count changes

In preparation for upcoming changes in the 3.12 cycle, d_lockref
was introduced late in the 3.11 cycle.  The dentry's d_lock and
d_count are moved to this new structure.  A new d_lock macro makes
the change transparent for locking, but direct users of d_count
must adapt.  A new d_count() helper function is provided and
should now be used.

Use the new d_count() helper function if available, and move
some of the ifdef logic into a helper compatibility function.

Change-Id: I32a21a174d763fb7df8f1e04da3bb7260684571d
Reviewed-on: http://gerrit.openafs.org/10219
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>