Commit graph

404 commits

Author SHA1 Message Date
Olga Kornievskaia
77237af0a6 fixing localdomain_name declaration in acl.c 2012-03-19 15:04:44 -04:00
Casey Bodley
d69aa27295 readdir: guarantee that entry_buf_len can fit one entry
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-03-19 15:04:43 -04:00
Olga Kornievskaia
2e1df56572 [readdir] using last_error to convey lack of space 2012-03-19 15:04:41 -04:00
Olga Kornievskaia
3d57b26922 [cosmetic] removed unused define 2012-03-19 15:04:39 -04:00
Olga Kornievskaia
50cdaf6d42 send bind_conn when sr_status_flag.PATH_DOWN is set 2012-03-19 15:04:38 -04:00
Olga Kornievskaia
e891fd141d in rpc_reconnect respect original needcb value 2012-03-19 15:04:36 -04:00
Casey Bodley
bbb1ed696c license changed to LGPL: added COPYING file, changed source file comments
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-03-19 12:24:43 -04:00
Olga Kornievskaia
d62d5dee59 command line options to override default uid/gid values
as of now, not allowing anonymous uid to be 0.

no restrictions on a default gid value.
2012-03-07 11:58:59 -05:00
Olga Kornievskaia
54e17624ab reverting commit 7485d53f64
in comparing server identities, in previous commit we removed
comparison of the returned clientids.

however, running against the emc server, we ran into issues of data
servers retuning the same server major, minor, and scope identities
but different clientids. we then decided that it's the same data
server.
2012-03-06 13:36:42 -05:00
Olga Kornievskaia
4af8bbf362 [pnfs] allow callbacks to data servers 2012-03-05 18:52:06 -05:00
Olga Kornievskaia
f71623bc02 adding a lease-based timeout to upcalls
adding -o timeout=value (in sec) mount option to override a default
timeout value for the upcalls for non-io upcalls. Default timeout is
at least the lease_time seconds of an established mount or 20secs.

read/write upcall also take into account number of bytes for the request
and 100MB/s network speed and 100MB/s disk speed
2012-03-05 17:49:52 -05:00
Olga Kornievskaia
44df987734 updating attrs in nonpnfs file_sync4 writes
when we are doing non-pnfs and writing to a netapp filer, even though we
write UNSTABLE it returns us FILE_SYNC4. since we were doing unstable
writes we were not sending getattrs, and since the data servers we returning
stable commits we didn't send commit. in doing so, we never update our
attribute cache and had a wrong file size.
2012-02-28 14:18:51 -05:00
Olga Kornievskaia
47ff10aa57 [acl] return a write delegation on setacl
we were only returning a read delegation, when we try to do a setacl.

at cthon2012, we were getting cb_recalls when we had a write delegation.
2012-02-28 14:14:26 -05:00
Casey Bodley
ef3a700d5b recovery: always send RECLAIM_COMPLETE on client recovery
client was previously only sending RECLAIM_COMPLETE during grace period.  the spec mandates that RECLAIM_COMPLETE be sent before any non-reclaim locking operations, regardless of grace period.  when recovery code detects a NFS4ERR_NO_GRACE error, send RECLAIM_COMPLETE immediately before attempting any out-of-grace recovery

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-02-28 12:14:03 -05:00
Casey Bodley
a085a8979b deleg: fix for attributes in CB_GETATTR
CB_GETATTR specifies the delegation by filehandle, but deleg_fh_cmp() was comparing superblock and fileid.  renamed deleg_fh_cmp() to deleg_file_cmp(), and created new deleg_fh_cmp() to compare actual filehandles

call to nfs41_attr_cache_lookup() was not setting flags in info.attrmask, so the change and size attributes were not being encoded in the CB_GETATTR response

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-02-28 12:13:56 -05:00
Casey Bodley
103124377a cosmetic: less spam from CB_RECALL
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-02-28 12:13:47 -05:00
Casey Bodley
afd1a3c0db readdir: removed unused readdir_upcall_args.buf
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-02-28 12:13:27 -05:00
Olga Kornievskaia
0322f53cce make io offset unsigned 2012-02-28 12:11:01 -05:00
Casey Bodley
294f30baec deleg: release reference in nfs41_delegation_getattr()
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-02-16 12:09:17 -05:00
Olga Kornievskaia
60b73b282d lowering default debug level to 1 2012-02-16 11:07:37 -05:00
Casey Bodley
fb7c379f06 pnfs: fix for write length returned
fixes an issue introduced by commit 1f7e560a9a, "pnfs: fix for short write on ds error"

when a write is satisfied completely by pnfs, the upcall was returning out_len=0.  the only time i noticed this was against python server, where cp in cygwin would succeed but print 'No space left on device'

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-02-14 13:27:51 -05:00
Olga Kornievskaia
d42f769bff changing many printouts 2012-02-13 16:08:21 -05:00
Olga Kornievskaia
5b91c662c9 removing unused arg from nfs41_link 2012-02-08 18:33:37 -05:00
Olga Kornievskaia
13c3723191 propagating file change attr for setacl 2012-02-08 16:32:04 -05:00
Olga Kornievskaia
cdf31d3ee0 propagating file change attr on setattr 2012-02-08 16:31:17 -05:00
Olga Kornievskaia
aa7a680a40 propagating file change attr on writes 2012-02-08 16:29:25 -05:00
Olga Kornievskaia
ec034e7fd9 propagating file change attr on open 2012-02-08 11:11:09 -05:00
Olga Kornievskaia
3def6f5e24 propagating file change attr on getattr 2012-02-08 11:02:29 -05:00
Casey Bodley
63f499c4b7 cache: check for expiry on nfs41_attr_cache_lookup()
added expiration field to struct attr_cache_entry.  expiration timer is reset whenever attr_cache_update() is called with a 'change' attribute

new function attr_cache_entry_expired() is used by nfs41_attr_cache_lookup() and name_cache_lookup()/entry_invis() to prevent the use of expired attributes

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-02-03 18:26:34 -05:00
Olga Kornievskaia
b779ab07fc add a timestamp printout to upcall 2012-02-03 18:26:18 -05:00
Casey Bodley
e553ede209 deleg: release reference in remove_srvopen()
nfs41_delegation_remove_srvopen() gets a reference to a delegation via delegation_find().  this reference wasn't being released

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-01-31 15:46:22 -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
8e0e2d2718 remove erronous permanent disable of ldap lookups 2012-01-19 15:25:37 -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
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
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
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