Commit graph

599 commits

Author SHA1 Message Date
Casey Bodley
1b7a5f6c6c adding etc_netconfig to root directory
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-01-20 15:24:59 -05:00
Olga Kornievskaia
fb87e417fc enforcing data consistency
given a delegation type received on open, set buffering flags accordingly.

however, provide -o nocoherence mount options that will enable read/write
buffering regardless
2012-01-20 15:01:11 -05:00
Olga Kornievskaia
c22c2b6080 data cache invalidation on delegation recalls
when we receive a delegation recall, we need to make a downcall
to the kernel and change a buffering/caching policy on this file.

on each open and close we pass an srv_open pointer to the nfsd to
keep in case it receives a cb_recall. we store srv_open in the
delegation state if we got a delegation.
2012-01-19 19:46:03 -05:00
Casey Bodley
909947f07a name cache: bug fix for delegations
when open_update_cache() calls open_delegation_return() to return its delegation, it doesn't update its local variable 'delegation_type' to reflect the new delegation->type.  this causes the next call to nfs41_name_cache_insert() to continue failing

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-01-19 15:25:50 -05:00
Olga Kornievskaia
39e90a7299 bug fix in nfs41_FinalizeVNetRoot
when we didn't create a mount, we don't have a security context to
destroy. in vnetroot creation, initialize session to invalid_handle.
if we fail to mount, then before deleting security context in
nfs41_FinalizeVNetRoot check that session is not invalid_handle.
2012-01-19 15:25:43 -05:00
Olga Kornievskaia
8e0e2d2718 remove erronous permanent disable of ldap lookups 2012-01-19 15:25:37 -05:00
Olga Kornievskaia
03bc4d4c2e adding back unimplemented functions
just in case some of them are required and will cause a kernel crash
if function pointer is dereferenced.
2012-01-18 18:21:28 -05:00
Casey Bodley
50a19f7762 readme: note about nfsd_debug.exe in binary distribution
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-12-23 11:42:27 -05:00
Olga Kornievskaia
df523a364e [mount] expose writethru and nocache options 2011-12-22 15:00:47 -05:00
Olga Kornievskaia
a132b8b79c [driver] storing volinfo in devext
instaed of assembling FILE_FS_VOLUME_INFORMATION on every volume
query, story it in device extensions and just copy bytes.
2011-12-22 14:50:53 -05:00
Casey Bodley
ab8a958e35 pnfs: remove code for unused PNFS_THREAD_BY_SERVER
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-12-22 12:36:04 -05:00
Olga Kornievskaia
c61849fd14 [driver] fail if fail to impersonate client in nfsd thread 2011-12-22 12:06:44 -05:00
Olga Kornievskaia
790e6239d4 [driver] creating individual unmarshal functions 2011-12-22 11:59:45 -05:00
Olga Kornievskaia
62dfd87bda [driver] using InterlockedIncrement for open_owner_id 2011-12-21 17:42:04 -05:00
Olga Kornievskaia
9efa410e5a [driver] using InterlockedIncrement64 for xid 2011-12-21 17:19:38 -05:00
Olga Kornievskaia
4511dec4b7 [driver] properly release upcall entry lock in downcall
if we fail to allocate memory while processing acl downcall, dont
forget to release the lock on the entry before leaving the function.
2011-12-21 16:50:54 -05:00
Olga Kornievskaia
517db12d34 [driver] properly unlock mdls
when nobody is waiting for the upcall. if it was read/write upcall
unlock readwrite mdl. if it was a readdir upcall, unlock readdir
mdl and also free it.
2011-12-21 16:43:55 -05:00
Olga Kornievskaia
8d52181a3e [driver] delete sec context even if upcall fails 2011-12-21 16:36:39 -05:00
Olga Kornievskaia
fd21e7fbfd [driver] stop impersonating client even if it's a lost upcall 2011-12-21 16:15:26 -05:00
Olga Kornievskaia
0e272630a3 [driver] cosmetic changes
none (or all) functions should be static. making all function non-static.

consistent format of function args (ie each argument on its own line).

adding __notnull for our fcb, fobx, vnetroot, netroot context pointers.

removed some non-implemented function from our redirector functions table.
left some no-op functions that are just required: flush, isvaliddir,
deallocatefcb. not sure about completebufferingstate function.

80char lines corrections
2011-12-21 15:53:17 -05:00
Olga Kornievskaia
24ca1023bf [driver] bugfix: only free context for valid vnetroot 2011-12-20 15:19:01 -05:00
Casey Bodley
f14231fd3b recovery: only reclaim delegations on RECALLABLE_STATE_REVOKED
when only the SEQ4_STATUS_RECALLABLE_STATE_REVOKED flag is set, we only have to test/free delegation stateids.  nfs41_client_state_revoked() handles this by calling stateid_array() with an empty list of opens

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-12-19 19:50:57 -05:00
Casey Bodley
6c1c300a3b recovery: trigger recovery on RESTART_RECLAIM_NEEDED
adds a check for sequence flag SEQ4_STATUS_RESTART_RECLAIM_NEEDED in nfs41_recover_sequence_flags().  if other _STATE_REVOKED flags are set, call nfs41_client_state_revoked() as normal but follow it up with a RECLAIM_COMPLETE.  otherwise, reclaim all locks with nfs41_recover_client_state().  like other callers of nfs41_recover_client_state(), we need to handle BADSESSION errors because the recovery operations are sent with try_recovery=FALSE.  because this logic is similar to our default NFS4ERR_BADSESSION handling, i moved the common code into a new nfs41_recover_session() function in recovery.c

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-12-19 19:50:50 -05:00
Casey Bodley
ab51beeb98 cosmetic: move sequence status recovery to separate function
new function nfs41_recover_sequence_flags() in recovery.c takes care of checking status flags, entering recovery mode, and reclaiming state

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-12-19 19:50:42 -05:00
Casey Bodley
aacff9d721 pnfs: thread-by-stripe instead of by-server
the thread-by-server model breaks down when using dense layouts, because multiple stripes could be mapped to a single data server, and the per-data-server thread would have to send a COMMIT for each stripe

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-12-19 19:50:36 -05:00
Olga Kornievskaia
4be25baaee moved getdomainname into start of nfsd
acquire machine's domain name at the start of nfsd and store
in global memory, make is accessible for acl operations.
2011-12-19 19:37:35 -05:00
Olga Kornievskaia
8e64984183 close file before remove in case of silly rename
windows server does not allow for removing of opened file and instead
errors with nfs41err_file_open. we were failing the remove the silly
renamed file.
2011-12-14 13:11:06 -05:00
Olga Kornievskaia
6292181f8d adding nocache mount options 2011-12-08 17:47:34 -05:00
Olga Kornievskaia
aed1493e90 adding writethru mount option
for large writes it is beneficial to turnoff write buffering and allow
large write buffer sizes than 1M (for win 7).
2011-12-08 17:07:12 -05:00
Olga Kornievskaia
37f3fa0862 saving security context in vnetroot
windows calls into our driver from processes that have restricted access.

save security context during mount and use that for all other irps.
2011-12-08 17:07:05 -05:00
Olga Kornievskaia
33a5f24f1f [cosmetic] print processid instead of pointer to peprocess 2011-12-05 13:27:53 -05:00
Olga Kornievskaia
e63cce53aa [libtirpc] don't drop socket lock in krb5p
in 2 other places, we shouldn't have been dropping a socket
lock while processing a reply from the server. it lead to race.
2011-11-10 13:16:39 -05:00
Casey Bodley
f8daa3704a readme: moved signing instructions to Building from Source
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-11-09 12:11:31 -05:00
unknown
7acf94dd1b [libtirpc] fixing memory leak on gss context initiation failure 2011-11-08 15:35:20 -05:00
Olga Kornievskaia
6b05d84e93 [driver] dont set NetRootStatus on failure
Setting it was cause exiting mounts to go away.
2011-11-08 14:35:17 -05:00
Olga Kornievskaia
9af1b590ff [cosmetic] dprintf changes in acl, getattr, name_cache, namespace 2011-11-07 10:50:00 -05:00
Casey Bodley
7f82baf13f namecache: fix for negative entries on rename
this addresses two error cases:

1) when the src entry is negative or does not exist: the dst entry could be negative or point to something else, so it needs to be removed
2) when the dst_parent entry is negative or does not exist: src needs to be made a negative entry

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-11-04 17:01:46 -04:00
Casey Bodley
68252b6522 recovery: avoid delegation_return_lru() on delegation recovery
the namecache/delegation feedback code in nfs41_ops.c:open_update_cache() is interfering with delegation recovery.  if its call to nfs41_name_cache_insert() fails with ERROR_TOO_MANY_OPEN_FILES, the delegation is returned instead of being recovered.  this shouldn't happen during recovery, because we're replacing a delegation rather than adding a new one

nfs41_open() now remembers whether we already had a delegation.  if we did, open_update_cache() will pass OPEN_DELEGATE_NONE to nfs41_name_cache_insert() to prevent it from returning ERROR_TOO_MANY_OPEN_FILES.  if we didn't already have a delegation, the nfs41_delegreturn() needs to be called with the same try_recovery flag from nfs41_open()

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-11-04 17:01:34 -04:00
Casey Bodley
f988c89bf4 namecache: fix for numlinks on remove
nfs41_name_cache_remove() needs to update the 'numlinks' attribute for other links, even if the file being removed is not found in the cache.  to search for its attr cache entry, nfs41_name_cache_remove() now requires a fileid argument.  nfs41_remove() only gets a pointer to the parent's filehandle, so it also needs the target fileid argument

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-11-04 13:14:40 -04:00
Casey Bodley
06b025a89c build: pacified compiler warnings in x86/x64
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-11-02 12:08:48 -04:00
Olga Kornievskaia
0694415a95 free critical sections with DeleteCriticalSection 2011-11-02 12:05:33 -04:00
Olga Kornievskaia
572c69e3d0 need to close vnetroot handle in create_connection 2011-11-02 12:00:21 -04:00
Olga Kornievskaia
2642d0c459 check that netconfig is present and readable 2011-11-02 11:59:52 -04:00
Olga Kornievskaia
5032d46633 return success if received empty acl 2011-11-02 11:58:54 -04:00
Casey Bodley
78a0bb0ac5 recovery: handle state revocation flags in SEQUENCE response
if any of (SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED | SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED | SEQ4_STATUS_ADMIN_STATE_REVOKED) are set in the session flags returned by SEQUENCE:
* enter client recovery mode
* determine which state was lost with TEST_STATEID (consider all delegations, opens, locks, and layouts)
* send FREE_STATEID for each stateid revoked
* recall all layouts and forget devices (required by 12.7.2: Dealing with Lease Expiration on the Client)
* call recover_delegation(), recover_open() or recover_locks() to reclaim each lock

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-11-02 11:58:45 -04:00
Olga Kornievskaia
ed2ec18d2d recovery xdr for free_stateid and test_stateid 2011-11-02 11:58:19 -04:00
Casey Bodley
7efeb31a16 pnfs: send GETATTR after FILE_SYNC ds writes
in the case of ds writes returning FILE_SYNC, we don't need to send a COMMIT or LAYOUTCOMMIT to the mds.  COMMIT and LAYOUTCOMMIT, however, are the places where we do GETATTR(size) to update the attribute cache.  so we must add a separate call to GETATTR to accomplish this after ds writes return FILE_SYNC

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-10-25 11:45:03 -04:00
Casey Bodley
1f7e560a9a pnfs: fix for short write on ds error
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-10-25 11:44:53 -04:00
Casey Bodley
03e810ce83 write: use FILE_SYNC for small writes
small mds writes were using DATA_SYNC4 and were not followed by COMMITs, so there was no guarantee of an updated file size before returning success

use FILE_SYNC4 for these small writes, and send COMMITs for both UNSTABLE4 and DATA_SYNC4

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-10-25 11:44:46 -04:00
Casey Bodley
3d053740c3 mount: propagate errors back to nfs_mount
nfs41_np.c:
NPAddConnection3() was overwriting status=WN_BAD_NETNAME on any errors from DeviceIoControl()

nfs41_driver.c:
GetConnectionHandle() was only returning the handle, and throwing away the return value from ZwCreateFile()
map_mount_errors() was missing a mapping from ERROR_BAD_NET_NAME to STATUS_BAD_NETWORK_NAME

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-10-25 11:44:37 -04:00