8710 Commits

Author SHA1 Message Date
Ben Kaduk
2ad4d31d40 FBSD: cleanup dvp locking for ISDOTDOT
This is a more correct version of
c2ed2577f9c16df3088158fb593d7aab6e8690d0, which was reverted since
it caused build issues on some versions and kernel panics on others.

We do want to always unlock dvp before calling over the network
in the ISDOTDOT case, but be sure to use the proper spelling
for this operation (as the syntax has changed between FreeBSD versions).
This requires not unlocking dvp right after the afs_lookup() call if
it succeeds, letting us just lock the "child" vp (which is actually
the parent starting from '/') first, and then re-lock dvp.

The error case of afs_lookup() was already handled correctly in
this logic, which is to say that it was incorrect before this change,
attempting to recursively lock dvp which causes a panic.

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

Change-Id: I2d929875a9b008f0aa0b64bce7971932691d9956
Reviewed-on: http://gerrit.openafs.org/6234
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-12-08 20:37:47 -08:00
Ben Kaduk
c515e30b2b FBSD: typo fix
Gerrit/5572 added conditionals on __FreeBSD_version >= 900044, which
is (approximately) when a bunch of kernel API renames happened.
(There has since been a dedicated version bump to 900045 a month
or two post-facto, but 900044 should be fine for now.)
However, 900044 is not 90004.

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

Change-Id: Ibacd6d037590df0696b8dab8107d36bca470785a
Reviewed-on: http://gerrit.openafs.org/6233
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-12-08 20:37:15 -08:00
Derrick Brashear
4e05bc3b5c remove CopyOnWrite2 and unused vars
unused static functions make grumpy compilers grumpy.

(cherry picked from commit 7a6cf450babea4e706392cb8ad83586fa7f8e558)

Change-Id: Ib40be2b9458ca799ba2b808ed86a627c40cf6ec4
Reviewed-on: http://gerrit.openafs.org/6161
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2011-12-01 09:57:31 -08:00
Derrick Brashear
c73b66447c viced: disable accelerated copyonwrite
don't do multistage CoW

FIXES 130295
(cherry picked from commit 97540f78aa333feefe9f567ee71695c1d6451f5c)

Change-Id: I1cd9d54ec9202aa4a11828cd443622413f195687
Reviewed-on: http://gerrit.openafs.org/6160
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2011-12-01 09:57:19 -08:00
Simon Wilkinson
a8160e4628 Unix CM: Fix PutVolume in afs_BlackListOnce
It isn't safe to keep accessing a structure once we have Put our
reference to it.

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

Change-Id: I013b5d6ecf7705745ab16c8736f32ca7750b933b
Reviewed-on: http://gerrit.openafs.org/6124
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-27 18:40:52 -08:00
Andrew Deason
d52f1a5038 afs: Leave cellnum alone for explicit mtpt cell
When a mountpoint is given an explicit cell, don't alter cellnum.
Cellnum represents the cell for the parent, and is used for
determining whether or not we're crossing a cell boundary.

Previously, this code forced the mount point to always be treated as
foreign (for a mountpoint prefixed with a cell name), or to always be
treated as local (for a mountpoint prefixed with a cell number).

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

Change-Id: I8d2b378a95533aabd65e7121000ce34238d728b7
Reviewed-on: http://gerrit.openafs.org/6123
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-27 18:40:30 -08:00
Derrick Brashear
9865698ee0 dafs: avoid null deref getting volume header
we don't assign hd before dereferencing. stop dereferencing
and just use the queue cursor.

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

Change-Id: Iec2dbbf84e4f08f02998c9e998d2ea899ce48a5d
Reviewed-on: http://gerrit.openafs.org/6122
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-27 18:40:17 -08:00
Edward Z. Yang
fbf2f3cbab Linux: 3: Update specfile to know about 3.* kernels.
Update spec file to be consistent with acinclude.m4 with regards to
sysnames.  We don't bother updating the code inside the legacy kernel
build section, as it doesn't get triggered for 3.* kernels (it should
probably get cleaned up at some point.)

Also, fix a bug in error message printing of unrecognized kernel.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>

Reviewed-on: http://gerrit.openafs.org/6120
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 0f9214164ad56bfe74d0f2cec8775a312f5128dd)

Change-Id: Ie414751cf01c44a73bf9eaef67c593cced2680d9
Reviewed-on: http://gerrit.openafs.org/6121
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-27 18:40:04 -08:00
Marc Dionne
032736bc05 Linux: make sure backing_dev_info is zeroed
The afs backing_dev_info structure is allocated dynamically
without zeroing out the contents.  In particular there's no
guarantee that congested_fn is NULL, causing spurious oopses
when bdi_congested in the kernel tries to call it.

(adapted from commit 8e97cf6f215d5575c63d86eaec59031399f4beda)

Change-Id: I83755b6bb5ec2fada7e077c00d3d8edf8af1cae4
Reviewed-on: http://gerrit.openafs.org/6104
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-21 20:35:52 -08:00
Marc Dionne
364fad6fa5 Linux: 3.1: adapt to fsync changes
The fsync file operation gets new arguments to specify a range.
Add a configure test to check for the API change.

The inode lock is also pushed down into the operation, so we need
to take it ourselves to keep the original behaviour.

Reviewed-on: http://gerrit.openafs.org/5332
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit cbaefa266d433af3b9a082a360e23a42f161d80f)

Change-Id: Idb6770204b014c62a8611548509240f8b5f950bc
Reviewed-on: http://gerrit.openafs.org/6098
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2011-11-21 06:07:49 -08:00
Anders Kaseorg
737a2802e9 Linux: 3.2: Use set_nlink to update i_nlink
As of v3.2-rc1~84^2~1, struct inode.i_nlink is now const to prevent
direct modification.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/6096
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit f1dd2d696fb9ab71b4192b156042e0c63019c58a)

Change-Id: I685aa6e8638e8fe864f1a6a7e428dfb6839ebcea
Reviewed-on: http://gerrit.openafs.org/6099
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-21 04:58:59 -08:00
Marc Dionne
7f55b45ed7 Linux: d_delete now takes a const argument
The d_delete dentry operation now takes a const argument.  Test for
this and define our function accordingly to avoid warnings.

Reviewed-on: http://gerrit.openafs.org/5335
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit def00ae8ba774f4d7290c29208484dda756dc0e0)

Change-Id: I128a721587f4963849652cb389472a550d81d267
Reviewed-on: http://gerrit.openafs.org/6097
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-21 04:58:40 -08:00
Derrick Brashear
ef492dc1e1 redhat: make rpms build on pre-f15 again
we don't have systemd everywhere. don't assume it

Reviewed-on: http://gerrit.openafs.org/5813
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 47b010d1e1d0e8bdbbcad73d5aedc19719d5d96a)

Change-Id: I200ca2306b0e6a22cdcb0515641977b2ea6d21a0
Reviewed-on: http://gerrit.openafs.org/6090
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-20 15:41:16 -08:00
Edward Z. Yang
76de794826 linux: Update Packaging to build OpenAFS services for Fedora's systemd
Fedora 15 now uses systemd (see http://fedoraproject.org/wiki/Systemd)
for the OS init system. While it currently has backwards
compatibility with older SysV-style init scripts, future versions of
Fedora may no longer support it, and OS startup tends to be faster
with the systemd service units. Also, systemd runs all the service's
processes within a linux kernel cgroup.
(see http://www.kernel.org/doc/Documentation/cgroups/cgroups.txt)

This change includes an openafs-client.service and
openafs-server.service unit files for the client and server packages
respectively.

Client
- Loading the openafs module was moved into
/etc/sysconfig/modules/openafs-client.modules. This causes the OS to
load the module on boot. This is the preferred way for modules to be
loaded with Fedora. (See
http://docs.fedoraproject.org/en-US/Fedora/15/html/Deployment_Guide/sec-Persistent_Module_Loading.html
for more details)
- The CellServDB file is generated with sed rather than cat.
This change was made because Systemd doesn't execute as a shell
script, but rather executes processes directly. Rather than invoking
a shell to concatenate the CellServDB.* files, they're written to the
CellServDB file using a sed oneliner.
- Do all of the proper kernel module loading and unloading.

Server
- Since systemd uses cgroups, when the service is shut down, all
processes in the openafs-server.service cgroup will be terminated.

The other changes are standard as per:
    http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd

Original version by Jonathan Billings <jsbillin@umich.edu>.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>

Reviewed-on: http://gerrit.openafs.org/5637
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Alex Chernyakhovsky <achernya@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 286ffa0d7c4d594ff107b70f9e930271c027a79e)

Change-Id: I653b211ef24fb9010f0a8ff0ad70c11703a64e82
Reviewed-on: http://gerrit.openafs.org/6089
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-20 15:39:12 -08:00
Marc Dionne
f129142dde Linux: 3.1: update RCU path walking detection in permission i_op
The permission() inode operation changed again with kernel 3.1,
back to the form it had before 2.6.38.  This compiles fine,
but is missing the new way of detecting when we get called in
RCU path walking mode, resulting in system hangs.

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

Change-Id: Ibd497309e6699fb585cf70e618373e800b73cbb8
Reviewed-on: http://gerrit.openafs.org/6088
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-20 15:38:36 -08:00
Jeffrey Altman
8150bbbf0d klog.krb5: enforce DES for rxkad
0. Always request a TGT regardless of the state of
   writeTicketFile.

1. request des-cbc-crc when requesting a ticket for an
   rxkad service principal

2. check the returned key length to ensure that it matches
   the permitted length of an rxkad key.  If not, generate
   an error instead of overwriting memory and continuing.

FIXES 130278

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

Change-Id: Ia162cb9fc1d67a38cde26e52b9077f5634a62c84
Reviewed-on: http://gerrit.openafs.org/6087
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-20 15:38:25 -08:00
Andrew Deason
1132b23e2f Solaris: Specify ARCHFLAGS in CFLAGS
Various autoconf tests which use the C compiler may yield different
results depending on whether or not we are compiling for x86 or amd64
on Solaris (different libraries are available, structures may be
different, et al). So, set CFLAGS depending on which arch we are
targeting, so the autoconf results are more consistent with the actual
compilation during the build.

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

Change-Id: Idd0f7d2220ae9762af60e96d087e7eb7ee8c0e63
Reviewed-on: http://gerrit.openafs.org/6086
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-20 15:38:11 -08:00
Andrew Deason
191bdc7258 DAFS: Deal with exclusive-state volume headers
GetVolumeHeader assumes that headers on the LRU are not associated
with a volume in an exclusive state. This is known to not be true for
some cases when salvage requests are received over FSSYNC, and may be
true in other scenarios. It's easy to just skip such headers, so skip
them.

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

Change-Id: I0eda511071114b01cd8984d30858b0aa9157727a
Reviewed-on: http://gerrit.openafs.org/6085
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-20 15:37:59 -08:00
Derrick Brashear
455e900d6c ukernel: handle pioctl errors properly in ktc
the straight return from call_syscall isn't what we want. munge so
e.g. EDOM handling for ktc_GetToken does the right thing.

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

Change-Id: I8929615940cb4f025bdd04139399f0ceb82955c9
Reviewed-on: http://gerrit.openafs.org/6084
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-20 15:37:48 -08:00
Andrew Deason
a81666efdb salvager: Implement AskDAFS via SYNC flags
Instead of probing the DAFS-ness of the fileserver by probing which
FSSYNC opcodes it supports, detect DAFS-ness by looking at the SYNC
response header flags, which explicitly state whether or not the
endpoint is DAFS. This avoids unnecessary "protocol mismatch" log
messages when the endpoint is not DAFS.

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

Change-Id: I0643b0e61795f39b63783c937e88c4a74c3c8312
Reviewed-on: http://gerrit.openafs.org/6083
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-20 15:37:35 -08:00
Andrew Deason
d173bead98 regen: Fail on failures
If something fails, don't ignore the error.

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

Change-Id: I5e5ac4d843b9dafce7b7f3acadfcdb0901aed214
Reviewed-on: http://gerrit.openafs.org/6082
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-20 15:37:23 -08:00
Derrick Brashear
f718feb826 viced: avoid bogus handle in rename
because fileptr's handle can be reset during CopyOnWrite
we need to SetDirHandle after that call

FIXES 130215

Reviewed-on: http://gerrit.openafs.org/5818
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit a1669f3e37299c11bf29a458212e03d1bdb22334)

Change-Id: I57e084102048916b04e45aa32792dc91193e43d8
Reviewed-on: http://gerrit.openafs.org/6081
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-20 15:37:08 -08:00
Andrew Deason
0d741616a8 volser: Preserve needsSalvaged during restore
Some of the routines during a volume restore may set needsSalvaged, if
an inconsistency is detected while writing the given volume data.
However, after the data is read, we set the volume header information
to what was found in the dump stream, ignoring any needsSalvaged that
may have been set.

To ensure that inconsistent volumes in this situation actually get
demand-salvaged (for DAFS) or offlined (non-DAFS), keep the value of
needsSalvaged in the header, if it was set.

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

Change-Id: Iece9f5b03f0454b7f833e4f3e86da4478b4441fe
Reviewed-on: http://gerrit.openafs.org/6080
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-20 15:36:56 -08:00
Andrew Deason
34637cbc70 namei: Remove extraneous rmdir
We just unlinked the file, so we know we won't be able to rmdir() the
same thing. Give a path one level higher to
namei_RemoveDataDirectories, so we start rmdir()ing at the parent dir.

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

Change-Id: Ibd14490e2d85bd78522472203ad57120237bff22
Reviewed-on: http://gerrit.openafs.org/6079
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-19 08:11:38 -08:00
Jeffrey Altman
0e753b2949 namei: tweak getlinkbyte error handling
in the event of a pread error, add the same error exit path
trigger that we have elsewhere

Reviewed-on: http://gerrit.openafs.org/5843
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 51f71e533b20cd875eec8adda71edea044a606da)

Change-Id: I05623d392e7e3446b7b41dcc1778c6aca986bca1
Reviewed-on: http://gerrit.openafs.org/6078
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-19 08:11:27 -08:00
Jeffrey Altman
c25f3fd56c Windows: Track active RPCs per scache_t
It has been noticed that multiple RPCs can be active on
a cm_scache_t object at the same time.  This is especially
true of directory objects with the redirector.  Track the
number of active RPCs and use that number in cm_MergeStatus
when deciding whether or not to discard the cached data for
the object.

Reviewed-on: http://gerrit.openafs.org/6001
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 090f6279c5496f648893606d298c698f376c7ae0)

Change-Id: Ic40b73ae44c47ad6077fcbbe41bf0d783ab776fc
Reviewed-on: http://gerrit.openafs.org/6045
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:53:17 -08:00
Jeffrey Altman
8844858564 Windows: Add Vista/Win7 Firewall Configuration
Make use of the INetFwPolicy2 COM interface to configure
the Vista/Win7 firewall for all network profile types.

Reviewed-on: http://gerrit.openafs.org/5812
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 b15b4b15822bee87720bb0d78c2ce54051180339)

Change-Id: I3022b2480c7c7273e819d0a10c092f22f4af3800
Reviewed-on: http://gerrit.openafs.org/6044
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:53:04 -08:00
Jeffrey Altman
10410504e7 Windows: cm_Rename break in 9cf7a628c2ff178b2fa236d2c0a41ca9be315036
9cf7a628c2ff178b2fa236d2c0a41ca9be315036 broke renaming of
a file to a name that does not exist.  Put back the code that
makes that possible with a comment.

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

Change-Id: Ia82ddc46b303cb80380c342d44db437c490b8508
Reviewed-on: http://gerrit.openafs.org/6043
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:52:43 -08:00
Jeffrey Altman
92f5218bce Windows: out of date version not in current chunk
In buf_GetNewLocked(), the comparision to decide whether a
cm_buf_t is a member of the current chunk must take the data
version into account.  If the data version is out of date, it
is not part of the current chunk and is an object that can be
safely recycled.

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

Change-Id: I626562d2189182b434f8da0f4f0a6213c5b695fe
Reviewed-on: http://gerrit.openafs.org/6042
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:52:21 -08:00
Jeffrey Altman
d27d549d02 Windows: only flush buffers on shutdown if running
If a service shutdown message is received prior to the
service entering the running state, do not attempt to
buf_CleanAndReset() because the required data structures
and locks are not initialized.

Reviewed-on: http://gerrit.openafs.org/5733
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 9743f5729d1a55513e861bb1334599a8e597de6b)

Change-Id: I2bda1c4a538c83595f2d60ad4661c7e6865c5fc3
Reviewed-on: http://gerrit.openafs.org/6041
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:52:00 -08:00
Jeffrey Altman
879d84fe79 Windows: Do not EEXIST exact match during rename
AFS Rename operations on the file server will delete a
target file if it exists.  Do not prevent renames because
an exact match of the target name exists in the target
directory.

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

Change-Id: I02c32fab18053e1a37811089812f402d351a6666
Reviewed-on: http://gerrit.openafs.org/6040
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:51:48 -08:00
Jeffrey Altman
8f532e8041 Windows: validate buffer hash tables in cm_MergeStatus
Reviewed-on: http://gerrit.openafs.org/5425
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit cf57eb294f28084cbb138b1a06bc813e14e6d0ec)

Change-Id: Ia685aebdc443113b4ddb968155f306cc53680af9
Reviewed-on: http://gerrit.openafs.org/6039
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:51:31 -08:00
Jeffrey Altman
1222d29ef7 Windows: record history of read lock threads
Maintance an array of up to 32 reader threads that have
acquired a rwlock.  Use it for debugging when things go bad.

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

Change-Id: Icab5ffc36e4c6245b7d0699596eca66a66bc9538
Reviewed-on: http://gerrit.openafs.org/6038
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:51:18 -08:00
Jeffrey Altman
0d698501d3 Windows: ignore SYNCHRONIZE privilege in cm_CheckNTOpen
SYNCHRONIZE has not meaning for AFS so just ignore it.  Do not
deny an open request because it is set.

Reviewed-on: http://gerrit.openafs.org/5410
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 793fdd3360982c48bf60eefbd9c56b4a3c1e09f0)

Change-Id: Ice8758dcbd0b355c9fdfb5af293b6d670ec8c1e4
Reviewed-on: http://gerrit.openafs.org/6037
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:51:05 -08:00
Jeffrey Altman
828fc8fff7 Windows: permit offline volume check to be disabled
Setting the registry value to 0 can now be used as a
method of disabling the offline volume check.

Reviewed-on: http://gerrit.openafs.org/5370
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 19a5b5e67c65f0a9109b0fb5410b5ba74ad85b41)

Change-Id: I50dfa3c5387ba8a1cbdd3ca80f9e8dc03e92c404
Reviewed-on: http://gerrit.openafs.org/6036
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:50:53 -08:00
Jeffrey Altman
060cc61ffb Windows: add clean rule to src/afs/NTMakefile
Reviewed-on: http://gerrit.openafs.org/5368
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 4ec6fd003084b02c299466bcaeac3850be10f79c)

Change-Id: I0cadd04598e78f9b8a5c0774e0636af153a5030c
Reviewed-on: http://gerrit.openafs.org/6035
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:50:37 -08:00
Jeffrey Altman
81d0b5ca5c Windows: correct comments in cm_BkgStore
Reviewed-on: http://gerrit.openafs.org/5369
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit b6e5493437b942d5550247761dac3311c6d73a86)

Change-Id: I73c2fcab9ccff73e4419d3edf3ffc7395230e6e5
Reviewed-on: http://gerrit.openafs.org/6034
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:50:11 -08:00
Jeffrey Altman
aab0703b29 Windows: remove CM_BUF_CMBKGFETCH flag
The processing of the CM_BUF_CMBKGFETCH flag adds more
overhead than it prevents.  Get rid of it.

LICENSE MIT

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

Change-Id: I423aa105bad99c70942d6b967a1dde70216fb096
Reviewed-on: http://gerrit.openafs.org/6033
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:49:59 -08:00
Jeffrey Altman
be4987fac0 Windows: use lock conversion in cm_EndDirOp
Instead of dropping the lock for read and reacquiring for write
use lock_ConvertRToW() which will make the change atomicly if
it is possible or place the thread into the wait list if not.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/5360
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 33af0f92e9b8a50c5a6dd17a9065c0ef58597c28)

Change-Id: Id92298fa848becb4131139579fd31b0c5f98a4ad
Reviewed-on: http://gerrit.openafs.org/6032
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:49:46 -08:00
Jeffrey Altman
395a06460f Windows: cm_SymLink export created cm_scache_t
Permit the caller to request the cm_scache_t that represents
the created symlink or mount point object.

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

Change-Id: I170059255e3bbc7e3ccbd59b66d7d8b11005a94f
Reviewed-on: http://gerrit.openafs.org/6031
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:49:33 -08:00
Jeffrey Altman
0d64f269c9 Windows: correct cm_buf use of Head/Tail queues
The buffer free list least recently used queue has both
head and tail points.  Use the proper versions of the queue
mgmt functions and do not handle edge cases as special cases.

Reviewed-on: http://gerrit.openafs.org/5354
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 537592f6bbda0c659c25ae7068f50504e2a5e116)

Change-Id: I0d5afaf59895f34ced739f4626a351fe41186008
Reviewed-on: http://gerrit.openafs.org/6030
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:49:20 -08:00
Jeffrey Altman
1ad9d96fe7 Windows: remove dead code from cm_scache.c
Reviewed-on: http://gerrit.openafs.org/5353
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 1e23761b7fadc260b32bebb0343a9b5b1de37cf4)

Change-Id: Ifd8cf9ec7b517da80b22853e0f90034586560e0d
Reviewed-on: http://gerrit.openafs.org/6029
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:49:07 -08:00
Jeffrey Altman
32539f5723 Windows: add logging to smb_IoctlRead
Reviewed-on: http://gerrit.openafs.org/5350
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 69463ac0cb367202485aac9977f8b4c47fb067f2)

Change-Id: I1f72db5148d2f596f4b0b58cb6788a244fd4fa44
Reviewed-on: http://gerrit.openafs.org/6028
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:48:56 -08:00
Jeffrey Altman
c6c113b1a1 Windows: remove potential data loss warning with cast
Reviewed-on: http://gerrit.openafs.org/5349
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 2588dd12478afb96a72f0cd788233ecf2145830f)

Change-Id: I02a87c4980c6ebe6ef671f90e2c6000ab2eeb60e
Reviewed-on: http://gerrit.openafs.org/6027
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:48:43 -08:00
Jeffrey Altman
1c8b16087e windows: pass cm_req_t through background ops
add cm_req_t object to background daemon operations in order to
permit request source to be propagated to the background daemon.

pass a cm_req_t into buf_SetDirty().

Reviewed-on: http://gerrit.openafs.org/5348
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 722843e2df533e8fcf245f2a3b10ef686992deb2)

Change-Id: I2fbc78cf765c534fc6fc673695634fcf946dca0b
Reviewed-on: http://gerrit.openafs.org/6026
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:48:27 -08:00
Jeffrey Altman
25f27ed384 Windows: correct log message in buf_Sync()
Reviewed-on: http://gerrit.openafs.org/5347
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 20772897654b58da6f7d4cd0bd2caf169abddd50)

Change-Id: I676a919701c4edfbc130a04c94f4092676a1d53c
Reviewed-on: http://gerrit.openafs.org/6025
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:48:06 -08:00
Jeffrey Altman
02d3c98d74 Windows: buf_SetDirty do nothing if length is zero
Reviewed-on: http://gerrit.openafs.org/5358
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 7dcc4766377b99c60db60328c21a3990db132268)

Change-Id: I30dc0f218df56e6e38fe6ce3736a5450b7036e51
Reviewed-on: http://gerrit.openafs.org/6024
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:47:52 -08:00
Jeffrey Altman
d979ea950c Windows: remove MULTIHOMED ifdef
All builds include the MULTIHOMED functionality.
Get rid of the #ifdef MULTIHOMED.

Reviewed-on: http://gerrit.openafs.org/5333
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 2271d481d33b2b2ad56dcd4fc9fbdd726fc1967b)

Change-Id: Ia11e4bfdc83737720e5274bad3d01232f0f2dbbe
Reviewed-on: http://gerrit.openafs.org/6023
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:47:37 -08:00
Jeffrey Altman
6d96df8d5f Windows: missing ! in update volume location
The check to see if the volume name is numeric or not was
missing a ! in order to perform the correct test.  Add it.

Reviewed-on: http://gerrit.openafs.org/5331
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 8127e9332be8cadda001f05c6036d4c87e04cb4a)

Change-Id: I9760845b597c1653a78ab3e496166e5df03b7575
Reviewed-on: http://gerrit.openafs.org/6022
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:47:23 -08:00
Jeffrey Altman
1649a820a0 Windows: improve handling of volume rename
The windows cache manager tracks volumes by volume group.
Up to this point all volume location updates have been performed
by the volume name.  What if the volume name was altered?  In this
case the volume location information for the in use volume ids will
fail until a mount point to the new name is queried.  Before
marking the volume group as non-existent attempt to perform a
lookup using either the volume id for the readwrite or readonly
volume.

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

Change-Id: I33771780a4ace4aa5b4613bef4590d5efaf15922
Reviewed-on: http://gerrit.openafs.org/6021
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-15 05:47:10 -08:00