8840 Commits

Author SHA1 Message Date
Andrew Deason
141432033b doc: Correct volume size CAUTIONS notes
2 terabytes is 2^41 bytes, not 2^31 bytes. Also clarify that volumes
can be much larger than this.

FIXES 130188

Reviewed-on: http://gerrit.openafs.org/7598
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 300cbb28b08c2fd3709942cc6c48e7d9369a3394)

Change-Id: I762e18e83d4557c8fd4db3601426bcaaa845199a
Reviewed-on: http://gerrit.openafs.org/7674
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2012-07-03 07:54:38 -07:00
Andrew Deason
8612ef45ef doc: Fix whitespace errors
Reviewed-on: http://gerrit.openafs.org/7599
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit fcaa53a6d7289665b64037a0d96ae4c6cbf4f776)

Change-Id: I69f90ca4d764a25720e8625443c0b86751914cca
Reviewed-on: http://gerrit.openafs.org/7673
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2012-07-03 07:54:19 -07:00
Andrew Deason
fee0b7cdca doc: Consolidate CAUTIONS notes about volume size
Reviewed-on: http://gerrit.openafs.org/7597
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 3ff8ef499c56008f4d2ebf5b81e08e98eb0c0826)

Change-Id: Ie29664d105e0f35140fdf3c164da78564f6b5e36
Reviewed-on: http://gerrit.openafs.org/7672
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2012-07-03 07:54:02 -07:00
Andrew Deason
d7428d0c68 doc: Consolidate NetRestrict format docmentation
We were specifying exactly the same format in two different places;
consolidate them into one place. In addition, explicitly say there are
is no way to specify a range of addresses, in case some people are
confused by the previous versions of this man page that erroneously
said you could use 255 as a wildcard.

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

Change-Id: I7bae4786b6a0cc2115688bd54d1c1128dc0f5df2
Reviewed-on: http://gerrit.openafs.org/7671
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2012-07-03 07:53:42 -07:00
Andrew Deason
eeaca85e80 doc: Remove reference to NetRestrict wildcards
Commit 80fc888a9223050481de932233fe7121a48df194 got some of this, but
forgot the other reference. We don't support these anywhere, so remove
it here, too.

FIXES 125340

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

Change-Id: I58e0fa2ea138a08b45d136abb9fcd43f9f3dc11a
Reviewed-on: http://gerrit.openafs.org/7670
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2012-07-03 07:53:27 -07:00
Marc Dionne
407e7c90a9 Linux 3.5: encode_fh API change
The encode_fh export operation now expects two inode arguments
instead of a dentry and a "connectable" flag.  Use the inode of
the dentry we're interested in, and NULL as the parent inode which
is the same as passing a 0 flag in the previous API.

Change-Id: I05cf146fb2a4bacdca20a9f108d04ccb11530804
Reviewed-on: http://gerrit.openafs.org/7523
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 5227148ae17949705487ea673d558ebfe143e635)
Reviewed-on: http://gerrit.openafs.org/7579
2012-06-27 05:36:01 -07:00
Marc Dionne
8de83579f7 Linux 3.3: use umode_t for mkdir and create inode ops
The mkdir and create inode operations have switched to using
umode_t instead of int for the file mode.

Change-Id: Ib8bbf6eaa6e87d6a9692c45b1a3fe93fcc3eff7a
Reviewed-on: http://gerrit.openafs.org/6567
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit beafc7f742ebad021bfcbed73884aecedee4e04b)
Reviewed-on: http://gerrit.openafs.org/7577
2012-06-27 05:35:46 -07:00
Derrick Brashear
14d02a1e80 aklog: can't assume krb5_524_conv_principal based on convert_creds
add probing for krb5_524_conv_principal directly instead of
assuming finding a 524 library will find it. current heimdal
does not include it.

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

Change-Id: Icc576d1a711fa771fda393c61a15082ffb94defc
Reviewed-on: http://gerrit.openafs.org/7582
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-06-27 05:34:46 -07:00
Marc Dionne
cc63cbbc13 Linux 3.4: replace end_writeback with clear_inode
end_writeback() is renamed to clear_inode().  Add a configure test
and cope.

Change-Id: Icaf5b6b54d0ee377fabcf0b295d690eaa6b4be5e
Reviewed-on: http://gerrit.openafs.org/7503
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 2b33384a4a7b88842281021129ffccc837d91d36)
Reviewed-on: http://gerrit.openafs.org/7578
2012-06-21 05:47:53 -07:00
Marc Dionne
9bd5c20c21 Linux: remove unused variable
endindex is not used, remove it

Change-Id: I50a89e3f25828c05fd24f4fc6a1068007a68dbc2
Reviewed-on: http://gerrit.openafs.org/5012
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a76e65034cf3feadfe2af5a20ddae705fda00aa0)
Reviewed-on: http://gerrit.openafs.org/7580
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-06-21 05:47:05 -07:00
Andrew Deason
93f9c397a2 afs: Do not QueueVCB before osi_dnlc_purge*
In afs_FlushVCache, when we QueueVCB, we might drop the afs_xvcache
lock (as of 76158df491f47de56d1febe1d1d2d17d316c9a74). The vcache may
still be on the DNLC, so a lookup while xvcache is dropped can cause
someone else to grab a reference to the vcache while it is being
flushed. This can cause panics and failed assertions, since someone
will have a reference to the flushed vcache, which is effectively
freed and many of the structure fields are no longer valid.

So instead, do not call QueueVCB until we have purged the vcache from
the DNLC.

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

Change-Id: Idabad9076c6c36bede3faf459abb940aae5a975c
Reviewed-on: http://gerrit.openafs.org/7502
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 17:33:12 -07:00
Andrew Deason
8c99f6de5d afsd: Avoid dir interpolation for memcache
memcache doesn't make use of fullpn_DCacheFile, fullpn_VolInfoFile,
etc. Do not even try to generate these strings for memcache, since
cacheBaseDir will be NULL, and so this can cause a segfault on some
platforms including Solaris.

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

Change-Id: I46f2da9b2f0e5f8d004ebd3d799a3c1ac22c3e95
Reviewed-on: http://gerrit.openafs.org/7501
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 17:32:57 -07:00
Andrew Deason
b2079ef799 afsd: Avoid printing cacheBaseDir for memcache
cacheBaseDir is NULL when memcache is turned on; don't print it.

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

Change-Id: Ie5dce3a3ae12b2725c90475cd3f6718f9df63134
Reviewed-on: http://gerrit.openafs.org/7500
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 17:32:43 -07:00
Mark Vitale
321dda2d28 vos: volume lock not released on convertROtoRW error
If an error occurs during convertROtoRW, the volume lock may
not be released.

Reviewed-on: http://gerrit.openafs.org/7389
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 33eff6597facc01bbcd5266fb83c8a6bfa40dfa8)

Change-Id: I0b87fd3b99f178d99f997032c14673def111c1de
Reviewed-on: http://gerrit.openafs.org/7499
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 17:32:26 -07:00
Mark Vitale
2a72c27411 vos: convertROtoRW does not respect volume lock
vos convertROtoRW was not checking the return code from
ubik_VL_SetLock().

Reviewed-on: http://gerrit.openafs.org/7388
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 38ebd79bafee3c97323aa603906d1d5f279ec450)

Change-Id: I391c5b0d3d385af08eb2aec245f943081c7b84e3
Reviewed-on: http://gerrit.openafs.org/7498
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 17:31:22 -07:00
Mark Vitale
f07737a27e vos: convertROtoRW may create two RW volumes
If the RW volume is listed after the RO convert target in the VLDB,
the code failed to detect that an RW is already present and would
create a second RW volume.

Reviewed-on: http://gerrit.openafs.org/7385
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 9a728fd86c7add13e15dfa0d3062fa94cc77c53f)

Change-Id: I7e4eaf0ffefedb3c665e28656a75959eb8677071
Reviewed-on: http://gerrit.openafs.org/7497
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 17:31:07 -07:00
Mark Vitale
baaba2a334 vos: convertROtoRW misc error reporting problems
Fixes a few inconsistencies and bugs in some error messages.

Reviewed-on: http://gerrit.openafs.org/7387
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit e1c6ad7d580041caf35f698c9b2241fb45f02361)

Change-Id: Icee86e1750920d50b94e29acc5504bd1a2ea9e6e
Reviewed-on: http://gerrit.openafs.org/7496
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 17:30:55 -07:00
Derrick Brashear
986a31722e macos: update AFS prefs pane
modify afshelper to just run what it's told instead
of offering fixed operations. this avoids having a setuid
tool around. in spite of apple's suggestion this is correct,
it's actually more dangerous. instead, elevate privilege only
to run a small set of commands, then drop. allow
unlocking of the prefs pane, but make the menu extra prompt
for authentication when needed.
deactivate controls in the prefs pane when locked.

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

Change-Id: Iba4435829a57e91e45b0beea10a8d6573b62a214
Reviewed-on: http://gerrit.openafs.org/7495
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 07:47:08 -07:00
Mark Vitale
0efed9d21e DOC: vos convertROtoRW security requirements
They were copied from another command; corrected them.

Reviewed-on: http://gerrit.openafs.org/7305
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit a2f523b50592e261fe9cd3ef32978e786011c3c7)

Change-Id: I03101cec5bfd20555e33f639ce2c08cde873d646
Reviewed-on: http://gerrit.openafs.org/7494
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 07:46:51 -07:00
Ken Dreyer
b6a07c5b10 doc: add Windows section to fs newcell
fs newcell works slightly differently on Windows. Document the
differences in the man page.

FIXES 125094

Reviewed-on: http://gerrit.openafs.org/6919
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 186158c9eb2379ec350831b8fb244c51ae234a6e)

Change-Id: Ie0daa8631c45eb457c5eb7a1e80a1f70401127d6
Reviewed-on: http://gerrit.openafs.org/7493
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 07:46:34 -07:00
Andrew Deason
78020ab61e vol: Free vol header on attach_volume_header error
In attach_volume_header, make sure we free the volume's header if
we're returning an error. We take care of the locks and i/o handles in
the immediately preceding block, but for an actual error we don't get
rid of the header. Do so.

Noticed by Tom Keiser.

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

Change-Id: I1d49c18f23cd576dfcde114238ea2b41e1356039
Reviewed-on: http://gerrit.openafs.org/7492
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 07:45:24 -07:00
Andrew Deason
29102b48c1 vol: Pay attention to specialStatus after VAVByVp
attach2/VAttachVolumeByVp_r do not alter the yielded error code
according to specialStatus. So, pay attention to specialStatus after
receiving an error from VAttachVolumeByVp_r, to ensure we respond with
the correct error code.

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

Change-Id: I1d0cb429b9cd875fa43a3af2e8c5d5d96ee12f85
Reviewed-on: http://gerrit.openafs.org/7491
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 07:43:31 -07:00
Andrew Deason
a45a0eafb1 vol: Avoid VBUSY/VRESTARTING trick for offline vop
Currently, if GetVolume() finds that the volume we're trying to attach
has a vol op that leaves the volume offline, we do the
VBUSY/VRESTARTING trick as described in CheckVnode(). This doesn't
make any sense for a couple of reasons.

For one, VBUSY/VRESTARTING is not the correct error code to return to
the client when an offline vol op is in progress and vp->specialStatus
is not set everywhere else we yield VOFFLINE.

Additionally, this block of code is only hit once for a particular vol
op. Once we reach this section, the volume is in UNATTACHED state, and
so on the next iteration of GetVolume we will immediately return
VOFFLINE (or specialStatus). So the CheckVnode-like situation is not
applicable, since we are not returning VBUSY to the same client for 15
minutes; we would return VBUSY once and then return VOFFLINE.

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

Change-Id: I183db2d337c999e9aafd1eba60a80eb5b84264c7
Reviewed-on: http://gerrit.openafs.org/7490
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 07:42:55 -07:00
Andrew Deason
596ed7d29d vos setaddrs: notice unexpected errors
Currently 'vos setaddrs' only prints a message and errors out if the
VL_RegisterAddrs call fails with certain error codes (VL_MULTIPADDR
and RXGEN_OPCODE). But if we get something else like an access error,
we should of course print that out, instead of reporting success.

Reviewed-on: http://gerrit.openafs.org/7322
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 663185d62df501fb9d7a18e6ef329e4f53aa8854)

Change-Id: I86b8729cd091007b84fb8b7bf19c58d477626686
Reviewed-on: http://gerrit.openafs.org/7489
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 07:42:31 -07:00
Andrew Deason
fe588efd2d vol: A GOING_OFFLINE volume should yield VOFFLINE
Currently, GetVolume treats a volume in the VOL_STATE_GOING_OFFLINE
state the same as VOL_STATE_SHUTTING_DOWN, and so returns VNOVOL for a
GOING_OFFLINE volume, but these states are very different.

GOING_OFFLINE indicates that a volume should soon be in the UNATTACHED
state, so we should treat GOING_OFFLINE the same as UNATTACHED for
returning errors to the user. For UNATTACHED, we return specialStatus
if it's set, or VOFFLINE otherwise; so, just do the same for
GOING_OFFLINE.

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

Change-Id: I1f75992da7732596c78041e9eac3b1e3a12082e8
Reviewed-on: http://gerrit.openafs.org/7488
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 07:41:49 -07:00
Derrick Brashear
bb6347a7a5 libafs: don't crash on no addresses in afs_Conn
we try to avoid a crash on a missing serverHost; do the same
on missing addrs in that host

FIXES 130714

Reviewed-on: http://gerrit.openafs.org/7287
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 868378cc00b9ac7016da3dc457abf3fa2016687c)

Change-Id: If8f616002cc67cb865549b8b9ea83a6bd1f9256f
Reviewed-on: http://gerrit.openafs.org/7487
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 07:40:30 -07:00
Derrick Brashear
3bbd8eacf4 macos: remove mistyped vnode warning
newborn vnodes are corrected if needed; don't worry about it.

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

Change-Id: I82485f348afe9adbd0dc5743a4f15f18b7e04420
Reviewed-on: http://gerrit.openafs.org/7486
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 07:39:31 -07:00
Derrick Brashear
99b15c9379 libafs: stop bkg first
because background daemons can have dependence on other subsystems, but
are not needed for other operations, stop them first.

Reviewed-on: http://gerrit.openafs.org/7246
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit e3c93b87b7fa751e9cf4c1356d606b7bb399b06c)

Change-Id: I258519a2ad85af53784cf4db381a7f4a8b429dc8
Reviewed-on: http://gerrit.openafs.org/7485
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 07:38:48 -07:00
Derrick Brashear
cfb91f59d7 macos: lock module against unload during shutdown
during shutdown, once umount finished, it was possible to
unload the module before shutdown completed. fix that.

Reviewed-on: http://gerrit.openafs.org/7245
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit a08f9baa7620a6643f12f0b847c2bbab41a0b255)

Change-Id: I6467b9ead03262a6ec8b0de673d2eeb664df1aef
Reviewed-on: http://gerrit.openafs.org/7484
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 07:37:14 -07:00
Derrick Brashear
cbf46115ea libafs: dont handle outstatus on write error
if a write errored, we can't trust the OutStatus we got. don't.

Reviewed-on: http://gerrit.openafs.org/6714
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 4c8a3cd789a8495d0c0b3f8ff1a7ebb2a20f5336)

Change-Id: I69b26330aca2e5fd0d2092b579a0fcf1514acb53
Reviewed-on: http://gerrit.openafs.org/7483
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 07:34:28 -07:00
Derrick Brashear
1219b7617e refactor afs_CheckServers
basically, we need the ability to reuse this function, so, let's make it work
differently so we can.

Reviewed-on: http://gerrit.openafs.org/3403
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e8d8a2240a57f9f4a11ee45b60c229d3f8447b86)

Change-Id: I2ad9de15cc5471810abfecf0cbc504da7da624b0
Reviewed-on: http://gerrit.openafs.org/6341
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-28 07:34:04 -07:00
Edward Z. Yang
4aec9b1850 Add OpenAFS to the dependencies of remote-fs.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>

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

Change-Id: I16b7b0ac6e68bf91c48652faab339871f18549a5
Reviewed-on: http://gerrit.openafs.org/7449
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-23 10:19:45 -07:00
Michael Meffie
d88edd8dbd bozo: preserve all options over restart
On unix, save all the bosserver command-line options and reuse
them on bosserver restarts. On Windows, the SCM integrator saves
the argument list, just use them.

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

Change-Id: Ic6a8534f84f31f94e69c18fd970ecd368f7ee39e
Reviewed-on: http://gerrit.openafs.org/7395
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 16:38:18 -07:00
Andrew Deason
a8eb0bfd04 viced: Do not offline volume on successful IH_DEC
If we fail to CoW a file due to ENOSPC, we try to IH_DEC the new file
copy, and if IH_DEC fails, we take the volume offline for salvaging.
But IH_DEC returns 0 on success, not on error. So take the salvaging
path when we get non-zero.

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

Change-Id: I207ffc4db59bdbd8b80fa4ffad9210d13d76b68f
Reviewed-on: http://gerrit.openafs.org/7394
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-10 14:34:03 -07:00
Andrew Deason
60d000794d fs: Report default storebehind when errors exist
After 904c9fbe, we no longer print out the default store asynchrony
when any of the supplied paths results in a pioctl error. However, if
just one (or a few) of the paths supplied results in an error (such
as, the path does not exist), this does not prevent us from reporting
the default value.

Instead, keep track of whether or not we have a valid value, and try
to determine the default if we haven't already by the end of
StoreBehindCmd, and print it out.

Reviewed-on: http://gerrit.openafs.org/7376
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 427f53eea7f9c05e7b1913c91d57777d72bc30b2)

Change-Id: I04bebe60fbb275ca44caeed9b8696283c4ded36b
Reviewed-on: http://gerrit.openafs.org/7384
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-08 17:53:53 -07:00
Andrew Deason
b9c03fa6f8 afs: Use cell for md5 inode numbers
When calculating the inode number for a file with md5 inodes, include
the cell number in the calculation, in order to reduce collisions
between cells.

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

Change-Id: I5cf88ecd30a5813697dbf3b86964d53bb1f3915a
Reviewed-on: http://gerrit.openafs.org/7277
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-04-25 03:38:49 -07:00
Andrew Deason
e7ea7af657 afs: Ensure afs_calc_inum yields nonzero ino
afs_calc_inum can currently yield an inode of 0 if MD5-based inode
numbers are turned on. Some userspace applications (and for some
platforms, maybe even the kernel) make certain assumptions about the
inode number for a file; in particular for example, 'ls' will not
display a file with inode 0 in a normal directory listing.

So, read the md5 digest until we get a non-zero result. Fall back to
the non-md5 calculation if we still somehow end up with a 0.

While this case may at first glance seem to be extremely rare, in
practice it can occur, as the current calculation for volume
538313506, vnode 26178 does actually yield a 0.

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

Change-Id: I3d06a4b5dc76934b24ced883b1985bced35c893a
Reviewed-on: http://gerrit.openafs.org/7276
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-04-25 03:38:38 -07:00
Andrew Deason
07bc098589 SOLARIS: Correct misplaced osi_machdep.h #endif
Commit 64778fd7bece52360482f9a51f19b34dac1d2678 removed some '#ifdef
KERNEL' blocks, but for one block in SOLARIS/osi_machdep.h, the wrong
trailing #endif was removed. This effectively makes the last part of
the file Solaris 10+ only, and bypasses the header guard. On systems
before Solaris 10, this causes us to lose the osi_procname definition,
which eventually shows up as an undefined symbol.

So, reinstate the original #endif, and remove the correct #endif
instead.

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

Change-Id: I0edd54c9984c591d56531e4eb210e8374ed8b608
Reviewed-on: http://gerrit.openafs.org/7045
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-04-04 05:27:40 -07:00
Jeffrey Altman
a64864529d viced: AFSDisk, AFSFetchVolumeStatus Int31 PartSize
The AFSDisk and AFSFetchVolumeStatus structures use signed
32-bit integers for representation partition size and
available blocks.  RoundInt64ToInt31() should be used instead
of RoundInt64ToInt32() when assigning their values.

Change-Id: I3834141fce2d54ce8bdfac3dc566074583bb305e
Reviewed-on: http://gerrit.openafs.org/7022
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit e8f6dfac59fe042a04a9ac5eb3c37356cb3a22a3)
Reviewed-on: http://gerrit.openafs.org/7023
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-04-02 20:06:20 -07:00
Jeffrey Altman
c78b25ff5a Windows: Fix VNOSERVICE EventLog parameters
Add missing volume and cell.

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

Change-Id: I86004a463b118493828c5296b684a019085e59fd
Reviewed-on: http://gerrit.openafs.org/6974
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-03-27 18:49:42 -07:00
Derrick Brashear
ad56506382 macos: iterate mdfound packagemakers when spaces are present
even if we get more than one match, and even if there's a space,
work anyway

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

Change-Id: Ibd4ca5cbd5cee45793735cede8cf488a944add3c
Reviewed-on: http://gerrit.openafs.org/6972
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-03-27 10:30:44 -07:00
Derrick Brashear
06dd16f761 macos: find packagemaker instead of assuming path
in xcode 4.3, packagemaker is unbundled. make no assumptions
about where it can be found; instead, let spotlight tell us

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

Change-Id: I5d4083fa743ef181d680ffc2934a56d8429a75dc
Reviewed-on: http://gerrit.openafs.org/6968
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2012-03-26 18:15:24 -07:00
Derrick Brashear
a742a6d979 osx: deal with more kerberos damage
the number of things which can return success without succeeding is
truly sad.

Reviewed-on: http://gerrit.openafs.org/6911
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 59b57ff85acbef10bcec9724c42e3bad78538687)

Change-Id: I487ece6f991157a95e200f7764027902a2402e7b
Reviewed-on: http://gerrit.openafs.org/6965
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2012-03-26 16:29:17 -07:00
Andrew Deason
8d20dd4ddd viced: Do not ignore all InlineBulkStatus errors
InlineBulkStatus currently returns 0 unconditionally, no matter what
errors are encountered. If we encounter an error early enough, from
CallPreamble for example, we do not fill in the OutStats nor CallBacks
structures at all. Since we return success anyway, this results in the
client getting AFSFetchStatus structures full of zeroes (or garbage,
before commit 726e1e13ff93e2cc1ac21964dc8d906869e64406).

Since current OpenAFS clients do not perform any sanity checks on the
information received, this can result in cache corruption of files
being seen incorrectly as empty, and, before commit 726e1e, more
arbitrary corruption.

So instead, return an error if we encounter an error before we iterate
over the given FIDs. We still of course do not return an error for any
errors encountered during the actual metadata retrieval, as those are
reflected in the individual per-fid status structures.

Reviewed-on: http://gerrit.openafs.org/6871
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 690a4c144b53fd1f3538d83017ecf581a2bcded5)

Change-Id: I364b35cfa865d88ab664e45a5d1fc9c542cffc1a
Reviewed-on: http://gerrit.openafs.org/6957
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-03-25 19:17:27 -07:00
Jeffrey Altman
c381d4b151 doc: correct implicit ACL permissions volume owner
OpenAFS changed the behavior of implicit administrator permission
for directory ownership.  In OpenAFS only the volume root directory
owner has implicit administrator permissions and they apply to all
directories in the volume not just those with matching ownership.

Reviewed-on: http://gerrit.openafs.org/6951
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 95ec152a850c0cde33829481b8e71e7e7e686a58)

Change-Id: I33fd24db250ef03a60f7f24853715e6f76d297a8
Reviewed-on: http://gerrit.openafs.org/6952
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-03-25 13:22:22 -07:00
Jeffrey Altman
97f8a000b9 Windows: Client handling of VNOSERVICE
VNOSERVICE should not be grouped together with the volume status
error codes.  It is used to indicate that the RPC was not serviced.
The file server issues it when its idle dead timeout period is reached
while receiving rx call data.  The client's existing status information
is still valid and the client can retry the call.

Reviewed-on: http://gerrit.openafs.org/6938
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 39964d08792f3a09694f97d7c7fa76a86ca213a7)

Change-Id: I2baf441144d24411907760175cc7fa665dc33e41
Reviewed-on: http://gerrit.openafs.org/6940
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-03-22 15:09:57 -07:00
Marc Dionne
d356da74cf Linux 3.4: Switch to d_make_root
If d_make_root is available, use it instead of d_alloc_root.
The helper was introduced in 3.3, and d_alloc_root gets removed
in 3.4.

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

Change-Id: I036a3845d72f99c8ba647975593da496c12a53c1
Reviewed-on: http://gerrit.openafs.org/6932
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-03-22 10:32:07 -07:00
Andrew Deason
55eceee5db LINUX: Use afs_convert_code in afs_notify_change
afs_notify_change currently just returns "-code". This can cause a
panic if the error code is negative, since we will return a positive
error code, which may get interpreted as a valid pointer value in
higher levels.

Specifically, if we hit afs_notify_change via something like this code
path:

do_sys_open -> do_filp_open -> open_namei -> may_open -> do_truncate
-> notify_change -> afs_notify_change (via inode->i_op->setattr)

the positive error value will be interpreted by do_sys_open as a valid
'struct file' pointer, and will be dereferenced.

So pass the return value through afs_convert_code, like all of the
other vnode ops, so we ensure we return an error properly.

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

Change-Id: I5083f6ce4bea5b3bea551e5d47155453b7ff2328
Reviewed-on: http://gerrit.openafs.org/6918
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-03-20 21:00:07 -07:00
Andrew Deason
b44bb369de LINUX: move afs_notify_change to osi_vnodeops.c
afs_notify_change is almost always used solely in inode_operations
structs, and is more similar to the other per-vnode functions. Put it
with the other per-vnode functions for better organization, and so
they can use the same static functions.

Move the helper functions iattr2vattr and vattr2inode along with it.

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

Change-Id: If721c0b13518f8a925f39bcfa1dff005ce97a6cb
Reviewed-on: http://gerrit.openafs.org/6917
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-03-20 20:59:57 -07:00
Andrew Deason
1f00da1a68 afs: Never #define away afsd_dynamic_vcaches
Some versions of the Solaris Studio compiler on SPARC (at least 12.2
and possibly others, but not 12.3) get a little confused by code like
this:

    extern int foo;
    int
    somefunc(void) {
        if (0) return foo;
        return 0;
    }

When optimization is turned off, this results in an undefined symbol
reference to 'foo' (which is normal), but the resulting object file
lacks a relocation entry for the symbol 'foo', so the symbol remains
undefined after linking. In the OpenAFS tree, this occurs in
afs_daemons.c which references afs_vcount and afs_cacheStats in this
manner due to afsd_dynamic_vcaches being defined as '0' on Solaris.
The end result is that the libafs kernel module is not loadable, since
it complains about afs_vcount and afs_cacheStats being undefined, even
though the symbol definitions are also in the module.

While this is a bug in Solaris Studio and has since been fixed, it is
simple to work around this so we are usable with more compilers. If we
just always declare afsd_dynamic_vcaches as a regular variable, it
works around this issue and keeps the code a tiny bit simpler. So, do
that.

Reviewed-on: http://gerrit.openafs.org/6888
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit e5821239cde138f74f73bec1bd9a3880d08ac3df)

Change-Id: I42073ebc7d6822f05de89f1c38370dd70e5c7508
Reviewed-on: http://gerrit.openafs.org/6910
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-03-15 19:49:59 -07:00