9035 Commits

Author SHA1 Message Date
Jeffrey Altman
76db51bc79 Windows: Freelance HaveAccessRights
Change the test in cm_HaveAccessRights related to Freelance
mode.  All objects in the freelance cell and root volume
by definition have access rights.

Reviewed-on: http://gerrit.openafs.org/7008
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit b84496b8593dd9c220022c78d8b9b571c7b78e8d)

Change-Id: I54f319d5f7f9111c25589204ffb01f682dc97ca9
Reviewed-on: http://gerrit.openafs.org/8618
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2012-12-06 16:38:09 -08:00
Jeffrey Altman
836c696dc3 rx: RX_INVALID_OPERATION abort unknown service only
Patchset 1fbe83f9aacfc36a9c426ba1fd18ad7c72869dc1 introduced the
sending of RX_INVALID_OPERATION aborts for connection attempts
requesting a service not offered by the rx peer.  By sending aborts
for all failures of rxi_FindConnection() the set of incoming packets
that are responded to is broader than simply those with non-matching
serviceIds.  This patchset restricts the transmission of
RX_INVALID_OPERATION aborts only to the explicit case in which
rxi_FindConnection() attempted to find a service and either failed
to find a match or couldn't apply the requested security class/level
to that service.

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

Change-Id: Ic732c013d6f77df991e97de7f1c5af88a194e81c
Reviewed-on: http://gerrit.openafs.org/8608
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2012-12-06 10:16:29 -08:00
Andrew Deason
14657f6bac afs: Fix VLRU traversal sanity check
On non-Linux, the number of vcaches in the VLRU can easily exceed
afs_maxvcount, since we allocate new vcaches when we run out. So,
assume we only have afs_vcount vcaches on the VLRU, instead of
assuming we have at most afs_maxvcount vcaches.

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

Change-Id: Id4884e45a52813eb33926958b11148a021ca3057
Reviewed-on: http://gerrit.openafs.org/8606
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
2012-12-06 09:43:24 -08:00
Marc Dionne
0776f5dadd Linux: include kthread.h before afs includes
We need to include kthread.h before the afs standard includes
to avoid clashing with the printf -> printk mapping.

Reviewed-on: http://gerrit.openafs.org/7988
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 8b6926e43f31a30a95e5883fd4b9e72924b3371d)

Change-Id: I0dbb696e3af5172c9a72d183f2acd10107bedcf5
Reviewed-on: http://gerrit.openafs.org/8605
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-12-06 09:41:43 -08:00
Tom Keiser
cd91bbac76 libafs: use kthread_run when available
Use the kthread_run interface on linux to create kernel
threads.  This interface allows all the cpus to schedule
afsd threads, instead of just inheriting the cpu affinity of
the main afsd thread.

Written by Tom Keiser.

Reviewed-on: http://gerrit.openafs.org/7915
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit b440d8ffcbb0ac58ecaa34a9c60fe27a0fc91026)

Change-Id: Id05360309db01ac13b8d887b1ef19596ed86b63a
Reviewed-on: http://gerrit.openafs.org/8604
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-12-06 09:17:32 -08:00
Andrew Deason
7a6bc371f1 rx: Generate BUSY packets for error call channels
Currently, if a call is error'd out but still active, we won't
generate BUSY packets if another call comes in on the same channel.
This is because we bail out earlier, here, before we get to the BUSY
processing.

The comments suggest that this is for if we enter an error state while
waiting for TQ to clear. So, only do this if our error has changed.

Reviewed-on: http://gerrit.openafs.org/8460
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry-picked from commit a84c6b0ece1fdee4f462c6ce27fa78c2e0d419f4)

Change-Id: I50fda40b3f010f1b9d03f2d3e22ed00381ae0b33
Reviewed-on: http://gerrit.openafs.org/8548
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-12-06 08:07:41 -08:00
Michael Meffie
e1baf1af4c vol: rate-limit volume usage updates
Add threshold and time rate-limit parameters for volume usage
updates to disk.  This reduces the amount of i/o needed for
volume usage statistics on very busy fileservers.  Set the
default to limit updates to one every 5 seconds per volume.

Reviewed-on: http://gerrit.openafs.org/5803
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 639ca379e47fbe550d090fff9e635ad24e8e34f0)

Change-Id: I29b8240515afe5585b3eef000dbf40110fd4620f
Reviewed-on: http://gerrit.openafs.org/8582
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2012-12-06 00:07:45 -08:00
Michael Meffie
f13eaa0172 bozo: dont lie when binding to any address
Do not log the bosserver listening to just the loopback when it is
actaully listening on any address.  The loopback address is still
written to the bosserver.rxbind file in this case to give local
scripts an simple way to contact the bosserver.

Fixes the log message introduces in
commit 9133aa6ed3a7fe2ae55b2d3242366ae277c7f726

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

Change-Id: I1646a1fd81440aa23589ab46108c71a67bf5f6ea
Reviewed-on: http://gerrit.openafs.org/8584
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2012-12-05 09:55:01 -08:00
Michael Meffie
b431a9a8c1 viced: fix log message in hpr initialize
The wrong dir object is used to log an error in hpr
initialize.

Reviewed-on: http://gerrit.openafs.org/6845
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit fc1c58910c5991fa9d132d171d1d976dbfc44a95)

Change-Id: I3defc0687184885488f612f913555fc2c9189fac
Reviewed-on: http://gerrit.openafs.org/8585
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2012-12-05 09:52:11 -08:00
Marc Dionne
68c8f304d0 Linux 3.7: remove use of param.h and ioctl.h
Header files param.h and ioctl.h have moved as part of the userspace
API restructuring of header files.  Nothing in those files is
currently needed by the source, so just drop the includes.

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

Change-Id: I7caa7ee8e5bfc918d7121a2f1d826102ee03976c
Reviewed-on: http://gerrit.openafs.org/8556
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
2012-12-05 09:36:39 -08:00
Marc Dionne
058c412040 Linux: drop GLOCK before calling dput
Holding the GLOCK when calling dput can result in a deadlock when
the kernel calls back into afs_dentry_iput.  It should be safe
to drop the lock here.

Reviewed-on: http://gerrit.openafs.org/8046
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 0dac4de8eee84a43ef06c56dfc867c2a1b9a9f0c)

Change-Id: Ide1dfc73ebc5fa207c19be1c16db9910cf66bea3
Reviewed-on: http://gerrit.openafs.org/8561
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
2012-12-05 09:30:40 -08:00
Marc Dionne
bbc6ee9058 Linux 3.7: key instantiate API change
Adapt to the new parameters for the instantiate key operation.

Reviewed-on: http://gerrit.openafs.org/8470
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Hans-Werner Paulsen <hans@MPA-Garching.MPG.DE>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit aeb2763b741a218ad6fd93adc6157a6a31f27e13)

Change-Id: I9ff22683aaf6e1002bdb2bc7666fbc0d8d597d20
Reviewed-on: http://gerrit.openafs.org/8560
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
2012-12-05 09:29:10 -08:00
Marc Dionne
c21fded67c Linux: change test for new putname API
Replace the existing test with a more robust one that checks for
the existence of the new filename structure.  Since older kernels
are expected to fail this test, we'll get the correct result even
if there is unrelated failure, for instance a missing/different
header file.

Reviewed-on: http://gerrit.openafs.org/8466
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 2bafb2f99d85804459acb8994d4057be809f8729)

Change-Id: I88536425612e39b2f7d4d09c51ce896bc8cf6d4f
Reviewed-on: http://gerrit.openafs.org/8559
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Hans-Werner Paulsen <hans@MPA-Garching.MPG.DE>
Tested-by: Hans-Werner Paulsen <hans@MPA-Garching.MPG.DE>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
2012-12-05 09:27:57 -08:00
Michael Meffie
d7926d1701 bozo: avoid canceling the sigkill timer for hung processes
A sigkill signal is sent to fileserver processes when a timeout is
exceeded for shutting down processes for the fs/dafs bnode.
(Currently 30 minutes for the fileserver, 1 minute for the other
server processes.)

If the bnode goal is set to run before this timeout expires, the
timer is incorrectly stopped, and a wedged process is never killed.
Fix this by not canceling the timer when a fs/dafs process has been
signaled to shutdown, regardless of the current goal.

Reviewed-on: http://gerrit.openafs.org/7920
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 09f5a1e6053e6db3df581543875512d8cff259ae)

Change-Id: I0d5fabed13e597d2571033468688457c38b49283
Reviewed-on: http://gerrit.openafs.org/8583
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
2012-12-05 08:51:48 -08:00
Andrew Deason
a77ef357cb rx: Lock call for KeepAliveOn/KeepAliveOff
rxi_KeepAliveOn/Off expect the call lock to be held after the call has
been initialized. So, hold it in the rx_KeepAliveOn/Off callers.

Reviewed-on: http://gerrit.openafs.org/8463
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 866c05825c9964aa92740bcb0f20f26b451e65ea)

Change-Id: I2df1937f4098dde59a7fed344e1c975fdf0cdf1b
Reviewed-on: http://gerrit.openafs.org/8551
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
2012-12-05 08:10:02 -08:00
Andrew Deason
0b3b4e5d04 afs: Handle VNOSERVICE as a timeout
For whatever reason, the fileserver uses VNOSERVICE to indicate that
an Rx call was killed due to an idledead timeout. It is not used for
any volume errors, so treat it like the idle dead error codes.

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

Change-Id: I58fc7aaba65683f987387ff406bd575018b46d6b
Reviewed-on: http://gerrit.openafs.org/8550
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-12-05 04:44:02 -08:00
Andrew Deason
fa64621382 afs: Slight restructuring in afs_Analyze
We test for acode < 0 && acode != VRESTARTING, but then immediately
test for specific values for acode. Move this conditional down, and
remove a level of indentation for the next couple of acode checks.

This commit should introduce no functional change.

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

Change-Id: Idd836a5acba775c82f360ea1082ba50cc32914af
Reviewed-on: http://gerrit.openafs.org/8549
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Hans-Werner Paulsen <hans@MPA-Garching.MPG.DE>
Tested-by: Hans-Werner Paulsen <hans@MPA-Garching.MPG.DE>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
2012-12-05 01:54:46 -08:00
Andrew Deason
68c72b661f LINUX: Always hold afs_xuser for unixuser read
We were failing to hold the afs_xuser lock when we entered our
unixuser traversal for the first time (when the given position is 0).
This means we can release the lock without acquiring it, causing all
kinds of weird behavior.

Just always grab afs_xuser on entry. We could possibly do some tricks
to avoid grabbing this lock until after we've printed the column
headers, but it does not seem worth it.

Reviewed-on: http://gerrit.openafs.org/7916
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 351d3b8a19314027b30cdc499ef48c95ba7903b6)

Change-Id: I75e137e588fcbf973a5d564db3a077c4ec4f50e1
Reviewed-on: http://gerrit.openafs.org/8547
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
2012-12-05 01:45:01 -08:00
Andrew Deason
a9b0f975f6 ptserver: Avoid inet_ntoa
The ptserver uses inet_ntoa in a few places, such as for calculating
host CPS. This isn't safe in pthreaded environments, so use
afs_inet_ntoa_r instead.

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

Change-Id: I3740a294bd93b000842ccd791f2a11cef5092a9a
Reviewed-on: http://gerrit.openafs.org/8546
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
2012-12-05 01:30:23 -08:00
Andrew Deason
3ce1c5394f afs: Never use GetNewDSlot after init
Currently there are two ways to get a dcache via a slot number:
afs_GetNewDSot and afs_GetValidDSlot. afs_GetValidDSlot assumes that
the given slot number refers to a dcache entry that is valid on disk;
with afs_GetNewDSlot, the given slot may not be valid, and if it is
not, an empty 'template' dcache is returned.

afs_GetNewDSlot is useful for initializing cache files, since if a
given dcache slot exists on disk and contains valid data, we use the
dcache like normal. If it does not already exist or does not contain
valid data, we fill in the missing data after afs_GetNewDSlot returns.

However, for all other uses, afs_GetNewDSlot is incorrect, and causes
various serious problems. After we have initialized our dcache
entries, any attempt to read a dcache by slot number should succeed,
since the number of dcache entries never changes after we are started,
and we initialized all of them during client startup.

Some code outside of afs_InitCacheFile was still using
afs_GetNewDSlot; code that reads in a dslot from the free or discard
list. In these cases, if there is any error reading the dcache slot
from disk, we will be given a dcache that has some of its fields not
filled in properly. Notably, we assume that the entry is not on the
global hash table (we set tdc->f.fid.Fid.Volume to 0), and the
tdc->f.inode field is not initialized at all, leaving it set to
whatever was in memory for that tdc before we tried to read the slot
from disk.

This can cause cache corruption, since tdc->f.inode can point to the
inoder for a different existing cache file, so writing to that dcache
modifies the data for another cached file.

To avoid this, modify the non-afs_InitCacheFile callers of
afs_GetNewDSlot to avoid afs_GetNewDSlot. Since these callers read
from the free/discard list, the contents of the dcache entries are not
valid (the cell, volume, dv, etc are not valid), though they must
exist on disk (we have a valid inode number for them). So, create a
new function, afs_GetUnusedDSlot, to get a dcache that must exist on
disk, but does not represent any valid data. Use this for callers that
must get a dslot from the free/discard list.

Add some comments to try and help explain what is going on.

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

Change-Id: I0ed66c155ea5574fd88c288bdf9feb98161e5c45
Reviewed-on: http://gerrit.openafs.org/8545
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
2012-12-05 01:27:59 -08:00
Andrew Deason
972cedc2e7 afs: Log slot for GetDSlot read errors
When we log that a disk read error occurred during GetDSlot, log which
slot we were trying to read for convenience.

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

Change-Id: I0d5fffd3ef3af5d788db082e10c401afc0dd440a
Reviewed-on: http://gerrit.openafs.org/8544
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
2012-12-05 01:24:22 -08:00
Andrew Deason
94e3c06e46 LINUX: Dir follow_link should set LAST_BIND
For our faux-symlink directory follow_link operation, we leave the
given nameidata struct with an invalid 'last' component. That is,
nd->last is not changed or set to anything meaningful.

Usually the callers of our follow_link op do not care about the last
component of the nameidata. However, at least one caller does: the
caller near the do_link label in open_namei(). This is called during
processing for O_CREAT operations on symlinks, and since our
directories look like symlinks, it gets called. It tries to use
nd->last to look up the last component of the dereferenced path (so it
can try to create it, as necessary), but since our nd->last is not
set, this will not work.

Specifically, our nd->last.name is not pointing into the names cache,
so the subsequent putname/__putname on it will corrupt the names
cache. However, even if this were not a problem, the actual contents
of the last component do not seem meaningful so this would probably
result in incorrect behavior anyway.

To avoid all of this, set nd->last_type to LAST_BIND, so any callers
know that the last component of the given nd is not valid, and we are
pointing directly to the target component with a dentry.

Reviewed-on: http://gerrit.openafs.org/8489
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit bd57c7d64844ca26d80f2b29db470dacd134fc56)

Change-Id: I4defb55064a4452e437b8a6c3e600887b4749fff
Reviewed-on: http://gerrit.openafs.org/8543
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
2012-12-02 11:01:30 -08:00
Andrew Deason
ed8af9f7d0 afs: Do not skip flushing pages for dv-0 files
If the dv for a file is 0, we know the file is empty. Currently we
skip flushing pages for such files, presumably the idea being there is
no data in the file, so there should be no pages to flush.

However, Linux seems to keep empty pages around for empty files. So, a
future read can result in the application reading a page full of
zeroes, unless we flush the page here. While this has only been found
to happen on Linux 2.6.22 and later (and distribution-specific
backports, like RHEL 2.6.18-128), other platforms could in theory also
choose to do this. It would be difficult to find out when another
platform started to behave like this, so just remove this skip for
everyone so we never have to deal with this again.

Replace this code with a comment with a quick explanation, in case
anyone tries to add a similar optimization here in the future.

Thanks to Richard Brittain.

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

Change-Id: I76aed81e0d8acdbf13bc952ac8557b051d2869bf
Reviewed-on: http://gerrit.openafs.org/8484
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2012-11-28 07:18:44 -08:00
Jeffrey Altman
b2d17370ab Windows: cm_LookupInternal obtain type of target
cm_LookupInternal needs to return the target of a mount point
if the matching directory entry is a mount point.  Therefore, if
the target type is unknown the status information must be queried.

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

Change-Id: I02d09772df1ef32800736fd798f2f5f4b2997a86
Reviewed-on: http://gerrit.openafs.org/8532
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2012-11-27 07:44:51 -08:00
Michael Meffie
7472866c71 vol: allow non-dafs volume utils to attach with V_READONLY again
Allow non-fileserver, non-dafs, programs to attach volumes with the
V_READONLY mode again. This was lost during the code changes for
dafs.

The caller sends a fssync request to the fileserver, which updates the
on-disk contents of the volume headers, before the caller reads the
volume headers, allowing the caller to have the most recent info about
the volume. The fileserver still has the volume in use.

Later in the attachment process, the inUse check is skipped for the case
of a non-fileserver process which is attaching the volume using the
V_READONLY mode, otherwise the attachment would incorrectly mark the
volume as needing to be salvaged.

Note: The mode checks in VMustCheckOutVolume() are correct. We must
checkout the volume when attaching with the V_READONLY mode. This
fix updates the VShouldCheckInUse(), in which an additional
exception was added to cover the case for V_READONLY mode from a non-
fileserver process.

Note: A check is added in the dafs version of attach to avoid overwriting the
inUse field when a volume utility is attaching a volume in V_READONLY mode.
Currently, V_READONLY is not used by dafs, but this was done to avoid future
errors.

Reviewed-on: http://gerrit.openafs.org/8339
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 0eaa0d1baa8b8fe115301f188ce32176acc7b065)

Change-Id: I584027e2104fd4928b16b591a2ab9e2613e49ec7
Reviewed-on: http://gerrit.openafs.org/8458
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
2012-11-19 18:43:25 -08:00
Michael Meffie
aecc87faf7 fix stale volume info from vos examine (non-dafs)
A volume examine on a non-dafs volume server/fileserver can show old
information, including old volume update time, for up to about 20
minutes. The non-dafs volume server reads the volume information
from the volume headers, which are updated by the fileserver only
periodically to avoid excessive i/o.

Before dafs, when the volume server performed a volume examine, the
volume server would send a fssync command to the fileserver with the
request FSYNC_NEEDVOLUME and mode V_READONLY. The fileserver writes
the current memory contents to disk on this fssync command. The
volume server would then attach the volume, reading the current
volume data.

The dafs volume/fileserver avoids this extra i/o by using a new set
of fssync commands to retrieve the volume information from the
fileserver. However, the non-dafs volume server does not use the new
fssync commands and reads the volume headers from disk.

Revert the volume attachment processing for the non-dafs volume
server to request the volume with the V_READONLY mode. This causes
the fileserver to update the volume headers, allowing the volume
server to read the up to date volume header data.

Sadly, this adds another dafs ifdef to the already twisty maze of
passages that all look alike.

This changes the volserver to use the V_READONLY attachment mode
only for the case of getting a single volume, as that what was
done in 1.4.x.

Reviewed-on: http://gerrit.openafs.org/8327
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit bcb077a00fb575e7beb92739646054ea67ca0b79)

Change-Id: I5b5982efd5ee3aea13515add83b71d424dbd3a60
Reviewed-on: http://gerrit.openafs.org/8459
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
2012-11-19 18:43:11 -08:00
Ben Kaduk
85794b6561 Catch up to FreeBSD non-MPSAFE deorbit
All filesystems must have their own locking now.
We have been MPSAFE for quite some time, but the preprocessor macro
"MPSAFE" has been removed and we must catch up in order to compile.

The MNTK_MPSAFE macro has not yet been removed, but it is toothless
now, so we can preemptively stop using it.

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

Change-Id: I35ad1c63bf3b1c91035bcdd29d7cfcb5603dfd12
Reviewed-on: http://gerrit.openafs.org/8374
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-11-08 14:56:54 -08:00
Garrett Wollman
90a29d8244 FBSD: coalesce three assignments to the same variable
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5233
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e3148c6bfad25fdcb86b7248bd6b05432502d4ce)

Change-Id: I549bbeb4397d357257497179cd459f6034f93113
Reviewed-on: http://gerrit.openafs.org/8373
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-11-08 14:56:38 -08:00
Jeffrey Altman
21ae26a93d rx: fix abort on missing service
patchset 1fbe83f9aacfc36a9c426ba1fd18ad7c72869dc1 introduced
the possibility that a NULL connection pointer could be dereferenced.
Prevent it.

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

Change-Id: I1e01005a34e5d373b6810052d94fac8d96f40e4f
Reviewed-on: http://gerrit.openafs.org/8371
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-11-07 14:09:30 -08:00
Derrick Brashear
598e58ba6f configure: check for poll()
if we have code which uses HAVE_POLL, check for poll().

Reviewed-on: http://gerrit.openafs.org/8357
Reviewed-by: Chaskiel Grundman <cg2v@andrew.cmu.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 7fe30bd28e62ad0ed717c24e8eccf5e563b9cd68)

Change-Id: I99a25d20d0d98e516d72f885feef2a4d15ca01fb
Reviewed-on: http://gerrit.openafs.org/8367
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-11-07 11:13:31 -08:00
Ben Kaduk
a73795479f FreeBSD major version numbers are multi-character
Do not assume that there is only a single character before the dot.

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

Change-Id: I4b9016af301c4e9393e87fa59d6fa9d19dcd9843
Reviewed-on: http://gerrit.openafs.org/8342
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-10-30 18:31:58 -07:00
Ben Kaduk
2a478d422f Patch up FreeBSD-10 support
The auto-guessing code for sysnames produces *_fbsd_100, so we can't
just claim that we'll be *_fbsd_1000 for kicks.
Revert back to the old behavior so as to be less disruptive.

Reviewed-on: http://gerrit.openafs.org/7595
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 44ca4aa90ef101fb13b3b5327ca19381b5464fb3)

Change-Id: I302b9f36913b6cd86f65b7263c85d91745330ae6
Reviewed-on: http://gerrit.openafs.org/8341
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-10-30 18:31:51 -07:00
Ben Kaduk
b395e5183d Catch up on fbsd releases
Pull in the changes needed to even have a chance at supporting
FreeBSD 8.3, 8.4, 9-stable, and 10-current.
Conditionals for changed interfaces in a follow-up commit.

Reviewed-on: http://gerrit.openafs.org/7581
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 58e7d52d0066a9f237971f39e7acdde02761172a)

[Edited param.*.h files to add AFS_64BIT_ENV for 1.6.x]

Change-Id: I3218a84a024011af573d64821a2599b1330b3f71
Reviewed-on: http://gerrit.openafs.org/8340
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-10-30 18:31:44 -07:00
Marc Dionne
ca94c83c4a Linux: Rework handling of names in the lookup functions
Rework the name lookup functions in the kernel to deal more cleanly
with the change of API for kernel 3.7

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

Change-Id: I967c80fac754fbee1836b84dfb50dd5fdcba35f0
Reviewed-on: http://gerrit.openafs.org/8338
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-30 02:57:14 -07:00
Marc Dionne
cf3325236c Linux: fix afs_putname wrapper for pre-3.7 kernels
Make the compatibility function use the right type for pre-3.7
kernels.

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

Change-Id: I820340058a6cdecbd438fdc13ed3d54a439340e0
Reviewed-on: http://gerrit.openafs.org/8337
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-30 02:57:04 -07:00
Marc Dionne
5aae6e0c18 Linux 3.7: putname is no longer exported
putname is unexported in kernel 3.7.  Add a compatibility inline
afs_putname function and open code it if necessary.

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

Change-Id: Icf0e249f87bfe80a262e5599ab9958355ed9a90f
Reviewed-on: http://gerrit.openafs.org/8336
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-30 02:56:47 -07:00
Andrew Deason
4c4075ade0 libafs: Correct afs_LoopServers flags
AFS_LS_DOWN was actually checking up servers, and AFS_LS_UP was
checking down servers. Fix the handling of the 'adown' flag so we do
the right thing.

1.6-only: Note that this does not contain the change to afs_FlushVCBs,
since 1.6 does not contain change cee2c677, which introduced the
relevant afs_FlushVCBs afs_LoopServers call.

Reviewed-on: http://gerrit.openafs.org/4624
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 1f48bc7a30d5df88a1e5f539ee22df3952533a88)

Change-Id: Ibf56812134800a047642455a528dae488c52bcf9
Reviewed-on: http://gerrit.openafs.org/8309
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
2012-10-29 08:18:56 -07:00
Marc Dionne
2aab481dfa libafs: Fix second pass in ShakeLooseVCaches
Commit 3105c7ff introduced a two phase process for reclaiming
vcache entries.  First go through the list and do what's possible
without sleeping (skipping aliased dentries on Linux), then do
a second pass only if necessary, allowing sleeping.

Unfortunately the test for the end of the VLRU scan is incorrect
and can never trigger, so this second pass was effectively disabled
and any code that is conditional on defersleep=1 was never
exercised.  The code to start the second scan also has issues.

Fix the end of VLRU test, and also correctly set the variables
needed to restart the scan.

Change-Id: I8034cd3b79aab4f2976ab2559c13c102126480d7
Reviewed-on: http://gerrit.openafs.org/8234
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit a7828d50a82384e6d0fb0ad5b5a702f768029581)
Reviewed-on: http://gerrit.openafs.org/8247
2012-10-18 02:32:19 -07:00
Marc Dionne
0506af9c05 Linux: osi_vcache: Fix loop for the hlist case
An hlist is not circular, and the end is marked by a NULL next
pointer.

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

Change-Id: I7e4e3ed2515dd8c2ec765d8acbb97eba189d6aeb
Reviewed-on: http://gerrit.openafs.org/8239
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-18 02:14:29 -07:00
Derrick Brashear
780e4c462b libuafs: enable 64 bit mode on linux
already safe and being used on other platforms; might as well
here too.

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

Change-Id: I61673c179617377020aa95aa8d8d659f240f04e7
Reviewed-on: http://gerrit.openafs.org/8238
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-16 04:11:47 -07:00
Michael Meffie
4c24ac8f8a vlserver: use the logging function to log
Use the logging function to log instead of printf.

Change-Id: I377474881830152c93122bd3112e355ab5fd56ad
Reviewed-on: http://gerrit.openafs.org/7895
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit beb8f07496f59a19621bb0db14b401107888de35)

Change-Id: I246610abc3a6c2e164e0f368bc75a671f5f52e4d
Reviewed-on: http://gerrit.openafs.org/8208
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-07 06:03:35 -07:00
Michael Meffie
0720095b09 vlserver: fix logging of ip addresses
Remove the spurious dates surrounding IP addresess in the VLLog.
Instead of multiple calls to the logging function for a given log
line, format a string containing the addresses and call the log
function once.

Changes the log output from,

  ...  The following fileserver is being registered in the VLDB:
  ...         [Tue Jul  4 14:11:43 2012 192.168.10.128Tue Jul  4 14:11:43 2012 ]
  ...  It will create a new entry in the VLDB.

to,

  ...  The following fileserver is being registered in the VLDB:
  ...         [192.168.10.128]
  ...  It will create a new entry in the VLDB.

Reviewed-on: http://gerrit.openafs.org/7750
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 65a5e3ce92c47a87c3dca54cec456ae0337c78ef)

Change-Id: I106556cda1046e6e8c971787ed8d056da70b77b9
Reviewed-on: http://gerrit.openafs.org/8207
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-07 06:03:20 -07:00
Michael Meffie
4071a3ec0e vldb_check: fix cross-linked mh entries
When run with -fix, consolidate server numbers in vl entries which
point to the same multi-homed entry. Use the lowest server number
from the set of server numbers which point to the same multi-homed
entry.

Remove unreferenced address entries which are duplicate multi-homed
indexes.

Two passes of vldb_check -fix may be required; first to fix the
vl entry server numbers; then to remove the duplicate address
entries.

Reviewed-on: http://gerrit.openafs.org/7999
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 911f751d1edfb18ddd5f6a699746ba14730d553d)

Change-Id: Iec977e25344ce1d5f93e3f107cc1b7ebc81d2c26
Reviewed-on: http://gerrit.openafs.org/8212
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-07 06:02:35 -07:00
Michael Meffie
aa10a191f8 vldb_check: remove unreferenced mh entries with -fix
When running vldb_check with -fix, clear any mh extent entries which
are set but are not referenced by an address entry in the
IpMappedAddr table.  These unreferenced entries already generated a
warning.  This commit adds the feature to clear the unreferenced mh
entries using vldb_check -fix option.

Reviewed-on: http://gerrit.openafs.org/7616
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit fdd3b0fb1f8e6948c651d7f1822d17a78668e5ff)

Change-Id: I79c79b3499fce448ebf662246de9f623b1565995
Reviewed-on: http://gerrit.openafs.org/8211
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-07 06:02:22 -07:00
Michael Meffie
c84b0c1978 vldb_check: warn about cross-linked mh entries
Warn if an mh extent entry is referenced by more than one server
number in the IpMappedAddr table.

The serveraddr table is used to determine which server numbers have
IP addresses.  If, for some reason, multiple server numbers
reference the same mh entry, currently, the correct serveraddr value
is calculated only for the lowest server number in the set of server
numbers which reference the same mh entry.  Handle this case, and
warn about the duplicated values in the IpMappedAddr table.

Warn about IpMappedAddr entries which reference non-existent mh
blocks.

Reviewed-on: http://gerrit.openafs.org/7615
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 08e803bce3375bb69a01715b026d844b7a8e0ab3)

Change-Id: I1d2a2d09ed468a247b4da6c07b5ecb4224a80c05
Reviewed-on: http://gerrit.openafs.org/8210
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-07 06:02:11 -07:00
Michael Meffie
2d750f7dce vldb_check: off by one host address table error
Fix several off-by-one errors when traversing the IpMappedAddr
table in vldb_check. The last index (254) was not checked
in several places.

Reviewed-on: http://gerrit.openafs.org/7614
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit a27a8a66c2c27a62afa566679ef9cf424e758d9f)

Change-Id: I5fd5b452cafe641765247bdf11ef1a1b08cc1529
Reviewed-on: http://gerrit.openafs.org/8209
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-07 06:01:56 -07:00
Mark Vitale
9eb532ff9c vos: convertROtoRW - prevent VLDB corruption
vos convertROtoRW incorrectly marks the first VLDB entry as the
new RW if the converted RO is not in the VLDB.  Correct this
by creating a new valid RW site in the VLDB entry.

Change-Id: I683ac10db90c2c41717c11c0d86eadc81a935e52
Reviewed-on: http://gerrit.openafs.org/8037
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit f258e7dddeb4331d2cf4649541c1a3adfa7a416a)
Reviewed-on: http://gerrit.openafs.org/8216
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-07 06:00:59 -07:00
Mark Vitale
38ad78ae0d vos: convertROtoRW incorrect warning when RO not in VLDB
vos convertROtoRW will issue an incorrect warning about a partition
mismatch if the RO to convert is not in the VLDB.  Only check the
partition if the RO is in the VLDB.

Change-Id: Ib2726bc5bf6697898ad26dc1d817143da3286ba3
Reviewed-on: http://gerrit.openafs.org/8036
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit b650106e301ecefe2f5c8f4a34081af1f5f74901)
Reviewed-on: http://gerrit.openafs.org/8215
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-07 06:00:41 -07:00
Mark Vitale
a8ea5b8f74 vos: convertROtoRW susceptible to VLDB changes during override prompt
vos convertROtoRW obtains a VLDB entry, then peforms some setup logic
(including a possible user prompt) before obtaining a volume lock.
This exposes the code to possible time-of-check/time-of-use issues.
After obtaining the volume lock, get a second copy of the VLDB entry
and compare it to the first copy; if it has changed, fail the conversion
with an error message asking the user to re-issue the vos convertROtoRW
command.

Change-Id: I9c1a634cea2e22188869d54b00b7831aed12b1cd
Reviewed-on: http://gerrit.openafs.org/8008
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 3c489db55811dfe3fdf5e555bf229989e5b58aa6)
Reviewed-on: http://gerrit.openafs.org/8214
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-07 06:00:28 -07:00
Mark Vitale
361d391af9 vos: convertROtoRW may create 2nd RW on a fileserver
If an RW is already present on disk on the target server (any partition),
'vos convertROtoRW' will still convert the RO, creating a second RW on the server.
Detect this and refuse to convert the RO by returning EXDEV (invalid cross-device link).

Change-Id: Ide15a7c39f2a975fd8597e497094b6a67b448e4f
Reviewed-on: http://gerrit.openafs.org/7934
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 0c77c0acabe0a0588ab0a9efab0124ee1e15ef6a)
Reviewed-on: http://gerrit.openafs.org/8213
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-07 06:00:15 -07:00