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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Depending on the version of DKMS, the current MAKE[0] variable in the
dkms.conf needs different numbers of backslashes. Commit 81a9a33e
tried to address this by changing the contents of dkms.conf depending
on whether or not we were on Fedora. However, the change occurred in
DKMS 2.2, so if someone running RHEL tries to use a newer DKMS, this
will fail.
So instead of trying to guess at the level of escaping we need, just
avoid needing to escape anything with backslashes. We can quote the
heredoc marker to avoid variable expansion inside the heredoc, we can
use a case statement instead of using backticks and local variables
and such, and we can use single quotes for the outer MAKE assignment.
With this, we should not need any backslashes when writing dkms.conf,
so we should work with any DKMS version.
Reviewed-on: http://gerrit.openafs.org/8156
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 72f1f345ece09b1fbd113af17c9e8e25ec9dffa5)
Change-Id: Icbaa1fde7ea222b639a7e5a740f6b18a4a87c74a
Reviewed-on: http://gerrit.openafs.org/8172
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Implementing the d_automount or follow_link function pointers for our
directories means that we can hit symlink resolution limits during
lookup, since we look like a "symlink". We can hit these limits pretty
easily if there are just too many directories in the lookup path.
Our pseudo-symlink directories cannot contribute to an infinite
resolution loop, since our destination is always an actual directory,
not a symlink that will result in more redirection. So, decrement the
total_link_count counter when our d_automount or follow_link code is
reached, so we do not contribute to hitting the max resolution limit.
Note that this is not related to recursive symlink lookup (link_count)
but only to the iterative symlink limit (total_link_count). Our
lookups are not recursive here, and we are not causing more recursive
lookups like a normal text-based symlink would do.
Reviewed-on: http://gerrit.openafs.org/8009
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 238b88624a8fef39557d397cc336c88bd8efc5b1)
Change-Id: Iec6e3fac25ab86ef5f10f359344908398bef8828
Reviewed-on: http://gerrit.openafs.org/8194
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
The nameidata argument is dropped, replaced by an unsigned flags
value. The configure test is very specific; kernels with the
older API with a signed int flags value should fall through.
Reviewed-on: http://gerrit.openafs.org/7986
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 7413cd09a53f89882a46fd100bf6c501348f2188)
Change-Id: Ie68d70dcf414d24e7e980c8a8f35b83550d2da7c
Reviewed-on: http://gerrit.openafs.org/8083
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
The nameidata argument is dropped and a flag is added.
Reviewed-on: http://gerrit.openafs.org/7985
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 020e32779c103817ca89caa51259fb53bc3dde79)
Change-Id: Iae2a0301a1c4acb6835eb0bdca6ae22b143b2cda
Reviewed-on: http://gerrit.openafs.org/8082
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>