Commit Graph

5253 Commits

Author SHA1 Message Date
Jeffrey Altman
8a34060989 KDFS-windows-optimizations-20090703
LICENSE MIT

when performing offline volume checks, do so in most recently used order

if the system is entering suspend state, short circuit the background
daemon operations to avoid extra work that is going to fail when the
network is shutdown behind the back of the service.


(cherry picked from commit 46287f6790)
2009-07-04 04:46:12 +00:00
Jeffrey Altman
725d6ad02a KDFS-windows-fs-chown-chgrp-20090701
LICENSE MIT

On Windows there is no chown or chgrp command that can be used to
change the owner or group of an object in AFS.   Therefore we
add them to the fs command.

Usage: fs chown -owner <user name or id> [-path <dir/file path>+] [-literal] [-help]
Where: -literal  literal evaluation of mountpoints and symlinks

Usage: fs chgrp -group <user/group name or id> [-path <dir/file path>+] [-literal] [-help]
Where: -literal  literal evaluation of mountpoints and symlinks


(cherry picked from commit ffd065a695)
2009-07-01 21:26:18 +00:00
Jeffrey Altman
50245c93b9 KDFS-windows-cellconfig-20090630
LICENSE MIT

nul terminate the correct variable


(cherry picked from commit ad6a8942db)
2009-07-01 02:45:19 +00:00
Jeffrey Altman
512e8b90ea KDFS-windows-dfs-file-set-warning-20090630
LICENSE MIT

Add a debug log warning if the target volume is a DFS File Set.
If so, the client will not properly protect against information
leakage or properly deal with directory name caching, symlinks,
and other behavioral differences between AFS and DFS.


(cherry picked from commit efdf78ae08)
2009-06-30 19:11:58 +00:00
Jeffrey Altman
e03752b3a7 KDFS-windows-smb-20090630
LICENSE MIT

Be sure to call smb_ReleaseVCNoLock before we drop the smb_rctLock.


(cherry picked from commit 49d6a0992c)
2009-06-30 19:04:00 +00:00
Jeffrey Altman
4f92ca0de8 KDFS-installers-20090629
LICENSE MIT

permit installers to build again.  this does not include all
of the changes for the new documentation.  that work was not
pulled to this branch.
2009-06-30 01:49:36 +00:00
Jeffrey Altman
a51500bfcb KDFS-cellconfig-20090629
LICENSE MIT

pullup from head
2009-06-30 01:48:19 +00:00
Jeffrey Altman
f679cb6de5 KDFS-windows-rough-sync-with-head-20090629
LICENSE MIT

pullup everything that matters to sync src/WINNT/afsd/ with
the cvs head.
2009-06-30 00:53:54 +00:00
Jeffrey Altman
7eee2a42ad KDFS-windows-libafsconf-20090525
LICENSE MIT

libafsconf.dll has been present since OpenAFS 1.0.  However,
for some unknown reason the components that it consists of
(cm_dns.obj, cm_config.obj, cm_nls.obj) have been staticly
linked into exes and dlls all over the code base.  This commit
removes all of the static references and replaces them with
libafsconf.lib.

libafsconf.dll is also moved from Client\Program to Common
because it is now linked to by server and utility components.


(cherry picked from commit c8ccb88788)
2009-06-29 21:01:07 +00:00
Jeffrey Altman
02a8c84c28 KDFS-windows-dcache-prefer-xdata-error-20090629
LICENSE MIT
FIXES 125018

Fix issue reported by Marc Dionne.  RXAFS_FetchData and RXAFS_StoreData
return access denied errors that are not reported by the subsequent
call to rx_EndCall which should be preferred.


(cherry picked from commit a50fa631ca)
2009-06-29 20:38:55 +00:00
Steven Jenkins
097de91afe KDFS-rename-residency-from-mrafs-to-osd-20090427
LICENSE IPL10
FIXES 124130

rename mrafs commands into their equivalent osd versions; structures etc are the
 same.


(cherry picked from commit 8655541d1e)
2009-06-29 20:00:50 +00:00
Jeffrey Altman
0b532ed930 KDFS-xdr-free-20090401
LICENSE MIT

add xdr_free() and export it from afsrpc.dll.  This permits applications
to free memory allocated within the xdr routines with the same run time
library memory management routines as was used to allocate it.

This is necessary on Windows to prevent memory corruption.

VL_GetAddrsU() is an example where a xdr array is allocated in the
library and must be freed by the application.


(cherry picked from commit d7749751df)
2009-06-29 19:59:51 +00:00
Jeffrey Altman
db2ac4d49a KDFS-windows-pioctl-subst-unc-20090407
LICENSE MIT

Add code to support determining if a drive substitution refers to
a UNC path.


(cherry picked from commit 9a0b3da255)
2009-06-29 19:58:25 +00:00
Jeffrey Altman
6072df4c33 KDFS-windows-hard-link-count-20090628
LICENSE MIT

cm_Link() is used to create hard links.  It did not apply the updated
link target status info to the target cm_scache_t object.  As a result
the linkCount would be incorrect.

cm_Unlink() did not take linkCount into account.  It did not reduce the
locally known linkCount, nor did it invalidate any currently known
callback.  As a result the linkCount would be incorrect.


(cherry picked from commit b8a1dba293)
2009-06-29 04:26:19 +00:00
Jeffrey Altman
a6cbfae1f5 KDFS-windows-fs-path-in-afs-20090507
LICENSE MIT

Switch the PathInAfs test to use VIOCGETFID instead of VIOC_GET_CELL_NAME
so that the literal option can be used.


(cherry picked from commit fd0f1f49f2)
2009-05-07 16:03:21 +00:00
Jeffrey Altman
27f99fc550 KDFS-windows-shellext-path-in-afs-20090507
LICENSE MIT
FIXES 124742

Change the PathInAfs test to use VIOCGETFID instead of VIOC_GET_CELL_NAME.
VIOCGETFID permits a literal test of the specified object.   This is needed
for testing the validity of a symlink to a msdfs: or non-existent path.
Otherwise, the AFS Shell Extension context menu will not be displayed.


(cherry picked from commit 6217199058)
2009-05-07 15:58:07 +00:00
Jeffrey Altman
78110d2fbf KDFS-windows-afsrdr-user-ioctl-20090322
LICENSE BSD

use parent fid instead of root fid as the starting point for
evaluating the remaining path.
2009-03-22 10:47:38 +00:00
Jeffrey Altman
cc5acbf85c KDFS-afsrdr-user-symlink-20090321
LICENSE BSD

Fix handling of absolute symlinks.
2009-03-21 21:27:12 +00:00
Jeffrey Altman
b4aed72d1f KDFS-windows-afsrdr-user-20090313
LICENSE BSD

Specify the AFS Fid of the global root.afs volume.

Do not return errors from PopulateCurrentEntry when evaluating targets.

symlink target processing is now performed within the file system
due to the ".." symlink issue.

Fix byte range lock deallocation.
2009-03-14 05:41:22 +00:00
Jeffrey Altman
04d4d6effa KDFS-windows-afsrdr-npdll-20090313
LICENSE BSD

update copyrights
2009-03-14 05:38:44 +00:00
Peter Scott
abfb23280b KDFS-windows-afsrdr-kernel-20090313
LICENSE BSD

with assistance from jaltman@secure-endpoints.com

Add GlobalFileId to the file system initialization arguments.  The file
system needs to be able to identify which volume is the global root
by fid in case the volume is mounted in multiple locations.

Reimplement all of the path parsing logic in order to be able to handle
symlinks that contain a ".." entry that crosses above a volume root.
The full starting path is now recorded in the Ccb as an array of component
names.  This is used as a stack pushing and popping components while
evaluating the contents of a symlink.

Permit directory enumeration to be performed asynchronously.

Correct spelling errors in comments.

Correct @sys processing.

When evaluating the target type for a symlink, do not evaluate the target
of the final component if that component is a mount point.

Initialize sysname resources.

Ensure that buffers are nul terminated before passing them to RtlRegQuery.

When processing the invalidation of a file deletion, delete the direntry
but not the fcb.  No longer assume that Fcb->DirEntry is always non-NULL
except during cleanup.
2009-03-14 05:37:32 +00:00
Jeffrey Altman
392188cf7b KDFS-windows-afsrdr-common-20090313
LICENSE BSD

add HOLD_FID / RELEASE_FID interfaces.  Used by the file system to obtain
a reference count on a cm_scache_t object to ensure that it is not recycled.

Add GlobalFileId to the file system initialization arguments.  The file
system needs to be able to identify which volume is the global root
by fid in case the volume is mounted in multiple locations.
2009-03-14 05:27:47 +00:00
Jeffrey Altman
409587ab60 KDFS-windows-afsd-buf-20090313
LICENSE MIT

Do not add a buffer to the free list if it is held by the file system.

Define buf_RDRBuffersExist()
2009-03-14 05:19:12 +00:00
Jeffrey Altman
55433b30b0 KDFS-windows-dnlc-20081015
LICENSE MIT
FIXES 116641

Do not use the DNLC if the name when converted from Unicode is NULL.


(cherry picked from commit e0298d5f09)
2009-03-14 05:16:28 +00:00
Jeffrey Altman
b8d94c6545 KDFS-windows-afsd-have-callback-20090313
LICENSE MIT

only call RDR_Invalidate if we have a valid callback
2009-03-14 05:15:13 +00:00
Jeffrey Altman
d001a9563f KDFS-windows-afsd-btree-20090313
LICENSE MIT

Change cm_BPlusDirEnumerate interface to include a 'FetchStatus'
parameter.  When set to 0, we do not fetch status for fids for
which we do not already have status info.  This avoids unnecessary
recycling of cm_scache_t objects.


(cherry picked from commit 15d4dd0f70)
2009-03-14 05:12:44 +00:00
Jeffrey Altman
0121257062 KDFS-windows-afsd-reset-acl-cache-20090312
LICENSE MIT

Modify the cm_ResetACLCache interface to accept an optional cm_cell_t *.
At the moment every time a token is set or cleared all of the acl info
for all cm_scache_t objects regardless of cell is reset.  This is both
a performance hit and unnecessary.  If we know the cell, only reset
the acl info for cm_scache_t objects in that cell.

If cell is not specified, reset for all cells.


(cherry picked from commit d0e4044cfe)
2009-03-14 05:11:22 +00:00
Jeffrey Altman
ea18a6fa87 KDFS-windows-afsd-unlock-20090312
LICENSE MIT

Modify the cm_Unlock() interface to support the ability to unlock all
locks within a range.  This is required for the redirector.


(cherry picked from commit 8e01e5a4db)
2009-03-14 04:55:23 +00:00
Jeffrey Altman
7e9b85950a KDFS-windows-freelance-20090312
LICENSE MIT

correct error in windows-freelance-20090223.  use cpath not filename
since that is why we allocated cpath in the first place.


(cherry picked from commit 7ca2785f53)
2009-03-14 04:51:30 +00:00
Jeffrey Altman
f89d95bb61 KDFS-windows-afsd-callback-20090312
LICENSE MIT

use cm_HaveCallback() to check for a call back instead of explicit
checks on cbExpires and cbServerp.  cm_HaveCallback takes into account
Freelance mode and offline status.


(cherry picked from commit ef81e9395c)
2009-03-14 04:49:28 +00:00
Jeffrey Altman
36163d8d01 KDFS-windows-afsd-btree-20090228
LICENSE MIT

Change how BPlusDir enumerations behave with regards to bulk stat
operations.  If the number of entries in the enumeration is larger
than the number of cm_scache objects, then using the previous model
of cm_BPlusDirEnumBulkStat being called for the entire enumeration
list results in the early objects being recycled and the status
info discarded before the caller of cm_BPlusDirNextEnumEntry()
receives the name.

The revised model triggers bulk stat operations from within
NextEnumEntry() as objects requiring status fetching are about
to be returned to the caller.  This reduces the thrashing of the
stat cache.

We should consider adding a flag field to cm_BPlusDirEnumerate()
or cm_BPlusDirNextEnumEntry() to permit enumeration without
status fetching.


(cherry picked from commit a329712516)
2009-03-14 04:46:17 +00:00
Jeffrey Altman
370effe702 KDFS-windows-afsd-server-uuid-20090301
LICENSE MIT

Unlike the unix cache manager, on Windows the server uuid was not
recorded as part of the cm_server object.  This commit adds the uuid
and a flag to indicate if it is set or not.

A check is made in cm_UpdateVolumeLocation it confirm that the uuid
known to the CM is the same as the one being reported by the vl server.
If they differ, this is logged but no action is taken.

The contents of the cm_allServers list is now dumped in response to
"fs memdump" or a crash.  This includes the uuid, addr, type, flags,
downtime, caps, etc.

The server uuid is not useful at the moment because there is nothing
that the CM can use it for.  However, it might be useful for debugging
and it will be needed for extended callback support.


(cherry picked from commit 19ffc146fa)
2009-03-02 04:45:49 +00:00
Jeffrey Altman
15a9b5f5e5 KDFS-window-afsd-bad-version-20090228
LICENSE MIT

create a new cpp symbol CM_SCACHE_VERSION_BAD to represent data version
values in cm_scache objects that are known to be invalid.

then consistently apply this value throughout the code.  Previously
some invalid values were set to 0 and others to -1 (0xFFFFFFFF:FFFFFFFF).

Also fix at least one location where CM_BUF_VERSION_BAD was not used.


(cherry picked from commit 5d14735126)
2009-02-28 16:19:55 +00:00
Jeffrey Altman
0833cb35de KDFS-windows-afsd-error-map-20090227
LICENSE MIT

do not permit VNOSERVICE or VOFFLINE or VSALVAGE to leak and
be returned as an error code.  The resulting NTSTATUS is not valid.


(cherry picked from commit fbfaaf2689)
2009-02-27 07:27:17 +00:00
Matt Benjamin
f22e259b13 KDFS-windows-afsd-findserverbyip-refcount-20081223
LICENSE BSD
FIXES 124054

reference count the server object returned by cm_FindServerByIP


(cherry picked from commit 411a63fb06)
2009-02-25 06:20:10 +00:00
Jeffrey Altman
4612eba9a9 KDFS-sync-rx-with-1_5-20090225
LICENSE IPL10

pullup all rx changes from 1_5 branch since the last sync.
2009-02-25 06:17:32 +00:00
Jeffrey Altman
cfa3cea985 KDFS-windows-freelance-20090223
LICENSE MIT

Fix another set of edge cases where adding a mountpoint or symlink
to the Freelance volume would result in the wrong fid being returned
to the request that made the addition.

When the Freelance directory is updated, invalidate the cm_scache_t object.
that is associated with it.

Actually use the data version when checking callback status.

The return value from Add Mount/Symlink is not negative on failure.
Its an actual error code.  Treat it that way.


(cherry picked from commit 3c1f858208)
2009-02-24 05:07:22 +00:00
Jeffrey Altman
6d9ffa6b78 KDFS-windows-vmoved-vnovol-failover-20090212
LICENSE MIT
FIXES 124276

A readonly volume with multiple instances was being marked alldown
when one of the instances resulted in VNOVOL because the vldb and
the indicated file server were out of sync. The cache manager would
then attempt to re-obtain the volume location info from the vldb
for the entire timeout period.

This patch:

adds trace logging to cm_Analyze indicating which server references
are being deleted and which remain in response to a VNOVOL/VMOVED error.

adds trace logging to cm_UpdateVolumeStatusInt showing how the
new volume status value is determined.

corrects cm_Analyze() so that it doesn't corrupt the server reference
list during cm_FreeServerList() calls; doesn't orphan the server reference
list by setting *serverpp to NULL; and only re-obtains the volume info
list once per request.


(cherry picked from commit 8bb35234aa)
2009-02-12 21:35:06 +00:00
Jeffrey Altman
0f4c404cbe KDFS-windows-freelance-20090204
LICENSE MIT

set the correct fid vnode/unique values when adding new symlnks and
mount points.


(cherry picked from commit ffdc7c7088)
2009-02-05 00:25:03 +00:00
Jeffrey Altman
76c5cecf4e KDFS-windows-btree-dir-enum-20090126
LICENSE MIT

Modify the cm_BPlusDirEnum interface:

* add the cm_scache_t * of the directory being enumerated to the
  cm_direnum_t object

* remove the cm_scache_t * from the cm_BPlusDirEnumBulkStat call
  now that it is part of the cm_direnum_t object

* maintain a reference to the cm_scache_t for the life of the
  cm_direnum_t object.  This ensures that the object cannot be
  recycled while the enumeration is in use.


(cherry picked from commit e42a066da1)
2009-01-26 15:51:22 +00:00
Jeffrey Altman
ce6d1c8dbb KDFS-windows-afsrdr-user-symlink-target-20090109
LICENSE MIT

When populating the symlink, copy the target name after evaluation
not before.
2009-01-09 22:17:51 +00:00
Jeffrey Altman
8654739103 KDFS-windows-afsrdr-kernel-server-name-20090109
LICENSE BSD

When validating that a path is ours to process, make sure
that we do not treat the AFSServerName as a prefix.
A full match is required.
2009-01-09 22:15:53 +00:00
Jeffrey Altman
8be8c18d01 KDFS-windows-afsrdr-kernel-build-symlink-target-20090109
LICENSE BSD

When the target of a symlink is a volume root, we must return
the control block of the volume root and not the current fcb
which is still referring to the last symlink in the chain.

Be sure to hold the TreeLock while we perform the is volume
test in order to prevent the volume control block from being
torn down.
2009-01-09 22:14:08 +00:00
Jeffrey Altman
957cfdf9b9 KDFS-windows-afsrdr-kernel-symlink-target-20090107
LICENSE BSD

When evaluating the file type of a symlink target, use the fast evaluation
which does not follow mount points.   We need to know that the target
is a mount point so that the reparse attribute can be set.
2009-01-08 07:18:57 +00:00
Jeffrey Altman
fbfc8ff8b5 KDFS-windows-afsrdr-kernel-generic-20090107
LICENSE BSD

Remember to increment the Fcb OpenReferenceCount.  Otherwise,
an assertion will be triggered at shutdown due to the undercount.
2009-01-08 07:16:26 +00:00
Jeffrey Altman
51ba1cee88 KDFS-windows-afsd-freelance-20090105
LICENSE MIT

Bring a bit more sanity to the Freelance code:

1. Add functions cm_FreelanceFetchMountPointString and
   cm_FreelanceFetchFileType to cm_freelance.c.  These functions
   permit the MountPointString and FileType to be obtained within
   cm_GetSCache without requiring knowledge of data structures
   that should be private to cm_freelance.c

2. Enforce the rule that odd vnode values are directory objects.
   The root directory is 1 and everything else must be a multiple
   of two.

3. Use the unique field as an index into the localMountPoints
   array.

4. Fix cm_GetCallback to process freelance data refreshes on
   all objects in the freelance volume not just the root directory.
   If this is not done, an access to \\afs\foo prior to \\afs\all
   being evaluated will cause an unnecessary attempt to send a
   fetch status request to a file server and produce an alldown
   error.

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
LICENSE MIT

remove unnecessary conditional


(cherry picked from commit 8c4b06a5b6)
2009-01-05 16:15:31 +00:00
Jeffrey Altman
4eae76dda3 KDFS-windows-afsd-virtual-cache-20090105
LICENSE MIT

If the NonPersistentCache option is activated there is no "AFSCache"
file to share with the file system.  Refuse to start the redirector
interface.
2009-01-05 16:00:02 +00:00
Jeffrey Altman
767f2dd758 KDFS-windows-afsrdr-user-virtual-cache-20090105
LICENSE MIT

If the NonPersistentCache option is activated there is no "AFSCache"
file to share with the file system.  Refuse to start the redirector
interface.

Instead of testing in RDRInit the service will not attempt to
initialize if the redirector cannot be used.
2009-01-05 15:53:30 +00:00
Jeffrey Altman
8b997cac41 KDFS-windows-afsrdr-kernel-20090104
LICENSE BSD

In order to evaluate the file attributes the fcb of the parent
is required.  For volume roots, the parent is the current fcb.
2009-01-05 05:24:44 +00:00
Jeffrey Altman
0e053ad11f KDFS-windows-afsrdr-user-virtual-cache-20090104
LICENSE MIT

If the NonPersistentCache option is activated there is no "AFSCache"
file to share with the file system.  Refuse to start the redirector
interface.
2009-01-04 16:57:24 +00:00