openafs.git
6 years agoMake OpenAFS 1.6.22.3 09/13009/2 openafs-stable-1_6_22_3
Stephan Wiesand [Thu, 12 Apr 2018 15:17:10 +0000]
Make OpenAFS 1.6.22.3

Update configure version strings for 1.6.22.3. Note that macos kext
can be of form XXXX.YY[.ZZ[(d|a|b|fc)NNN]] where d dev, a alpha,
b beta, f final candidate so we have no way to represent 1.6.22.3.
Switch to 1.6.23 dev 3 for macOS.

Change-Id: I5ee43eea7eb19c114400e9824a148a5348ef82d6
Reviewed-on: https://gerrit.openafs.org/13009
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoUpdate NEWS for 1.6.22.3 13/13013/3
Stephan Wiesand [Fri, 13 Apr 2018 12:59:15 +0000]
Update NEWS for 1.6.22.3

Release notes for the OpenAFS 1.6.22.3 release

Change-Id: I031b1a6d073a71de8b553d087f8c21af76ace0f0
Reviewed-on: https://gerrit.openafs.org/13013
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: fix RedHat 7.5 ENOTDIR issues 12/13012/2
Mark Vitale [Fri, 2 Mar 2018 04:16:56 +0000]
LINUX: fix RedHat 7.5 ENOTDIR issues

Red Hat Linux 7.5 beta introduces a new file->f_mode flag
FMODE_KABI_ITERATE as a means for certain in-tree filesystems to
indicate that they have implemented file operation iterate() instead of
readdir().  The kernel routine iterate_dir() tests this flag to decide
whether to invoke the file operation iterate() or readdir().

The OpenAFS configure script detects that the file operation iterate()
is available under RH7.5 and so implements iterate() as
afs_linux_readdir().  However, since OpenAFS does not set
FMODE_KABI_ITERATE on any of its files, the kernel's iterate_dir() will
not invoke iterate() for any OpenAFS files.  OpenAFS has also not
implemented readdir(), so iterate_dir() must return -ENOTDIR.

Instead, modify OpenAFS to fall back to readdir() in this case.

Reviewed-on: https://gerrit.openafs.org/12935
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit c818f86b79a636532d396887d4f22cc196c86288)

Reviewed-on: https://gerrit.openafs.org/12950
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit b73863b8d2669830a17c097abf1d846d0108a2f4)

Reviewed-on: https://gerrit.openafs.org/12971
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
(cherry picked from commit a22ad3923d356c49a10e905248066b69be01b8c2)

Change-Id: I5f4d301b4e865a0880513e0b4e027c41659b4f15
Reviewed-on: https://gerrit.openafs.org/13012
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoMake OpenAFS 1.6.22.2 52/12852/2 openafs-stable-1_6_22_2
Stephan Wiesand [Tue, 2 Jan 2018 09:39:58 +0000]
Make OpenAFS 1.6.22.2

Update configure version strings for 1.6.22.2. Note that macos kext
can be of form XXXX.YY[.ZZ[(d|a|b|fc)NNN]] where d dev, a alpha,
b beta, f final candidate so we have no way to represent 1.6.22.2.
Switch to 1.6.23 dev 2 for macOS.

Change-Id: I5cce35759a10b5858c9e04d3243d2efad3505ada
Reviewed-on: https://gerrit.openafs.org/12852
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoUpdate NEWS for 1.6.22.2 69/12869/3
Stephan Wiesand [Fri, 12 Jan 2018 12:42:48 +0000]
Update NEWS for 1.6.22.2

Release notes for OpenAFS 1.6.22.2

Change-Id: I6a994531cb14412cbfbe7e5fa881a1c2b65a4cf3
Reviewed-on: https://gerrit.openafs.org/12869
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: Avoid d_invalidate() during afs_ShakeLooseVCaches() 60/12860/2
Mark Vitale [Fri, 1 Dec 2017 01:26:46 +0000]
LINUX: Avoid d_invalidate() during afs_ShakeLooseVCaches()

With recent changes to d_invalidate's semantics (it returns void in Linux 3.11,
and always returns success in RHEL 7.4), it has become increasingly clear that
d_invalidate() is not the best function for use in our best-effort
(nondisruptive) attempt to free up vcaches that is afs_ShakeLooseVCaches().
The new d_invalidate() semantics always force the invalidation of a directory
dentry, which contradicts our desire to be nondisruptive, especially when
that directory is being used as the current working directory for a process.
Our call to d_invalidate(), intended to merely probe for whether a dentry
can be discarded without affecting other consumers, instead would cause
processes using that dentry as a CWD to receive ENOENT errors from getcwd().

A previous commit (c3bbf0b4444db88192eea4580ac9e9ca3de0d286) tried to address
this issue by calling d_prune_aliases() instead of d_invalidate(), but
d_prune_aliases() does not recursively descend into children of the given
dentry while pruning, leaving it an incomplete solution for our use-case.

To address these issues, modify the shakeloose routine TryEvictDentries() to
call shrink_dcache_parent() and maybe __d_drop() for directories, and
d_prune_aliases() for non-directories, instead of d_invalidate().  (Calls to
d_prune_aliases() for directories have already been removed by reverting commit
c3bbf0b4444db88192eea4580ac9e9ca3de0d286.)

Just like d_invalidate(), shrink_dcache_parent() has been around "forever"
(since pre-git v2.6.12).  Also like d_invalidate(), it "walks" the parent
dentry's subdirectories and "shrinks" (unhashes) unused dentries.  But unlike
d_invalidate(), shrink_dcache_parent() will not unhash an in-use dentry, and
has never changed its signature or semantics.

d_prune_aliases() has also been available "forever", and has also never changed
its signature or semantics.  The lack of recursive descent is not an issue for
non-directories, which cannot have such children.

[kaduk@mit.edu: apply review feedback to fix locking and avoid extraneous
changes, and reword commit message]

Reviewed-on: https://gerrit.openafs.org/12830
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit afbc199f152cc06edc877333f229604c28638d07)

Reviewed-on: https://gerrit.openafs.org/12851
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 4feec06c7bdc7102ae654cff20eb02650ec32800)

Change-Id: Id509e51f027bd96df155e7ed714e0c7dfce126eb
Reviewed-on: https://gerrit.openafs.org/12860
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: consolidate duplicate code in osi_TryEvictDentries 59/12859/2
Mark Vitale [Thu, 30 Nov 2017 22:56:13 +0000]
LINUX: consolidate duplicate code in osi_TryEvictDentries

The two stanzas for HAVE_DCACHE_LOCK are now functionally identical;
remove the preprocessor conditionals and duplicate code.

Minor functional change is incurrred for very old (before 2.6.38) Linux
versions that have dcache_lock; we are now obtaining the d_lock as well.

This is safe because d_lock is also quite old (pre-git, 2.6.12), and it
is a spinlock that's only held for checking d_unhashed.  Therefore, it
should have negligible performance impact.  It cannot cause deadlocks or
violate locking order, because spinlocks can't be held across sleeps.

Reviewed-on: https://gerrit.openafs.org/12792
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@dson.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 5076dfc14b980aed310f3862875d5e9919fa199d)

Reviewed-on: https://gerrit.openafs.org/12850
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 4b633c9681057122b9266b8a775d0ad5aa0a3ac3)

Change-Id: I215712bcfb666db875a2b2615e5c43375d072c3c
Reviewed-on: https://gerrit.openafs.org/12859
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: consolidate duplicate code in canonical_dentry 58/12858/2
Mark Vitale [Thu, 30 Nov 2017 21:51:32 +0000]
LINUX: consolidate duplicate code in canonical_dentry

The two stanzas for HAVE_DCACHE_LOCK are now identical;
remove the preprocessor conditionals and duplicate code.

No functional change should be incurred by this commit.

Reviewed-on: https://gerrit.openafs.org/12791
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 0678ad26b6069040a6ea86866fb59ef5968ea343)

Reviewed-on: https://gerrit.openafs.org/12849
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 16c0dbd7961fb599ed9f29d700d1a713902bd96d)

Change-Id: If37ee5c7c1e95bdc381f1f405087013c39f74b3d
Reviewed-on: https://gerrit.openafs.org/12858
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: add afs_d_alias_lock & _unlock compat wrappers 57/12857/2
Mark Vitale [Thu, 30 Nov 2017 21:46:16 +0000]
LINUX: add afs_d_alias_lock & _unlock compat wrappers

Simplify some #ifdefs for HAVE_DCACHE_LOCK by pushing them down into
new helpers in osi_compat.h.

No functional change should be incurred by this commit.

Reviewed-on: https://gerrit.openafs.org/12790
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 652cd597d9b3cf1a9daccbbf6bf35f1b0cd55a94)

Reviewed-on: https://gerrit.openafs.org/12848
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit c42dea8e0293016ec30fa703956c8bbc5d5cb76d)

Change-Id: I3c2d06f90e113b3917770e7c3d402cb819f13041
Reviewed-on: https://gerrit.openafs.org/12857
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: create afs_linux_dget() compat wrapper 56/12856/2
Mark Vitale [Thu, 30 Nov 2017 21:08:38 +0000]
LINUX: create afs_linux_dget() compat wrapper

For dentry operations that cover multiple dentry aliases of
a single inode, create a compatibility wrapper to hide differences
between the older dget_locked() and the current dget().

No functional change should be incurred by this commit.

Reviewed-on: https://gerrit.openafs.org/12789
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 74f4bfc627c836c12bb7c188b86d570d2afdcae8)

Reviewed-on: https://gerrit.openafs.org/12847
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 0ec02ef73d7b94bbe83e7532524c096799cd4b25)

Change-Id: I8368d67f5bbdc79219f30226e7f56386d78275f3
Reviewed-on: https://gerrit.openafs.org/12856
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoRevert "LINUX: do not use d_invalidate to evict dentries" 55/12855/2
Mark Vitale [Thu, 30 Nov 2017 18:45:27 +0000]
Revert "LINUX: do not use d_invalidate to evict dentries"

Linux recently changed the semantics of d_invalidate() to:
- return void
- invalidate even a current working directory

OpenAFS commit c3bbf0b4444db88192eea4580ac9e9ca3de0d286 switched libafs
to use d_prune_aliases() instead.

However, since that commit, several things have happened:
- RHEL 7.4 changed the semantics of d_invalidate() such that it
  invalidates the cwd, but did NOT change the return type to void.
  This broke our autoconf test for detecting the new semantics.
- Further research reveals that d_prune_aliases() was not the best
  choice for replacing d_invalidate().  This is because for directories,
  d_prune_aliases() doesn't invalidate dentries when they are referenced
  by its children, and it doesn't walk the tree trying to invalidate
  child dentries.  So it can leave dentries dangling, if the only
  references to thos dentries are via children.

In preparation for future commits, revert
c3bbf0b4444db88192eea4580ac9e9ca3de0d286 .

Reviewed-on: https://gerrit.openafs.org/12788
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 367693bd7da2de593e3329f6acc4a4d07621fb97)

Reviewed-on: https://gerrit.openafs.org/12846
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit ae70407fafa3faa94706979c727f53a625939061)

Change-Id: Idb8fe1cb338181d9b6e5f9f2193cd2a6cae8a0b8
Reviewed-on: https://gerrit.openafs.org/12855
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoRevert "LINUX: eliminate unused variable warning" 54/12854/2
Mark Vitale [Thu, 30 Nov 2017 19:04:48 +0000]
Revert "LINUX: eliminate unused variable warning"

This reverts commit 19599b5ef5f7dff2741e13974692fe4a84721b59
to allow also reverting commit
c3bbf0b4444db88192eea4580ac9e9ca3de0d286 .

Reviewed-on: https://gerrit.openafs.org/12787
Reviewed-by: Andrew Deason <adeason@dson.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f8247078bd33a825d8734b2c8f05120d15ab3ffd)

Reviewed-on: https://gerrit.openafs.org/12845
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 2a06e32c398bbb9e74258799d87a599d286f97d9)

Change-Id: I8ce001a5d0bf38e7bc270fb0303e5868dd1464c5
Reviewed-on: https://gerrit.openafs.org/12854
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLinux 4.15: check for 2nd argument to pagevec_init 35/12835/2
Stephan Wiesand [Fri, 22 Dec 2017 13:40:32 +0000]
Linux 4.15: check for 2nd argument to pagevec_init

Linux 4.15 removes the distinction between "hot" and "cold" cache
pages, and pagevec_init() no longer takes a "cold" flag as the
second argument. Add a configure test and use it in osi_vnodeops.c .

Reviewed-on: https://gerrit.openafs.org/12824
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit fb1f14d8ee963678a9caad0538256c99c159c2c4)

Reviewed-on: https://gerrit.openafs.org/12829
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 7a80b4ba67b0d295df72e87da4aa638bd5e245de)

Change-Id: I525d17abe9b57c3017cf9cf76321f25eb819133c
Reviewed-on: https://gerrit.openafs.org/12835
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLinux: use plain page_cache_alloc 34/12834/2
Stephan Wiesand [Fri, 22 Dec 2017 13:17:09 +0000]
Linux: use plain page_cache_alloc

Linux 4.15 removes the distinction between "hot" and "cold" cache
pages, and no longer provides page_cache_alloc_cold(). Simply use
page_cache_alloc() instead, rather than adding yet another test.

Reviewed-on: https://gerrit.openafs.org/12823
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit be5f5b2aff2d59986dd8e7dd7dd531be24c27cb2)

Reviewed-on: https://gerrit.openafs.org/12828
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 2ff3ef2ec6f217195dc50c04ba4e3409c23e6a4d)

Change-Id: Iec018dd6591c0cd477a026efd8817ccea7924dce
Reviewed-on: https://gerrit.openafs.org/12834
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agomacos: make the OpenAFS client aware of APFS 33/12833/2
Marcio Barbosa [Thu, 12 Oct 2017 15:42:40 +0000]
macos: make the OpenAFS client aware of APFS

Apple has introduced a new file system called APFS. Starting from High
Sierra, APFS replaces Mac OS Extended (HFS+) as the default file system
for solid-state drives and other flash storage devices.

The current OpenAFS client is not aware of APFS. As a result, the
installation of the current client into an APFS volume will panic the
machine.

To fix this problem, make the OpenAFS client aware of APFS.

Reviewed-on: https://gerrit.openafs.org/12743
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 6e57b22642bafb177e0931b8fb24042707d6d62f)

Reviewed-on: https://gerrit.openafs.org/12827
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit d9bb508e07f32219679c0e696f07f95e3b48886c)

Change-Id: I4495deb80f946a21dffc6bcac9f3e2f2a45d9590
Reviewed-on: https://gerrit.openafs.org/12833
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agomacos: packaging support for MacOS X 10.13 32/12832/2
Marcio Barbosa [Fri, 6 Oct 2017 13:01:12 +0000]
macos: packaging support for MacOS X 10.13

This commit introduces the new set of changes / files required to
successfully create the dmg installer on OS X 10.13 "High Sierra".

Reviewed-on: https://gerrit.openafs.org/12742
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit e533d0737058940d59d93467c9b4d6d3ec2834e6)

Reviewed-on: https://gerrit.openafs.org/12826
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 5857724bf60e7706bcefde63d8fa0c7b2119e662)

Change-Id: I7b3a3493a78f9741f9e88ae95929960958e5a13d
Reviewed-on: https://gerrit.openafs.org/12832
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agomacos: add support for MacOS 10.13 31/12831/2
Marcio Barbosa [Tue, 3 Oct 2017 20:01:56 +0000]
macos: add support for MacOS 10.13

This commit introduces the new set of changes / files required to
successfully build the OpenAFS source code on OS X 10.13 "High Sierra".

Reviewed-on: https://gerrit.openafs.org/12741
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 804c9cbf501d4ca91b69ad8fd6d64e49efa25a47)

Reviewed-on: https://gerrit.openafs.org/12825
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit ac8cab7fcd3abf76c39e9e08c2c3d6ec0c184837)

Change-Id: If51d4be5b6ca416b9d7738ead287ee2901c0c1e5
Reviewed-on: https://gerrit.openafs.org/12831
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoMake OpenAFS 1.6.22.1 12/12812/2 openafs-stable-1_6_22_1
Stephan Wiesand [Mon, 18 Dec 2017 09:12:41 +0000]
Make OpenAFS 1.6.22.1

Update configure version strings for 1.6.22.1. Note that macos kext
can be of form XXXX.YY[.ZZ[(d|a|b|fc)NNN]] where d dev, a alpha,
b beta, f final candidate so we have no way to represent 1.6.22.1.
Switch to 1.6.23 dev 1 for macOs.

Change-Id: Iabcbbf782d4cd7951011bc760f565114e2580d97
Reviewed-on: https://gerrit.openafs.org/12812
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoUpdate NEWS for 1.6.22.1 17/12817/2
Stephan Wiesand [Wed, 20 Dec 2017 13:21:15 +0000]
Update NEWS for 1.6.22.1

Release notes for OpenAFS 1.6.22.1

Change-Id: I0069f17eb9ff20e7d7537f91a3dea75b31bb2156
Reviewed-on: https://gerrit.openafs.org/12817
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoCorrect m4 conditionals in curses.m4 40/12740/2
Benjamin Kaduk [Mon, 16 Oct 2017 21:53:22 +0000]
Correct m4 conditionals in curses.m4

AS_IF does not invoke the test(1) shell builtin for us, so we must
take care to consistently use it ourself.

While here, sprinkle some missing double-quotes around variable
expansions in AS_IF statements in this file.

Submitted by Bastian Beischer.

FIXES 134414

Change-Id: Iccfe311011f17de6317cf64abdc58b0812b81b8c
Reviewed-on: https://gerrit.openafs.org/12738
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit e0c5ada214596d5adb6798682d5e280cc99f447c)
Reviewed-on: https://gerrit.openafs.org/12739
(cherry picked from commit bc384b7d5e4818c567a64fe4a935f021d936444f)
Reviewed-on: https://gerrit.openafs.org/12740
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agovol: add missing include of stdint.h to volinodes.h 24/12724/2
Michael Laß [Tue, 12 Sep 2017 17:33:15 +0000]
vol: add missing include of stdint.h to volinodes.h

volinodes.h requires stdint.h for use of uintptr_t:

In file included from vutil.c:55:0:
volinodes.h: In function 'init_inode_info':
volinodes.h:109:45: error: 'uintptr_t' undeclared (first use in this function); did you mean 'intptr_t'?
  stuff[i].inode = (Inode*)((char*)header + (uintptr_t)stuff[i].inode);
                                             ^~~~~~~~~
                                             intptr_t

Similar changes have been applied earlier in 1e53da3.

This change does not apply to master since e2b4fde added an include of roken.h
to all affected source files which in turn includes stdint.h.

Change-Id: Iddd174e844583e06f66d910052e11feff928ba40
Reviewed-on: https://gerrit.openafs.org/12724
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Tested-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoFix macro used to check kernel_read() argument order 10/12810/2
Benjamin Kaduk [Fri, 15 Dec 2017 01:54:57 +0000]
Fix macro used to check kernel_read() argument order

The m4 macro implementing the configure check is called
LINUX_KERNEL_READ_OFFSET_IS_LAST, but it defines a preprocessor symbol
that is just KERNEL_READ_OFFSET_IS_LAST.  Our code needs to check
for the latter being defined, not the former.

Reported by Aaron Ucko.

Reviewed-on: https://gerrit.openafs.org/12808
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit edc5463f3db4b6af2307741d9f4ee8f2c81cd98e)

Reviewed-on: https://gerrit.openafs.org/12809
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 383688fa0d6904291578eb1f9a7c2ec1e06f54ca)

Change-Id: I8fca8c32ec1f255bf5f5a37f44a39901af34408b
Reviewed-on: https://gerrit.openafs.org/12810
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoafs: fix kernel_write / kernel_read arguments 97/12797/2
Marcio Barbosa [Thu, 16 Nov 2017 22:24:03 +0000]
afs: fix kernel_write / kernel_read arguments

The order / content of the arguments passed to kernel_write and
kernel_read are not right. As a result, the kernel will panic if one of
the functions in question is called.

[kaduk@mit.edu: include configure check for multiple kernel_read()
variants, per linux commits bdd1d2d3d251c65b74ac4493e08db18971c09240
and e13ec939e96b13e664bb6cee361cc976a0ee621a]

FIXES 134440

Reviewed-on: https://gerrit.openafs.org/12769
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 3ce55426ee6912b78460465bcaa1428333ad1fbc)

Reviewed-on: https://gerrit.openafs.org/12780
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit ad11867973dc2481ee4897540a6d9279ebf36c42)

Change-Id: I9b66e174fea2d1ba18a95a12664c966c05e301e2
Reviewed-on: https://gerrit.openafs.org/12797
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLinux: Use kernel_read/kernel_write when __vfs variants are unavailable 59/12759/2
Damien Diederen [Mon, 18 Sep 2017 10:18:39 +0000]
Linux: Use kernel_read/kernel_write when __vfs variants are unavailable

We hide the uses of set_fs/get_fs behind a macro, as those functions
are likely to soon become unavailable:

> Christoph Hellwig suggested removing all calls outside of the core
> filesystem and architecture code; Andy Lutomirski went one step
> further and said they should all go.

    https://lwn.net/Articles/722267/

Reviewed-on: https://gerrit.openafs.org/12729
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 5ee516b3789d3545f3d78fb3aba2480308359945)

Reviewed-on: https://gerrit.openafs.org/12737
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit d93f80622370f50d7bce5c5b00cd062f15ee9eba)

Change-Id: Ib4515c858d0a06d3706ec7de212c35551d3e7240
Reviewed-on: https://gerrit.openafs.org/12759
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Christof Hanke <christof.hanke@rzg.mpg.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLinux: Test for __vfs_write rather than __vfs_read 58/12758/2
Damien Diederen [Mon, 18 Sep 2017 09:59:40 +0000]
Linux: Test for __vfs_write rather than __vfs_read

The following commit:

    commit eb031849d52e61d24ba54e9d27553189ff328174
    Author: Christoph Hellwig <hch@lst.de>
    Date:   Fri Sep 1 17:39:23 2017 +0200

        fs: unexport __vfs_read/__vfs_write

unexports both __vfs_read and __vfs_write, but keeps the former in
fs.h--as it is is still being used by another part of the tree.

This situation results in a false positive in our Autoconf check,
which does not see the export statements, and ends up marking the
corresponding API as available.

That, in turn, causes some code which assumes symmetry with
__vfs_write to fail to compile.

Switch to testing for __vfs_write, which correctly marks the API as
unavailable.

Reviewed-on: https://gerrit.openafs.org/12728
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 929e77a886fc9853ee292ba1aa52a920c454e94b)

Reviewed-on: https://gerrit.openafs.org/12736
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit c42a25d28fbcc76fdcac2b5f29704f8f1b353b45)

Change-Id: I27c1c67bed6ebb922389ebb70cbb7fc238378b58
Reviewed-on: https://gerrit.openafs.org/12758
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoMake OpenAFS 1.6.22 openafs-stable-1_6_22
Benjamin Kaduk [Tue, 5 Dec 2017 01:41:36 +0000]
Make OpenAFS 1.6.22

Update version strings for release 1.6.22.

Change-Id: I7c7f6376cbe4666a1da2fc4cb748067666cd541a

6 years agoUpdate NEWS for 1.6.22
Benjamin Kaduk [Tue, 5 Dec 2017 01:39:50 +0000]
Update NEWS for 1.6.22

Release notes for OpenAFS 1.6.22

Change-Id: I454c736030c9b47823fc36f7e28a16025165cd87

6 years agoOPENAFS-SA-2017-001: rx: Sanity-check received MTU and twind values
Benjamin Kaduk [Mon, 4 Dec 2017 23:20:57 +0000]
OPENAFS-SA-2017-001: rx: Sanity-check received MTU and twind values

Rather than blindly trusting the values received in the
(unauthenticated) ack packet trailer, apply some minmial sanity checks
to received values.  natMTU and regular MTU values are subject to
Rx minmium/maximum packet sizes, and the transmit window cannot drop
below one without risk of deadlock.

The maxDgramPackets value that can also be present in the trailer
already has sufficient sanity checking.

Extremely low MTU values (less than 28 == RX_HEADER_SIZE) can cause us
to set a negative "maximum usable data" size that gets used as an
(unsigned) packet length for subsequent allocation and computation,
triggering an assertion when the connection is used to transmit data.

FIXES 134450

(cherry picked from commit 894555f93a2571146cb9ca07140eb98c7a424b01)
(cherry picked from commit eae2575dc738bd69bb6a0a84f87f02f5cf2b4eb9)

Change-Id: Ic83c2eef69a9f59a0f0b1469681aaef9f42b0a18

6 years agoMake OpenAFS 1.6.21.1 13/12713/3 openafs-stable-1_6_21_1
Stephan Wiesand [Wed, 23 Aug 2017 14:33:26 +0000]
Make OpenAFS 1.6.21.1

Update configure version strings for 1.6.21.1. Note that macos kext
can be of form XXXX.YY[.ZZ[(d|a|b|fc)NNN]] where d dev, a alpha,
b beta, f final candidate so we have no way to represent 1.6.21.1.
Switch to 1.6.22 dev 1 for macOs.

Change-Id: I73ebd481fdfe0d096b67138d4cb0f7b0d53e9e59
Reviewed-on: https://gerrit.openafs.org/12713
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoUpdate NEWS again for 1.6.21.1 26/12726/3
Stephan Wiesand [Wed, 20 Sep 2017 17:33:15 +0000]
Update NEWS again for 1.6.21.1

We decided to include the fix for kernel 4.12+ on s390 today. Reflect
this in the release notes.

Change-Id: Ib73b157c2ec437ac4fd0f4cd0df8ea22da7abf7f
Reviewed-on: https://gerrit.openafs.org/12726
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLinux: Include linux/uaccess.h rather than asm/uaccess.h if present 17/12717/3
Seth Forshee [Tue, 22 Aug 2017 12:59:11 +0000]
Linux: Include linux/uaccess.h rather than asm/uaccess.h if present

Starting with Linux 4.12 there is a module build error on s390
due to asm/uaccess.h using a macro defined in the common header.
The common header has been around since 2.6.18 and has always
included asm/uaccess.h, so switch to using the common header
whenever it is present.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-on: https://gerrit.openafs.org/12714
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 962f4838dc461567d896304f617a0923745d13d5)

Reviewed-on: https://gerrit.openafs.org/12718
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 7073408688da021864bba59c592e8924e05adb91)

Change-Id: Ie58cfcf48aa80c18f19cbfc65f87363b154e96ee
Reviewed-on: https://gerrit.openafs.org/12717
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoUpdate NEWS for 1.6.21.1 25/12725/2
Stephan Wiesand [Tue, 19 Sep 2017 13:32:31 +0000]
Update NEWS for 1.6.21.1

Add release notes for OpenAFS 1.6.21.1

Change-Id: Ibbf3dd6e69c7ded1f64197b22de92d78b4b9d5c7
Reviewed-on: https://gerrit.openafs.org/12725
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLinux 4.13: use designated initializers where required 64/12664/2
Stephan Wiesand [Mon, 24 Jul 2017 09:37:54 +0000]
Linux 4.13: use designated initializers where required

struct path is declared with the "designated_init" attribute,
and module builds now use -Werror=designated-init. Cope.

And as pointed out by Michael Meffie, struct ctl_table has
the same requirement now, so use a designated initializer
for the final element of the sysctl table too.

Reviewed-on: https://gerrit.openafs.org/12663
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit d55b41072ce873210481baa4cae5c7143011869b)

Change-Id: I9797f8b1e16ab095775c53ac03e258affaa4d303
Reviewed-on: https://gerrit.openafs.org/12664
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Tested-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoMake OpenAFS 1.6.21 49/12649/2 openafs-stable-1_6_21
Stephan Wiesand [Tue, 4 Jul 2017 08:57:09 +0000]
Make OpenAFS 1.6.21

Update version strings for the 1.6.21 release.

Change-Id: I27569473ad9b988829bb517419d3d04f4cfa8c0f
Reviewed-on: https://gerrit.openafs.org/12649
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoUpdate NEWS for 1.6.21 35/12635/2
Stephan Wiesand [Thu, 8 Jun 2017 16:14:40 +0000]
Update NEWS for 1.6.21

Finalize the 1.6.21 release notes

Change-Id: I09974201c8155dc697abbf29079e5ceb2a74e629
Reviewed-on: https://gerrit.openafs.org/12635
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoMake OpenAFS 1.6.21pre1 03/12603/2 openafs-stable-1_6_21pre1
Stephan Wiesand [Wed, 19 Apr 2017 13:55:02 +0000]
Make OpenAFS 1.6.21pre1

Update version strings for the first 1.6.21 prerelease.

Change-Id: I700f0b110373e47f2f471f30ba8eefe9a3b6cf4f
Reviewed-on: https://gerrit.openafs.org/12603
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoUpdate NEWS for 1.6.21pre1 34/12634/4
Stephan Wiesand [Wed, 7 Jun 2017 13:09:04 +0000]
Update NEWS for 1.6.21pre1

Release notes for the first OpenAFS 1.6.21 prerelease

Change-Id: I9d01bd7856574e2c3da872854a5bffeac2119f3e
Reviewed-on: https://gerrit.openafs.org/12634
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agovol: modify volume updateDate upon salvage change 33/12633/2
Jeffrey Altman [Fri, 2 Jun 2017 02:25:49 +0000]
vol: modify volume updateDate upon salvage change

If the salvager changed the volume, set the VolumeDiskData.updateDate
field so that

  1. the change is visible via "vos examine"

  2. backup services will backup the corrected volume

Teradactyl pointed out the problem which forces cell administrators
to manually trigger a backup for each volume that has been salvaged.

Reviewed-on: https://gerrit.openafs.org/12629
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit cdb92f94598e5b25fbcdfc6fb1650218ec05d63f)

Change-Id: I0ecf0bf52a78cd6e1de4e79fc4a33cb509a816f5
Reviewed-on: https://gerrit.openafs.org/12633
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agolibafs: remove linux conditionals for md5 inode number calculation 32/12632/2
Michael Meffie [Wed, 29 Apr 2015 15:54:45 +0000]
libafs: remove linux conditionals for md5 inode number calculation

Remove the conditionals which hide the md5 digest calculation for inode
numbers on non-linux platforms.  This feature was originally added to
support sites running on linux, but is generally useful and the
implementation is not specific to linux.

Reviewed-on: http://gerrit.openafs.org/11854
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit ac05e8ceebd05c2d8496759e70cf7b1b92541134)

Change-Id: I8fd613c436120a6436f48920ce4f33570dfb1fb8
Reviewed-on: https://gerrit.openafs.org/12632
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agobozo: do not fail silently on unknown bosserver options 31/12631/2
Michael Meffie [Fri, 2 Jun 2017 19:19:26 +0000]
bozo: do not fail silently on unknown bosserver options

Instead of failing silently when the bosserver is started with an
unknown option, print an error message and exit with a non-zero value.
Continue to exit with 0 when the -help option is given to request the
usage message.

This change should help make bosserver startup failures more obvious
when an unsupported option is specified. Example systemd status message:

   systemd[1]: Starting OpenAFS Server Service...
   bosserver[32308]: Unrecognized option: -bogus
   bosserver[32308]: Usage: bosserver [-noauth] ....
   systemd[1]: openafs-server.service: main process exited,
               code=exited, status=1/FAILURE

Reviewed-on: https://gerrit.openafs.org/12630
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f5491119ff7d422b1c0c311a50e30bec1c15296c)

Change-Id: I5c3ffbb21915fd0a2773873e360cee85504796f8
Reviewed-on: https://gerrit.openafs.org/12631
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: Switch to new bdi api for 4.12. 26/12626/2
Joe Gorse [Tue, 16 May 2017 07:29:30 +0000]
LINUX: Switch to new bdi api for 4.12.

super_setup_bdi() dynamically allocates backing_dev_info structures
for filesystems and cleans them up on superblock destruction.

Appears with Linux commit fca39346a55bb7196888ffc77d9e3557340d1d0b
Author: Jan Kara <jack@suse.cz>
Date:   Wed Apr 12 12:24:28 2017 +0200

Reviewed-on: https://gerrit.openafs.org/12614
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 63e530e7df0b8013bcc4421b0bba558d4f1d2d57)

Change-Id: I48a49ee8852bf842c24e7df0609fe2184bf45d90
Reviewed-on: https://gerrit.openafs.org/12626
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agorx: wake up send after 'twind' has been updated 27/12627/2
Jeffrey Altman [Sat, 27 May 2017 18:59:04 +0000]
rx: wake up send after 'twind' has been updated

Beginning in AFS 3.4 and 3.5 the ack trailer includes the size of the
peer's receive window.  This value is used to update the sender's
transmit window (twind).  When the twind is increased the application
thread is signaled to indicate that more packets can be sent.

This change wakes the application thread after twind is updated by
the peer's receive window instead of beforehand.  Failure to do so
can result in 100ms transmit delays when the receive window transitions
from closed to open.

Reviewed-on: https://gerrit.openafs.org/12625
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit aaa47dc1077f0dd5b0040006c831f64cc8a303b5)

Change-Id: Icfbe10f93a34adfb14f5c34198f78b67aa043c53
Reviewed-on: https://gerrit.openafs.org/12627
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: CURRENT_TIME macro goes away. 24/12624/2
Joe Gorse [Wed, 10 May 2017 19:46:38 +0000]
LINUX: CURRENT_TIME macro goes away.

Check if the macro exists, define it if it does not.

Reviewed-on: https://gerrit.openafs.org/12611
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit b47dc5482da614742b01dcc62d5e11d766a9432f)

Change-Id: I1ed3706e830b98436a5a22d99fa338b01fd5b997
Reviewed-on: https://gerrit.openafs.org/12624
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoafs: add afsd -inumcalc option 08/12608/4
Michael Meffie [Wed, 29 Apr 2015 16:00:24 +0000]
afs: add afsd -inumcalc option

This commit adds the afsd -inumcalc command line switch to specify the
inode number calculation method in a platform neutral way.

Inode numbers reported for files within the AFS filesystem are generated
by the cache manager using a calculation which derives a number from a
FID. Long ago, a new type of calculation was added which generates inode
numbers using a MD5 message digest of the FID.  The MD5 inode number
calculation variant is computationally more expensive but greatly
reduces the chances for inode number collisions.

The MD5 calculation can be enabled on the Linux cache manager using the
Linux sysctl interface.  Other than the sysctl method of selecting the
inode calculation type, the MD5 inode number calculation method is not
specific to Linux.

This change introduces a command-line option which accepts a value to
indicate the calculation method, instead of a simple flag to enable MD5
inode numbers.  This should allow for new inode calculation methods
in the future without the need for additional afsd command-line flags.

Two values are currently accepted for -inumcalc. The value of 'compat'
specifies the legacy inode number calculation. The value 'md5' indicates
that the new MD5 calculation is to be used.

Reviewed-on: https://gerrit.openafs.org/11855
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 0028ea92ad3e7aac6a4c51f63703a4d9d7b9dcd6)

Change-Id: I9021eea9f64c754157061d039f63b6f744ec2ec5
Reviewed-on: https://gerrit.openafs.org/12608
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoclient: flag in cachemanager if rmtsys is enabled 07/12607/3
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
2748 and 2750 (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.

Reviewed-on: http://gerrit.openafs.org/10245
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit db1de98ecf6fd22b9c36b3ba284984f03cb0ae35)

Change-Id: Ia2a367e4675782a681b4f6efd6365da482adfab8
Reviewed-on: https://gerrit.openafs.org/12607
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoafs: release the packets used by rx on shutdown 02/12602/2
Marcio Barbosa [Tue, 18 Apr 2017 20:04:13 +0000]
afs: release the packets used by rx on shutdown

When the OpenAFS client is unmounted on DARWIN, the blocks of packets
allocated by RX are released. Historically, the memory used by those
packets was never properly released.

Before 230dcebcd61064cc9aab6d20d34ff866a5c575ea, only the last block of
packets used to be released:

...
struct rx_packet *rx_mallocedP = 0;
...
void
rxi_MorePackets(int apackets)
{
    ...
    getme = apackets * sizeof(struct rx_packet);
    p = rx_mallocedP = (struct rx_packet *)osi_Alloc(getme);
    ...
}
...
void
rxi_FreeAllPackets(void)
{
    ...
    osi_Free(rx_mallocedP, ...);
    ...
}
...

As we can see, ‘rx_mallocedP’ is a global pointer that stores the
first address of the last allocated block of packets. As a result, when
‘rxi_FreeAllPackets’ is called, only the last block is released.

However, 230dcebcd61064cc9aab6d20d34ff866a5c575ea moved the global
pointer in question to the end of the last block. As a result, when the
OpenAFS client is unmounted on DARWIN, the ‘rxi_FreeAllPackets’
function releases the wrong block of memory. This problem was exposed
on OS X 10.12 Sierra where the system crashes when the OpenAFS client
is unmounted.

To fix this problem, store the address of every single block of packets
in a queue and release one by one when the OpenAFS client is unmounted.

Reviewed-on: https://gerrit.openafs.org/12427
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 5b28061fb593f5f48df549b07f0ccd848348b93c)

Change-Id: Id8606b1c1444861df69ed4af8169e343964a691d
Reviewed-on: https://gerrit.openafs.org/12602
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agovol: detach offline volumes on dafs 69/12569/2
Marcio Barbosa [Tue, 31 Jan 2017 14:43:18 +0000]
vol: detach offline volumes on dafs

Taking a volume offline always clears the inService bit. Taking a
volume out of service also takes it offline. Therefore, if the
inService flag is false, the volume in question should be offline.
On dafs, an offline volume should be unattached.

The attach2() function does not change the state of the volume received
as an argument to unattached when the inService flag is false. Instead,
this function changes the state of the volume in question to
pre-attached and returns VNOVOL to the client. As result, subsequent
accesses to this volume will make the server try and fail to attach
this offline volume over and over again, writing to the FileLog each
time.

To fix this problem, detach the volume received as an argument if the
inService flag is false. Since the new state of this volume will be
unattached, subsequent accesses will not hit attach2().

This situation where a volume is not offline but is also not in service
can occur if a volume is taken offline with vos offline and some time
later the DAFS fileserver is shutdown and restarted; the volume is
placed into the preattach state by default when the server restarts.
Each access to the volume by clients then causes the fileserver to
attempt to attach the volume, which fails, since the in-service flag in
the volume header is false from the previous vos offline.  The
fileserver will log a warning to the FileLog on each attempt to attach
the volume, and this will fill the FileLog with duplicate messages
corresponding to the number of attempted accesses.

Reviewed-on: https://gerrit.openafs.org/12515
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 2421da2bf327525216ec7e79b9aa81fa2c4f77d5)

Change-Id: I95cffb6a91797341d9202cbbef3b205c11348d5e
Reviewed-on: https://gerrit.openafs.org/12569
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoDAFS: do not save or restore host state if CPS in progress 68/12568/2
Mark Vitale [Tue, 21 Feb 2017 01:16:47 +0000]
DAFS: do not save or restore host state if CPS in progress

If a fileserver is shutdown while one or more PR_GetHostCPS calls
are in progress, this state is saved in the fsstate.dat file as
hostFlags HCPS_WAITING, HCPS_INPROGRESS.  Other hosts that are
merely waiting will have HCPS_WAITING recorded.

However, it makes no sense to restore host structs in this state,
because the GetCPS calls will no longer be in progress.  Once these
hosts become active, they will block server threads and quickly cause
all server threads to be exhausted as other CPS requests are blocked
behind them.

Instead, exclude these states from both save and restore.

Reviewed-on: https://gerrit.openafs.org/12561
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 38a3f51fb8b3910ecdd7cacb06f35ec681990aea)

Change-Id: I0e02543fd2e547fcc9f95db0973f09e5951a1da1
Reviewed-on: https://gerrit.openafs.org/12568
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoafs: fs getcacheparms miscounts dcaches for large files 05/12605/2
Mark Vitale [Tue, 12 Jan 2016 23:06:51 +0000]
afs: fs getcacheparms miscounts dcaches for large files

fs getcacheparms issued with the -excessive option tabulates in-memory
dcaches ("DCentries") by size.  However, any dcache with validPos > 2^31
is miscounted in the 4k-16k bucket.  This is caused by a type mismatch
between 'validPos' (afs_size_t) and 'size' (int) which leads to a
negative value for size by sign-extension.  The size comparison "sieve"
fails for negative numbers; it skips the first bucket (0-4K) and dumps
them in the second one (4k-16k).

Move the declaration of 'size' closer to its use, and declare it with
the same type as 'validPos' (afs_size_t) so the comparison sieve
correctly places these dcaches in the last (>=1M) bucket.

Reviewed-on: https://gerrit.openafs.org/12347
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit b5e4e8c14130f601bbf43dee5927222ebf7613fa)

Change-Id: I659fd86f05b29c1eac1a262d340bcc1ce2640797
Reviewed-on: https://gerrit.openafs.org/12605
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoafs: fs getcacheparms miscounts zero-length dcaches 04/12604/2
Mark Vitale [Tue, 12 Jan 2016 22:50:36 +0000]
afs: fs getcacheparms miscounts zero-length dcaches

When fs getcacheparms is issued with the -excessive option, it
tabulates all in-memory dcaches ("DCentries") by size.

dcaches with validPos == 0 were being tabulated in the 4k-16k bucket.

Fix the first comparison in the 'sieve' so these dcaches will be counted
in the correct 0-4k bucket instead.

Introduced by commit 176c2fddb95ced6c13e04e7492fc09b5551f273c

Reviewed-on: https://gerrit.openafs.org/12346
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit c966c0b8414ef0a041b1a8d5261c9eccd4d39d99)

Change-Id: I53a20644f549550cef85f0cc6f3551ed5dbe1e23
Reviewed-on: https://gerrit.openafs.org/12604
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agodoc: clarify the fs wscell manpage 59/12559/2
Stephan Wiesand [Thu, 2 Mar 2017 11:52:10 +0000]
doc: clarify the fs wscell manpage

What's displayed by fs wscell is not necessarily the current content
of ThisCell, but that at the time of starting the client. Say so.

FIXES 133339

Reviewed-on: https://gerrit.openafs.org/12537
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit bd15a5f56fde98983464acf5fd4cdd731d206d9f)

Change-Id: I47d7b92488b1166934a1704765c0f1e914a178a8
Reviewed-on: https://gerrit.openafs.org/12559
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoubik: SVOTE_Beacon should hold the DB lock for CheckTid 16/12516/2
Marc Dionne [Sat, 29 Jan 2011 17:09:30 +0000]
ubik: SVOTE_Beacon should hold the DB lock for CheckTid

Reviewed-on: https://gerrit.openafs.org/4262
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5548f6540557795ded65a52c7066839c5eef468f)

Change-Id: I0d4a4d5e796bc6cb731f00db34cc0776f746ca85
Reviewed-on: https://gerrit.openafs.org/12516
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agodoc: update information about vlserver logging 77/12477/2
Michael Meffie [Thu, 7 Jul 2016 19:51:18 +0000]
doc: update information about vlserver logging

Mention the vlserver -d option can be used to set the initial logging
level.

Thanks to Mark Vitale for the suggestion.

Reviewed-on: https://gerrit.openafs.org/12324
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f5f057ce8198480fb9c67f2a8c8eee906f8a7c4a)

Change-Id: Iaa0f10d020d3993fe92690c860cdad03605d31ec
Reviewed-on: https://gerrit.openafs.org/12477
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: eliminate unused variable warning 13/12513/2
Mark Vitale [Sat, 7 Jan 2017 11:22:47 +0000]
LINUX: eliminate unused variable warning

Commit c3bbf0b4444db88192eea4580ac9e9ca3de0d286 added routine
osi_TryEvictDentries and included new logic for D_INVALIDATE_IS_VOID.
Unfortunately, this new code path no longer uses dentry; it also should
have been made conditional at that time.

Wrap the declaration of dentry in #ifndef D_INVALIDATE_IS_VOID to
eliminate the unused variable warning.

Reviewed-on: https://gerrit.openafs.org/12505
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 19599b5ef5f7dff2741e13974692fe4a84721b59)

Change-Id: Ic15df733fcbccfaf9870ecd335bb2d549ab0d43d
Reviewed-on: https://gerrit.openafs.org/12513
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoafs: shake harder in shake-loose-vcaches 51/12451/2
Michael Meffie [Thu, 27 Aug 2015 17:06:05 +0000]
afs: shake harder in shake-loose-vcaches

Linux based cache managers will allocate vcaches on demand and
deallocate batches of vcaches in the background. This feature is called
dynamic vcaches.

Vcaches to be deallocated are found by traversing the vcache LRU list
(VLRU) from the oldest vcache to the newest. Up to a target number of
vcaches are attempted to be evicted.  The afs_xvcache lock protecting
the VLRU may be dropped and re-acquired while attempting to evict a
vcache. When this happens, it is possible the VLRU may have changed, so
the traversal of the VLRU is restarted.  This restarting of the VLRU
transversal is limited to 100 iterations to avoid looping indefinitely.

Vcaches which are busy cannot be evicted and remain in the VLRU. When a
busy cache was not evicted and the afs_xvache lock was dropped, the VLRU
traversal is restarted from the end of the VLRU. When the busy vcache is
encountered on the retry, it will trigger additional retries until the
loop limit is reached, at which point the target number of vcaches will
not be deallocated.

This can leave a very large number of unbusy vcaches which are never
deallocated.  On a busy machine, tens of millions of unused vcaches can
remain in memory. When the busy vcache at the end of the VLRU is finally
evicted, the log jam is broken, and the background deamon will hold the
afs_xvcache lock for an excessively long time, hanging the system.

Fix this by moving busy vcaches to the head of the VLRU before
restarting the VLRU traversal. These busy vcaches will be skipped when
retrying the VLRU traversal, allowing the cache manager to make progress
deallocating vcaches down to the target level.

This was already done on the mac osx platform while attempting to evict
vcaches. Move the code to move busy vcaches to the head of the VLRU up
the the platform agnostic caller.

Thanks to Andrew Deason for the initial version of this patch.

Reviewed-on: https://gerrit.openafs.org/11654
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 5c136c7d93ed97166f39bf716cc7f5d579b70677)

Change-Id: If60b1889d012a739aa5b43e842abb80a6ebfdb6a
Reviewed-on: https://gerrit.openafs.org/12451
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: do not use d_invalidate to evict dentries 50/12450/2
Mark Vitale [Thu, 4 Aug 2016 22:42:27 +0000]
LINUX: do not use d_invalidate to evict dentries

When working within the AFS filespace, commands which access large
numbers of OpenAFS files (e.g., git operations and builds) may result in
active files (e.g., the current working directory) being evicted from the
dentry cache.  One symptom of this is the following message upon return
to the shell prompt:

"fatal: unable to get current working directory: No such file or
directory"

Starting with Linux 3.18, d_invalidate returns void because it always
succeeds.  Commit a42f01d5ebb13da575b3123800ee6990743155ab adapted
OpenAFS to cope with the new return type, but not with the changed
semantics of d_invalidate.  Because d_invalidate can no longer fail with
-EBUSY when invoked on an in-use dentry. OpenAFS must no longer trust it
to preserve in-use dentries.

Modify the dentry eviction code to use a method (d_prune_aliases) that
does not evict in-use dentries.

Reviewed-on: https://gerrit.openafs.org/12363
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit c3bbf0b4444db88192eea4580ac9e9ca3de0d286)

Change-Id: Ic72a280f136cc414b54d4b8ec280f225290df122
Reviewed-on: https://gerrit.openafs.org/12450
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoReformat src/afs/LINUX/osi_vcache.c 49/12449/2
Benjamin Kaduk [Thu, 27 Oct 2016 22:27:26 +0000]
Reformat src/afs/LINUX/osi_vcache.c

Apply the GNU indent options from CODING, with manual adjustments
to leave jump labels in column zero.

Also rename and mark static a function-local helper function.

Reviewed-on: https://gerrit.openafs.org/12422
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 22933e02e2510f25b79230964f135571c7bfe710)

Change-Id: I9fb2886ae2213218ae80ea9d5b80540b9c79077b
Reviewed-on: https://gerrit.openafs.org/12449
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: split dentry eviction from osi_TryEvictVCache 48/12448/2
Mark Vitale [Thu, 4 Aug 2016 22:18:15 +0000]
LINUX: split dentry eviction from osi_TryEvictVCache

To make osi_TryEvictVCache clearer, and to prepare for a future change
in dentry eviction, split the dentry eviction logic into its own routine
osi_TryEvictDentries.

No functional difference should be incurred by this commit.

Reviewed-on: https://gerrit.openafs.org/12362
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
(cherry picked from commit 742643e306929ac979ab69515a33ee2a3f2fa3fa)

Change-Id: I750fc7606ca56e784a60bdbc13a32d21fe307429
Reviewed-on: https://gerrit.openafs.org/12448
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agodoc: correct help for 'bos getlog' -restricted mode 76/12476/2
Mark Vitale [Mon, 21 Nov 2016 18:25:40 +0000]
doc: correct help for 'bos getlog' -restricted mode

Commit f085951d39c0d6c1e6a626177c30235704317600 introduced an error in
the bos getlog helpfile.

Modify the helpfile to describe the actual restrictions imposed by
-restricted mode.

Reviewed-on: https://gerrit.openafs.org/12454
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 3af0460a4a6d7bf22e1789fd9e375659e20c3a55)

Change-Id: Ifa544c322e67da712a0bc96b3797e51786e4d399
Reviewed-on: https://gerrit.openafs.org/12476
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoUpdate NEWS again for 1.6.20.2 91/12591/4 openafs-stable-1_6_20_2
Stephan Wiesand [Wed, 5 Apr 2017 14:41:43 +0000]
Update NEWS again for 1.6.20.2

Finalize the 1.6.20.2 release notes, including a few late additions.

Change-Id: I32a394e4af700d52f487e0db528ed261e4c2131b
Reviewed-on: https://gerrit.openafs.org/12591
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux: only include cred.h if it exists 98/12598/2
Stephan Wiesand [Tue, 11 Apr 2017 09:58:55 +0000]
Linux: only include cred.h if it exists

Commit c89fd17df1032ec2eacc0d0c9b73e19c5e8db7d2 introduced an explicit
include of linux/cred.h since the latest kernel no longer includes it
implicitly in sched.h. Alas, older kernels (like 2.6.18) don't have this
file. Add a configure test for the existence of cred.h and only include
it if actually present.

Reviewed-on: https://gerrit.openafs.org/12593
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 6b7b4239ab22fbb301e3b50e2ca4072445ba4e9e)

Change-Id: I64970ba471180d32fa5af5445e7604bbe8511b32
Reviewed-on: https://gerrit.openafs.org/12598
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux v4.11: cred.h is no longer included in sched.h 90/12590/2
Mark Vitale [Fri, 24 Mar 2017 01:36:44 +0000]
Linux v4.11: cred.h is no longer included in sched.h

With Linux commit e26512fea5bcd6602dbf02a551ed073cd4529449, cred.h is no
longer included in sched.h.

Several components of libafs which require cred.h were picking it by
including sched.h.

Instead, explicitly add an include for cred.h. cred.h begins with a
customary one-shot to prevent multiple loads:

 #ifndef _LINUX_CRED_H
 #define _LINUX_CRED_H

Therefore we don't need a new autoconf test or preprocessor conditional
to prevent redundant includes on older Linux releases.

Reviewed-on: https://gerrit.openafs.org/12574
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: Joe Gorse <jhgorse@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
(cherry picked from commit c89fd17df1032ec2eacc0d0c9b73e19c5e8db7d2)

Change-Id: I235a6272c55a8f734be07b578bbb1a324cf34e2e
Reviewed-on: https://gerrit.openafs.org/12590
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux v4.11: signal stuff moved to sched/signal.h 89/12589/2
Mark Vitale [Thu, 23 Mar 2017 22:10:03 +0000]
Linux v4.11: signal stuff moved to sched/signal.h

In Linux commit c3edc4010e9d102eb7b8f17d15c2ebc425fed63c, signal_struct
and other signal handling declarations were moved from sched.h to
sched/signal.h.

This breaks existing OpenAFS autoconf tests for recalc_sigpending() and
task_struct.signal->rlim, so that the OpenAFS kernel module can no
longer build.

Modify OpenAFS autoconfig tests to cope.

Reviewed-on: https://gerrit.openafs.org/12573
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: Joe Gorse <jhgorse@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
(cherry picked from commit ad001550949b612ff6b4899fa8da50ee58f87533)

Change-Id: I491208d77e45d45cc0089b8033892a6408da431c
Reviewed-on: https://gerrit.openafs.org/12589
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux v4.11: getattr takes struct path 88/12588/2
Joe Gorse [Mon, 20 Mar 2017 14:30:46 +0000]
Linux v4.11: getattr takes struct path

With Linux commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f

    statx: Add a system call to make enhanced file info available

The Linux getattr inode operation is altered to take two additional
arguments: a u32 request_mask and an unsigned int flags that indicate
the synchronisation mode.  This change is propagated to the
vfs_getattr*() function.

-   int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *);
+   int (*getattr) (const struct path *, struct kstat *,
+                     u32 request_mask, unsigned int sync_mode);

The first argument, request_mask, indicates which fields of the statx
structure are of interest to the userland call. The second argument,
flags, currently may take the values defined in
include/uapi/linux/fcntl.h and are optionally used for cache coherence:

 (1) AT_STATX_SYNC_AS_STAT tells statx() to behave as stat() does.

 (2) AT_STATX_FORCE_SYNC will require a network filesystem to
     synchronise its attributes with the server - which might require
     data writeback to occur to get the timestamps correct.

 (3) AT_STATX_DONT_SYNC will suppress synchronisation with the server in
     a network filesystem.  The resulting values should be considered
     approximate.

This patch provides a new autoconf test and conditional compilation to
cope with the changes in our getattr implementation.

Reviewed-on: https://gerrit.openafs.org/12572
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit de5ee1a67d1c3284d65dc69bbbf89664af70b357)

Change-Id: I41ff134e1e71944f0629c9837d38cfbc495264c8
Reviewed-on: https://gerrit.openafs.org/12588
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoPrevent double-starting client on RHEL7 87/12587/2
Jonathon Weiss [Thu, 10 Nov 2016 22:06:18 +0000]
Prevent double-starting client on RHEL7

On RHEL7 if the AFS client is stopped with 'service openafs-client
stop', but that fails for some reason (most commonly because some
process has a file or directory in AFS open) systemd will decide that
the openafs-client is in a failed state when it is actually running.
If one then runs 'service openafs-client start' systemd will start a
new AFS client.  At this point AFS access will continue to work until
the functional AFS client is (successfully) stopped, at which point a
reboot is required to recover.

Have systemd check the status of 'fs sysname' before starting the
AFS client, so we avoid getting into a state that requires a reboot.

Reviewed-on: https://gerrit.openafs.org/12443
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit c666bfee8848183ccbc566c9e0fa019088e56505)

Change-Id: I2e7bf69ec5d1ae344d38b86fc3caace25b2da135
Reviewed-on: https://gerrit.openafs.org/12587
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoMake OpenAFS 1.6.20.2 32/12532/2
Stephan Wiesand [Wed, 1 Mar 2017 12:57:41 +0000]
Make OpenAFS 1.6.20.2

Update configure version strings for 1.6.20.2. Note that macOS kext
can be of form XXXX.YY[.ZZ[(d|a|b|fc)NNN]] where d dev, a alpha,
b beta, f final candidate so we have no way to represent 1.6.20.2.
Switch to 1.6.21 dev 2 for macOS.

Change-Id: Iccc613ea6b7d1194e7a1b20fa38c54b192c3c7b4
Reviewed-on: https://gerrit.openafs.org/12532
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoUpdate NEWS for 1.6.20.2 62/12562/4
Stephan Wiesand [Wed, 8 Mar 2017 13:06:52 +0000]
Update NEWS for 1.6.20.2

Release notes for the 1.6.20.2 release.

Change-Id: Ic394e004d5db329808e731b47cea521d944d2d2b
Reviewed-on: https://gerrit.openafs.org/12562
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoSOLARIS: prevent BAD TRAP panic with Studio 12.5 67/12567/3
Mark Vitale [Tue, 28 Feb 2017 23:02:39 +0000]
SOLARIS: prevent BAD TRAP panic with Studio 12.5

Starting with Solaris Studio 12.3, it is documented that Solaris kernel
modules (such as libafs) must not use any floating point, vector, or
SIMD/SSE instructions on x86 hardware.  However, each new Studio
compiler release (12.4 and especially 12.5) is more likely to use these
types of instructions by default.

If the libafs kernel module includes any forbidden kernel instructions,
Solaris will panic the system with:
  BAD TRAP:  type=7 (#nm Device not available)

Provide a new autoconfig test to specify the required compiler options
(-xvector=%none -xregs=no%float) when building the OpenAFS kernel module
for Solaris, so that no invalid x86 instructions are used.

In addition, reinstate default kernel module optimization for Solaris.
It had been disabled in commit 80592c53cbb0bce782eb39a5e64860786654be9f
to address this same issue in Studio 12.3 and 12.4.  However, Studio
12.5 started using some SSE instructions even with no optimization.

This commit has been tested with OpenAFS master and Studio 12.5 at all
optimization levels (none, -xO1 through -xO5) and verified to contain no
XMM register instructions via the following command:
  $ gobjdump -dlr libafs64.o | grep xmm | wc -l

[wiesand: limit change to solaris 5.11 for stable branch]

Reviewed-on: https://gerrit.openafs.org/12558
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 22d841a45fff7026318b529a41dd957ce8bb0ddf)

Change-Id: I2e87f26dbac47289694346639b396dfc556368f4
Reviewed-on: https://gerrit.openafs.org/12567
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agolinux24: remove unused NUMPAGGROUPS define 63/12563/2
Michael Meffie [Wed, 8 Mar 2017 16:48:14 +0000]
linux24: remove unused NUMPAGGROUPS define

Remove the unused NUMPAGGROUPS define in the pag group handling
implementation for linux24. PAGS always take two group ids in linux24,
so the NUMPAGGROUPS define was not used in linux24. Remove the unused
constant.

This is a 1.6.x only change, since linux24 support has been removed on
the master branch.

Change-Id: I10d4d5744420b075a10deecf052d2ecc128ad8fe
Reviewed-on: https://gerrit.openafs.org/12563
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoSOLARIS: fix for AFS_PAG_ONEGROUP_ENV for Solaris 11 27/12527/2
Michael Meffie [Thu, 12 Jan 2017 17:27:36 +0000]
SOLARIS: fix for AFS_PAG_ONEGROUP_ENV for Solaris 11

Fix a bug introduced in commit aab1e71628e6a4ce68c5e59e2f815867438280d1
in which a pointer was incorrectly checked for a NULL value.

Fixes a crash when a PAG is set on Solaris.

    # mdb unix.1 vmcore.1
    > ::status
    ...
    panic message:
    BAD TRAP: type=e (#pf Page fault) rp=fffffffc802ba8f0 addr=0 occurred in
      module "afs" due to a NULL pointer dereference
    > ::stack
    pag_to_gidset+0x145()
    setpag+0xcc()
    AddPag+0x3a()
    afs_setpag+0x58()
    Afs_syscall+0x115()

The crash occurs since gidslot is NULL during the assignment:

    *gidslot = pagvalue;

Reviewed-on: https://gerrit.openafs.org/12508
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit b146c2d54ff3bd99f2c4674eb88d5af417a194d7)

Change-Id: Ia012d07a3dd063e759a4a50d38e37be710e96255
Reviewed-on: https://gerrit.openafs.org/12527
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoSOLARIS: Use AFS_PAG_ONEGROUP_ENV for Solaris 11 26/12526/2
Andrew Deason [Sat, 8 Aug 2015 21:49:50 +0000]
SOLARIS: Use AFS_PAG_ONEGROUP_ENV for Solaris 11

On Solaris 11 (specifically, Solaris 11.1+), the supplemental group
list for a process is supposed to be sorted. Starting with Solaris
11.2, more authorization checks are done that assume the list is
sorted (e.g., to do a binary search), so having them out of order
can cause incorrect behavior. For example:

  $ echo foo > /tmp/testfile
  $ chmod 660 /tmp/testfile
  $ sudo chown root:daemon /tmp/testfile
  $ cat /tmp/testfile
  foo
  $ id -a
  uid=100(adeason) gid=10(staff) groups=10(staff),12(daemon),20(games),21(ftp),50(gdm),60(xvm),90(postgres)
  $ pagsh
  $ cat /tmp/testfile
  cat: cannot open /tmp/testfile: Permission denied
  $ id -a
  uid=100(adeason) gid=10(staff) groups=33536,32514,10(staff),12(daemon),20(games),21(ftp),50(gdm),60(xvm),90(postgres)

Solaris sorts the groups given to crsetgroups() on versions which
required the group ids to be sorted, but we currently manually put our
PAG groups in our own order in afs_setgroups(). This is currently
required, since various places in the code assume that PAG groups are
the first two groups in a process's group list.

To get around this, do not require the PAG gids to be the first two
gids anymore. To more easily identify PAG gids in group processes, use
a single gid instead of two gids to identify a PAG, like modern Linux
currently uses (under the AFS_PAG_ONEGROUP_ENV). High-numbered groups
have been possible for quite a long time on Solaris, allegedly further
back than Solaris 8. Only do this for Solaris 11, though, to reduce
the platforms we affect.

[mmeffie@sinenomine.net: Define AFS_PAG_ONEGROUP_ENV in param.h.]

Reviewed-on: https://gerrit.openafs.org/11979
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit aab1e71628e6a4ce68c5e59e2f815867438280d1)

Change-Id: I54c1f4c1be4eed1804293aebae795b165954a3a4
Reviewed-on: https://gerrit.openafs.org/12526
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: Make ONEGROUP_ENV not Linux-specific 25/12525/2
Andrew Deason [Sat, 8 Aug 2015 21:13:54 +0000]
afs: Make ONEGROUP_ENV not Linux-specific

The functionality in AFS_LINUX26_ONEGROUP_ENV does not really need to
be Linux-specific (it's just only implemented for Linux right now).
Rename it to AFS_PAG_ONEGROUP_ENV, and remove some Linux-specific
checks when checking for "onegroup" PAG GIDs.

[mmeffie@sinenomine.net: Move AFS_PAG_ONEGROUP_ENV to param.h]

Reviewed-on: https://gerrit.openafs.org/11978
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit ee08dbe37d9db4fe314bd88b9280bf73c92c37bd)

Change-Id: Ifef8f833599eca4241b41035142e74f32e6efa99
Reviewed-on: https://gerrit.openafs.org/12525
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: define NUMPAGGROUPS once 24/12524/2
Michael Meffie [Fri, 9 Sep 2016 20:23:46 +0000]
afs: define NUMPAGGROUPS once

Define the number of groups per PAG in one place.  Prefix the define
with AFS_ to avoid name conflicts in the future (unlikely as it may be).

Fix the misnamed AFSPAGGGROUPS symbol in linux implementation of two
groups per PAG.

Reviewed-on: https://gerrit.openafs.org/12382
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit b39095c3a7e1c631bb17816b7e707bc21a6b8c71)

Change-Id: I8e0531e9a7e2fc1f3d1eb8255c75ecd758dbce9a
Reviewed-on: https://gerrit.openafs.org/12524
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agobuild: update search paths for solaris cc 36/12536/2
Michael Meffie [Sun, 26 Feb 2017 01:33:00 +0000]
build: update search paths for solaris cc

Move the macros to search for the solaris cc to a separate macro and
update the search paths to keep up with released versions.

Reviewed-on: https://gerrit.openafs.org/12528
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 69aadea298825f1f224406064b83d1a947abf96b)

Change-Id: I1dadc037727c3b73d61104d03c5051c1dc154433
Reviewed-on: https://gerrit.openafs.org/12536
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLINUX: Bring debug symbols back to the Linux kernel module. 34/12534/2
Joe Gorse [Thu, 16 Feb 2017 23:01:50 +0000]
LINUX: Bring debug symbols back to the Linux kernel module.

Starting with 4.8 Linux kernels our existing build script
generator, make_kbuild_makefile.pl, does not pass the debugging
symbols CFLAGS that were present when building for previous kernels.

This fix appends the $(KERN_DBG) variable which will only be defined
when the configuration includes the --enable-debug-kernel option.

Reviewed-on: https://gerrit.openafs.org/12519
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 961cee00b8f5c302de5f66beb81caa33242c7971)

Change-Id: I1d16382c4a744d4624cac9a9ba2810fa664abe93
Reviewed-on: https://gerrit.openafs.org/12534
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLINUX: Debian/Ubuntu build regression on kernel 3.16.39 35/12535/2
Sergio Gelato [Wed, 22 Feb 2017 21:55:33 +0000]
LINUX: Debian/Ubuntu build regression on kernel 3.16.39

Now that kernel 4.9 has hit jessie-backports, it becomes desirable to
also backport the associated openafs patches.

Unfortunately, Linux-4.9-inode_change_ok-becomes-setattr_prepare.patch
causes a build failure against jessie's current default kernel,
3.16.39-1, due to the fact that setattr_prepare() is available (it was
cherrypicked to address CVE-2015-1350) but file_dentry() is not (it was
introduced in kernel 4.6).

This makes it difficult to have a version of openafs for jessie that
supports both kernels.

To deal with this, follow the implementation of file_dentry() in 4.6,
and simplify it to account for the lack of d_real() support in older
kernels.

Note that inode_change_ok() has been added back to 3.16.39-1 to avoid
ABI changes. That means the current openafs packages in jessie continue
to work with kernel 3.16.39-1 since they do not include
Linux-4.9-inode_change_ok-becomes-setattr_prepare.patch.

Originally reported at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=855366

FIXES RT134158

Reviewed-on: https://gerrit.openafs.org/12523
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 6ea6c182c7fb6c22dafbbf203abcc23726e06cba)

Change-Id: I06951dacef3f7639f749e82439df89ec3d78b592
Reviewed-on: https://gerrit.openafs.org/12535
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoosx: build afscell only for active architecture 38/12538/2
Marcio Barbosa [Thu, 2 Mar 2017 21:01:48 +0000]
osx: build afscell only for active architecture

The InstallerPlugins framework provided by the MacOSX10.12.sdk does not
define symbols for architecture i386. As a result, the OpenAFS code
cannot be built on OS X 10.12.

To fix this problem, build the afscell xcode project only for active
architecture.

Reviewed-on: https://gerrit.openafs.org/12531
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit d39e7c7af77b4e1b043611e1a6e78267f5f956ef)

Change-Id: I34b351b4d383c8dd91f8a7b5b9f35d9aa2854a13
Reviewed-on: https://gerrit.openafs.org/12538
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoredhat: move the klog.krb5 man page to openafs-krb5 11/12511/2
Michael Meffie [Tue, 10 Jan 2017 04:55:32 +0000]
redhat: move the klog.krb5 man page to openafs-krb5

Move the klog.krb5 man page to the openafs-krb5 package, which
distributes the klog.krb5 binary, instead of the general openafs
package.

Reviewed-on: https://gerrit.openafs.org/12509
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 872a63bbfb04addbdc17dc5c09ec018bb9ddf515)

Change-Id: Ic1d8cdb788e7776820107c2207317e7cf04cd042
Reviewed-on: https://gerrit.openafs.org/12511
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoSOLARIS: update convert from ancient _depends_on 33/12533/2
Michael Meffie [Mon, 27 Feb 2017 06:40:51 +0000]
SOLARIS: update convert from ancient _depends_on

Commit 37db7985fde9e6a5e71ae628d0b7124a27bf31c3 modernized how we
declare module dependencies on Solaris 10 and newer.

Instead of explicitly specifying recent Solaris version numbers, specify
old versions for the old method.  This should be more future proof.

Thanks to Ben Kaduk for the suggestion.

Reviewed-on: https://gerrit.openafs.org/12529
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 3893ed397283b0c3605def102004a645a325d476)

Change-Id: Ia187a99033dd07b6b65a017fa20a7435e5d866c0
Reviewed-on: https://gerrit.openafs.org/12533
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoSOLARIS: convert from ancient _depends_on to ELF dependencies 14/12514/2
Michael Meffie [Sat, 5 Nov 2016 16:42:19 +0000]
SOLARIS: convert from ancient _depends_on to ELF dependencies

The ancient way of declaring module dependencies with _depends_on has
been deprecated since SunOS 2.6 (circa 1996). The presence of the old
_depends_on symbol triggers a warning message on the console starting
with Solaris 12, and the kernel runtime loader (krtld) feature of using
the _depends_on symbol to load dependencies may be removed in a future
version of Solaris.

Convert the kernel module from the ancient _depends_on method to modern
ELF dependencies.  Remove the old _depends_on symbol and specify the -dy
and -N <name> linker options to set the ELF dependencies at link time,
as recommended in the Solaris device driver developer guidelines [1].

This commit does not change the declared dependencies, which may be
vestiges of ancient afs versions.

[1]: http://docs.oracle.com/cd/E19455-01/805-7378/6j6un037u/index.html#loading-16

Reviewed-on: https://gerrit.openafs.org/12453
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 37db7985fde9e6a5e71ae628d0b7124a27bf31c3)

Change-Id: I1a4ad8bface1ecf774e906b846c2e8263631d77a
Reviewed-on: https://gerrit.openafs.org/12514
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agobozo: do not exit when the client config already exists 22/12522/2
Michael Meffie [Wed, 21 Jan 2015 19:58:35 +0000]
bozo: do not exit when the client config already exists

The bosserver creates symlinks for the client CSDB and ThisCell config
files during initialization.  Avoid exiting if the client CSDB or
ThisCell configuration already exists, otherwise the bosserver cannot be
restarted with bos restart.

This fixes an error introduced with commit
720363fa9bf7cfbebdc485104b74ca6bac1895f6, Fix unchecked return values.

Reviewed-on: http://gerrit.openafs.org/11684
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 381c7afbe60a0e6d53e8cc1bca2de920574b3383)

Change-Id: I6b93e337fd56294107f527af20d99f97689c1701
Reviewed-on: https://gerrit.openafs.org/12522
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoFix unchecked return values 21/12521/2
Jeffrey Hutzelman [Sun, 16 Jun 2013 19:28:03 +0000]
Fix unchecked return values

This change fixes numerous places where the return values of various
system calls and standard library routines are not checked.  In
particular, this fixes occurrances called out when building on Ubuntu
12.10, with gcc 4.7.2 and eglibc 2.15-0ubuntu20.1, when the possible
failure is one we actually do (or should) care about.  This change
does not consider calls where the failure is one we deliberately
choose to ignore.

Reviewed-on: http://gerrit.openafs.org/9979
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 720363fa9bf7cfbebdc485104b74ca6bac1895f6)

Change-Id: I9e72a68a66d751139f7129b9b177ba18389c10a2
Reviewed-on: https://gerrit.openafs.org/12521
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux 4.10: have_submounts is gone 30/12530/2
Mark Vitale [Wed, 7 Dec 2016 16:11:45 +0000]
Linux 4.10: have_submounts is gone

Linux commit f74e7b33c37e vfs: remove unused have_submounts() function
(v4.10-rc2) removes have_submounts from the tree after providing a
replacement (path_has_submounts) for its last in-tree caller, autofs.

However, it turns out that OpenAFS is better off not using the new
path_has_submounts.  Instead, OpenAFS could/should have stopped using
have_submounts() much earlier, back in Linux v3.18 when d_invalidate
became void.  At that time, most in-tree callers of have_submounts had
already been converted to use check_submounts_and_drop back in v3.12.
At v3.18, a series of commits modified check_submounts_and_drop to
automatically remove child submounts (instead of returning -EBUSY if a
submount was detected), then subsumed it into d_invalidate.  The end
result was that VFS now implicitly handles much of the housekeeping
previously called explicitly by the various filesystem d_revalidate
routines:
- shrink_dcache_parent
- check_submounts_and_drop
- d_drop
- d_invalidate
All in-tree filesystem d_revalidate routines were updated to take
advantage of this new VFS support.

Modify afs_linux_dentry_revalidate to no longer perform any special
handling for invalid dentries when D_INVALIDATE_IS_VOID.  Instead, allow
our VFS caller to properly clean up any invalid dentry when we return 0.

Reviewed-on: https://gerrit.openafs.org/12506
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 789319bf0f2b26ad67995f8cbe88cee87a1bbdc0)

Change-Id: I7ed22338e7896f69a204be78ed0a4f6136a3dab8
Reviewed-on: https://gerrit.openafs.org/12530
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agos390: desupport 32-bit Linux kernels on s390/s390x 99/12499/2
Neale Ferguson [Thu, 8 Dec 2016 16:47:09 +0000]
s390: desupport 32-bit Linux kernels on s390/s390x

Remove the obsolete and custom lwp assembler for the s390 and s390x
architectures.  That assembler is no longer needed since 32-bit
mainframe Linux distributions are no longer supported and are very
unlikely to be in use.

The generic process.default.s is sufficient for modern 64-bit Linux
distributions on s390/s390x.

[mmeffie@sinenomine.net: commit message wording]

Reviewed-on: https://gerrit.openafs.org/12475
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 1d8cb56999a4ab25ae4cbc8e8a688b8100aedd3b)

Change-Id: Iee572ef3a86f5502e37ddc0775da13b874add669
Reviewed-on: https://gerrit.openafs.org/12499
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoosx: let prefpane knows where binaries can be found 12/12512/2
Marcio Barbosa [Wed, 11 Jan 2017 14:05:04 +0000]
osx: let prefpane knows where binaries can be found

Starting from OS X 10.11, the OpenAFS binaries were moved to the
following directories: /opt/openafs/bin and /opt/openafs/sbin. However,
the OpenAFS prefpane is not aware of the change mentioned above. As a
result, some functionalities provided by the OpenAFS prefpane are not
working properly.

To fix this problem, add the new paths to the proper environment
variable.

Change-Id: Idaa2f0329af2092cf9ad1d63f1a01300b150227a
Reviewed-on: https://gerrit.openafs.org/12507
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit a92a3a0675d941536103b60d708a6b3305b9b8fa)
Reviewed-on: https://gerrit.openafs.org/12512
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoMake OpenAFS 1.6.20.1 85/12485/2 openafs-stable-1_6_20_1
Stephan Wiesand [Mon, 12 Dec 2016 14:09:50 +0000]
Make OpenAFS 1.6.20.1

Update configure version strings for 1.6.20.1. Note that macos kext
can be of form XXXX.YY[.ZZ[(d|a|b|fc)NNN]] where d dev, a alpha,
b beta, f final candidate so we have no way to represent 1.6.20.1.
Switch to 1.6.21 dev 1 for macOs.

Change-Id: If9a54680d6807687136f6149ca48ad8c33db32f7
Reviewed-on: https://gerrit.openafs.org/12485
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoUpdate NEWS for 1.6.20.1 86/12486/3
Stephan Wiesand [Mon, 12 Dec 2016 14:38:18 +0000]
Update NEWS for 1.6.20.1

Release notes for OpenAFS 1.6.20.1

Change-Id: I3584e78ac5b509b1093c014ee4dec471991e7a8f
Reviewed-on: https://gerrit.openafs.org/12486
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agosrc/gtx/curseswindows.c: Fix misleading indentation 84/12484/2
Anders Kaseorg [Sat, 5 Nov 2016 00:46:22 +0000]
src/gtx/curseswindows.c: Fix misleading indentation

Fixes these warnings (errors with --enable-checking) from GCC 6.2:

curseswindows.c: In function ‘gator_cursesgwin_drawchar’:
curseswindows.c:574:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
     if (params->highlight)
     ^~
curseswindows.c:576:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
         if (code)
         ^~
curseswindows.c:579:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
     if (params->highlight)
     ^~
curseswindows.c:581:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
         if (code)
         ^~
curseswindows.c: In function ‘gator_cursesgwin_drawstring’:
curseswindows.c:628:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
     if (params->highlight)
     ^~
curseswindows.c:630:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
  if (code)
  ^~
curseswindows.c:633:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
     if (params->highlight)
     ^~
curseswindows.c:635:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
  if (code)
  ^~

Reviewed-on: https://gerrit.openafs.org/12439
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 85cf397ec18ecfde36433fb65e5d91ecd325b76e)

Change-Id: I33acb742a6c03046a0fa698bd08a910effc05de8
Reviewed-on: https://gerrit.openafs.org/12484
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agosrc/rx/rx_packet.c: Fix misleading indentation 83/12483/2
Anders Kaseorg [Sat, 5 Nov 2016 00:38:08 +0000]
src/rx/rx_packet.c: Fix misleading indentation

Fixes these warnings (errors with --enable-checking) from GCC 6.2:

rx_packet.c: In function ‘rxi_ReceiveDebugPacket’:
rx_packet.c:2009:9: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
         if (rx_stats_active)
         ^~
rx_packet.c:2011:6: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
      s = (afs_int32 *) & rx_stats;
      ^
rx_packet.c:2017:9: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
         if (rx_stats_active)
         ^~
rx_packet.c:2019:6: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
      rxi_SendDebugPacket(ap, asocket, ahost, aport, istack);
      ^~~~~~~~~~~~~~~~~~~

Reviewed-on: https://gerrit.openafs.org/12436
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 0aeb8c17a2701169ddb7397d951c73cf361087c8)

Change-Id: Ic7db23cecdcb7f02d1529326b336d62339af8460
Reviewed-on: https://gerrit.openafs.org/12483
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agosrc/rxgen/rpc_parse.c: Fix misleading indentation 82/12482/2
Anders Kaseorg [Sat, 5 Nov 2016 00:36:51 +0000]
src/rxgen/rpc_parse.c: Fix misleading indentation

Fixes this warning (error with --enable-checking) from GCC 6.2:

rpc_parse.c: In function ‘analyze_ProcParams’:
rpc_parse.c:861:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
     if (tokp->kind != TOK_RPAREN)
     ^~
rpc_parse.c:863:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
  *tailp = decls;
  ^

Reviewed-on: https://gerrit.openafs.org/12435
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit bd70a176c19c09c49c6c3c01ea088ca947c45966)

Change-Id: I099cba14fbe53c510886c0d342ad3fce60750411
Reviewed-on: https://gerrit.openafs.org/12482
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agosystemd: RemainAfterExit in openafs-client.service 81/12481/2
Andrew Deason [Tue, 2 Sep 2014 22:51:46 +0000]
systemd: RemainAfterExit in openafs-client.service

Currently, if the client is started without any options that require
an extra thread (like -afsdb), all processes spawned by afsd will
exit. There may be some kernel threads still active, but those are
spawned by the kernel module, and are not child processes of the
parent afsd process, or anything like that.

Since we are a Type=forking service in systemd, systemd interprets
this situation to mean that the service has stopped successfully, and
then runs the ExecStop commands. So, for example, if our AFSD_ARGS in
our sysconfig is "-fakestat -afsdb", the service starts as normal. But
if it is changed to "-fakestat", then when openafs-client.service is
started, it immediately stops again.

To avoid this, turn on the systemd option RemainAfterExit, which tells
systemd that the service has not stopped if all of our processes have
exited. The client service will thus remain running until it is
stopped.

Issue reported by Rich Sudlow.

FIXES 133482

Reviewed-on: http://gerrit.openafs.org/11440
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit cb8195d2d6ce1c01e132c05c1bf5593eab45b2c6)

Change-Id: I4005d5dabae8ef72194938475cf46f5bc1f222f8
Reviewed-on: https://gerrit.openafs.org/12481
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux 4.9: inode_change_ok() becomes setattr_prepare() 80/12480/2
Mark Vitale [Thu, 20 Oct 2016 04:49:37 +0000]
Linux 4.9: inode_change_ok() becomes setattr_prepare()

Linux commit 31051c85b5e2 "fs: Give dentry to inode_change_ok() instead
of inode" renames and modifies inode_change_ok(inode, attrs) to
setattr_prepare(dentry, attrs).

Modify OpenAFS to cope.

Reviewed-on: https://gerrit.openafs.org/12418
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 8aeb711eeaa5ddac5a74c354091e2d4f7ac0cd63)

Change-Id: I7f08c57b7f61465a1ea18333306f52f77bd65084
Reviewed-on: https://gerrit.openafs.org/12480
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux 4.9: inode_operation rename now takes flags 79/12479/2
Mark Vitale [Fri, 16 Sep 2016 23:01:19 +0000]
Linux 4.9: inode_operation rename now takes flags

In Linux 3.15 commit 520c8b16505236fc82daa352e6c5e73cd9870cff,
inode_operation rename2() was added.  It takes the same arguments as
rename(), with an added flags argument supporting the following values:

RENAME_NOREPLACE: if "new" name exists, fail with -EEXIST.  Without
this flag, the default behavior is to replace the "new" existing file.

RENAME_EXCHANGE: exchange source and target; both must exist.

OpenAFS never implemented a .rename2() routine because it was optional
when introduced at Linux v3.15.

In Linux 4.9-rc1 the following commits remove the last in-tree uses of
.rename() and converts .rename2() to .rename().
aadfa8019e81 vfs: add note about i_op->rename changes to porting
2773bf00aeb9 fs: rename "rename2" i_op to "rename"
18fc84dafaac vfs: remove unused i_op->rename
1cd66c93ba8c fs: make remaining filesystems use .rename2
e0e0be8a8355 libfs: support RENAME_NOREPLACE in simple_rename()
f03b8ad8d386 fs: support RENAME_NOREPLACE for local filesystems

With these changes, it is now mandatory for OpenAFS afs_linux_rename()
to accept a 5th flag argument.

Add an autoconfig test to determine the signature of .rename().  Use this
information to implement afs_linux_rename() with the appropriate number
of arguments.  Implement "toleration support" for the flags option by
treating a zero flag as a normal rename; if any flags are specified,
return -EINVAL to indicate the OpenAFS filesystem does not yet support
any flags.

Reviewed-on: https://gerrit.openafs.org/12391
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f21e3ef8ce5093b4e0578d29666f76bd99aef1a2)

Change-Id: I071d41cd1ef1c9cdcda257c091d7167221f58fb7
Reviewed-on: https://gerrit.openafs.org/12479
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux 4.9: deal with demise of GROUP_AT 78/12478/2
Mark Vitale [Wed, 14 Sep 2016 22:01:22 +0000]
Linux 4.9: deal with demise of GROUP_AT

Linux commit 81243eacfa40 "cred: simpler, 1D supplementary groups"
refactors the group_info struct, removing some members (which OpenAFS
references only through the GROUP_AT macro) and adding a gid member.
The GROUP_AT macro is also removed from the tree.

Add an autoconfigure test for the new group_info member gid and define a
replacement GROUP_AT macro to do the right thing under the new regime.

Reviewed-on: https://gerrit.openafs.org/12390
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 8e81b182e36cde28ec5708e5fcbe56e4900b1ea3)

Change-Id: I46b5cd4571452f9506647aada2caf3a68c4fa7d5
Reviewed-on: https://gerrit.openafs.org/12478
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agomacos: do not quit prefpane unexpectedly 47/12447/2
Marcio Barbosa [Fri, 11 Nov 2016 21:21:58 +0000]
macos: do not quit prefpane unexpectedly

If the user opens the OpenAFS preference pane and choose the Mounts
tab, the preference pane crashes.

To fix the problem, do not assume that we can cast a NSdictionary
object to NSMutableDictionary.

Reviewed-on: https://gerrit.openafs.org/12446
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 9d4be0bd01696768602a313f627a802b358b5885)

Change-Id: I7ff8c6cbc599f3e80d6365d9a56587bf5c641f5b
Reviewed-on: https://gerrit.openafs.org/12447
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: Joe Gorse <jhgorse@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agomacos: packaging support for MacOS X 10.12 32/12432/2
Marcio Barbosa [Sun, 23 Oct 2016 19:52:49 +0000]
macos: packaging support for MacOS X 10.12

This commit introduces the new set of changes / files required to
successfully create the dmg installer on OS X 10.12 "Sierra".

Reviewed-on: https://gerrit.openafs.org/12420
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 0bed87a15db11bccb693b3a54f704ee5751ae553)

Change-Id: I71a22e2ee43cb86ccdbe16c42b582d90adc91115
Reviewed-on: https://gerrit.openafs.org/12432
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agomacos: add support for MacOS 10.12 31/12431/2
Marcio Barbosa [Wed, 26 Oct 2016 02:33:38 +0000]
macos: add support for MacOS 10.12

This commit introduces the new set of changes / files required to
successfully build the OpenAFS source code on OS X 10.12 "Sierra".

Reviewed-on: https://gerrit.openafs.org/12419
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 0bdf750a962a81b9b2e61387d7a3340dabb13395)

Change-Id: I693878212ec7cf00c2c8376ed5a1bab1198594b3
Reviewed-on: https://gerrit.openafs.org/12431
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agodir: do not leak contents of deleted directory entries 65/12465/3 openafs-stable-1_6_20
Mark Vitale [Mon, 7 Nov 2016 19:16:50 +0000]
dir: do not leak contents of deleted directory entries

Deleting an AFS directory entry (afs_dir_Delete) merely removes the
entry logically by updating the allocation map and hash table.  However,
the entry itself remains on disk - that is, both the cache manager's
cache partition and the fileserver's vice partitions.

This constitutes a leak of directory entry information, including the
object's name and MKfid (vnode and uniqueid).  This leaked information
is also visible on the wire during FetchData requests and volume
operations.

Modify afs_dir_Delete to clear the contents of deleted directory
entries.

Patchset notes:
This commit only prevents leaks for newly deleted entries.  Another
commit in this patchset prevents leaks of partial object names upon
reuse of pre-existing deleted entries.  A third commit in this
patchset prevents yet another kind of directory entry leak, when
internal buffers are reused to create or enlarge existing directories.
All three patches are required to prevent new leaks.  Two additional
salvager patches are also included to assist administrators in the
cleanup of pre-existing leaks.

[kaduk@mit.edu: style nit for sizeof() argument]

Reviewed-on: https://gerrit.openafs.org/12460
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f591f6fae3d8b8d44140ca64e53bad840aeeeba0)

Change-Id: I41f76649f4bed609793b944db32c5ae62aa07458
Reviewed-on: https://gerrit.openafs.org/12465
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: do not leak stale data in buffers 64/12464/3
Benjamin Kaduk [Mon, 7 Nov 2016 05:29:22 +0000]
afs: do not leak stale data in buffers

Similar to the previous commit, zero out the buffer when fetching
a new slot, to avoid the possibility of leaving stale data in
a reused buffer.

We are not supposed to write such stale data back to a fileserver,
but this is an extra precaution in case of bugs elsewhere -- memset
is not as expensive as it was in the 1980s.

Reviewed-on: https://gerrit.openafs.org/12459
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit a26c5054ee501ec65db3104f6a6a0fef634d9ea7)

Change-Id: Id60559ed84581e2f6a50cd4313f64780b8a0bafd
Reviewed-on: https://gerrit.openafs.org/12464
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoMake OpenAFS 1.6.20 67/12467/2
Benjamin Kaduk [Wed, 30 Nov 2016 16:55:55 +0000]
Make OpenAFS 1.6.20

Update version strings for the 1.6.20 security release.

Change-Id: I7f5ffa5e20173d399ed79dfb6358882caf05e27e
Reviewed-on: https://gerrit.openafs.org/12467
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>