Commit graph

387 commits

Author SHA1 Message Date
Olga Kornievskaia
9dd4708aed leaving one max_component len constant
both NFS41_MAX_COMPONENT_SIZE and NFS41_MAX_COMPONENT_LEN
represented the same value.
2012-04-30 11:57:34 -04:00
Casey Bodley
787202cb9d name cache: skip rename with same src and target
fileio tests 214,215 does lots of renames with the same source and target filename.  nfs41_name_cache_rename() would operate on the same pointer for both src and existing, and accidentally turn both into a negative entry

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-04-26 16:13:54 -04:00
Olga Kornievskaia
beb33855e0 check pathlen on referrals 2012-04-26 16:13:45 -04:00
Olga Kornievskaia
495760d69a [readdir] make sure buffer produces nul-terminated str 2012-04-26 11:07:27 -04:00
Olga Kornievskaia
57baa75f04 changing error code when path is too long 2012-04-26 11:06:31 -04:00
Olga Kornievskaia
c4c76c97d2 [volume] fixing FsAttributes volume query
not setting the length of the reply produced a zero valued query.
2012-04-25 11:37:24 -04:00
Olga Kornievskaia
b3a86d0256 simply logic for unsetting readonly attribute 2012-04-24 11:41:40 -04:00
Casey Bodley
2baeeb855b volume: cache volume attributes on mount
struct NFS41_V_NET_ROOT_EXTENSION now stores only the FILE_FS_ATTRIBUTE_INFORMATION (without the extra buffer space for a name).  on QueryVolumeInfo() for FileFsAttributeInformation on the root directory, the FILE_FS_ATTRIBUTE_INFORMATION is copied into the output buffer, and the name is added there.  QueryVolumeInfo() only makes upcalls when FileFsAttributeInformation queries are not for the root directory

new function is_root_directory() uses the logic from Set/GetReparsePoint() to determine whether it's operating on the root directory

moved logic from volume.c:handle_volume_attributes() to superblock.c:nfs41_superblock_fs_attributes().  the mount downcall copies the FILE_FS_ATTRIBUTE_INFORMATION buffer down to the driver.  the driver reads this buffer directly into VNetRootContext->FsAttrs

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-04-20 15:03:14 -04:00
Olga Kornievskaia
4c8c263b49 implement getattr for FileNetworkOpenInformation 2012-04-20 12:42:36 -04:00
Casey Bodley
c837631750 ea: fail non-cygwin EAs without named attr support
if non-cygwin EAs are given to Create, SetEaInfo, or QueryEaInfo and the server does not support named attributes, fail with STATUS_EAS_NOT_SUPPORTED.  also adds access checks for FILE_READ_EA and FILE_WRITE_EA

Create will accept all 3 cygwin EAs: NfsV3Attributes, NfsActOnLink, and NfsSymlinkTargetName.  it now handles NfsActOnLink by adding FILE_OPEN_REPARSE_POINT to the create options

SetEaInfo will only accept NfsV3Attributes for setting the file mode. the other two will fail with STATUS_INVALID_PARAMETER.  removed handling of NfsActOnLink in setattr.c

QueryEaInfo will accept all 3 cygwin EAs

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-04-09 15:01:15 -04:00
Casey Bodley
b3229d20f6 ea: query each superblock for named attr support
adds a new function nfs41_superblock_getattr(), which adds an OPENATTR call with createdir=0 after the GETATTR to check for named attribute support.  OPENATTR will either return ERR_NOTSUPP if not supported, or OK/ERR_NOENT depending on whether named attributes are present on the given file.  we can't query for the 'named_attr' attribute, because it only tells us whether the given file contains named attributes

if named attributes are supported on a superblock, it will return FILE_SUPPORTS_EXTENDED_ATTRIBUTES for associated volume queries

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-04-09 15:01:12 -04:00
Casey Bodley
fd591f92d7 ea: initialize named attr paths
zero-initialize the paths for named attrs, and initialize the file.name instead of using a temporary dst_name

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-04-09 15:01:03 -04:00
Olga Kornievskaia
92d3500bd2 changing silly rename scheme take 2
reverting patch 4d18cf9ce7.

it was wrong to append the timestamp to create a silly renamed name
because it was not a reproducable name.

instead, take an fh and md5(fh) then append as before.
2012-04-06 17:01:50 -04:00
Casey Bodley
4e1449a2f8 ea: fixes for named attributes
assign a superblock to named attribute files on nfs41_open(), to prevent crashing in nfs41_write()
also avoid updating the attribute cache with named attribute files on close and write

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-04-03 13:43:35 -04:00
Olga Kornievskaia
9135e07221 only send setattr if attr changed
for hidden, system, and archive, first check with our cached attributes
and if the values are the same, ignore this setattr
2012-04-02 18:41:37 -04:00
Casey Bodley
c59124dd20 superblock: mask getattr requests with supported_attrs
on creation of a new superblock, construct a bitmap for the default attribute mask to be used for GETATTR and READDIR requests on that filesystem.  mask out any unsupported attributes, and store the bitmap in the field nfs41_superblock.default_getattr

replaced function init_getattr_request() with nfs41_superblock_getattr_mask(), which returns a copy of superblock->default_getattr

removed the locking in nfs41_superblock_supported_attrs() and nfs41_superblock_supported_attrs_exclcreat(), as the supported_attrs and suppattr_exclcreat fields are read-only after the superblock is first initialized.  also factored out their common code into a bitmap_intersect() function in util.h

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-04-02 16:34:02 -04:00
Casey Bodley
b955b6d3fe ea: assign superblock to named attribute directory
the upcall to set an EA was crashing in nfs41_open() on a null superblock, because nfs41_rpc_openattr() was returning a filehandle without a superblock.  copy the parent file's superblock to the returned filehandle

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-04-02 16:33:49 -04:00
Olga Kornievskaia
6ce297022c use provided, not saved mode for superseded opens 2012-04-02 14:42:35 -04:00
Olga Kornievskaia
6f55d3e346 mask attrs only when present
during delegation recovery we don't pass in create attributes.
2012-04-02 13:30:04 -04:00
Olga Kornievskaia
49580a8cfe handling hidden system archive file attributes
todo: still need to mask supported attributes while doing getattrs
2012-04-02 12:49:44 -04:00
Casey Bodley
68d97f5400 open: use suppattr_exclcreat to mask exclusive create attributes
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-03-29 16:17:48 -04:00
Olga Kornievskaia
6bb641e547 open and create accept pointer to attributes
allow callers of nfs41_open() and nfs41_create() to pass arbitrary attributes fo
r use with open_args.openhow.how.createattrs and create_args.createattrs
2012-03-29 16:16:55 -04:00
Casey Bodley
e83d36544f symlink: handle errors from REMOVE
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-03-29 15:46:44 -04:00
Olga Kornievskaia
4d18cf9ce7 changing silly rename scheme
instead of appending a fh value when creating a silly rename name,
we'll append a timestamp. using fh value was problematic because
it was creating a filename longer than 64char long which is
currently out max_filename_size.
2012-03-29 11:23:55 -04:00
Olga Kornievskaia
83cab313f0 propagate attrs on dir creation 2012-03-29 11:23:18 -04:00
Olga Kornievskaia
dd611ff0cd treat OVERWRITE as open4_create unchecked4 2012-03-29 11:23:01 -04:00
Olga Kornievskaia
735784e85b notepad specific fixes
removing notepad opens file as a directory ifdef

for volume query notepad supplies insufficient buffer space but
doesn't like buffer_too_small error code. it seems to be fine
with partial buffer filled and buffer_overflow error.
2012-03-19 16:52:20 -04:00
Olga Kornievskaia
4418ba8b69 fixing open for FILE_SUPERSEDE
http://www.osronline.com/showThread.cfm?link=27213
clarifies that unless open for overwrite_if the old file should be
deleted and then created again.
2012-03-19 15:05:01 -04:00
Olga Kornievskaia
863db2735b [open] fix open_if for dir when dir exists 2012-03-19 15:04:57 -04:00
Olga Kornievskaia
d1a05c810e fixing open a file as a directory
we should map this failure to STATUS_NOT_A_DIRECTORY

notepad.exe had been known to do this
2012-03-19 15:04:54 -04:00
Olga Kornievskaia
1a00a0bdce fixing opening dir as a file
open a of a directory with a NON_DIRECTORY_FILE specified should return
FILE_IS_A_DIRECTORY
2012-03-19 15:04:52 -04:00
Olga Kornievskaia
4017b235db handling creating new file for no access
windows can send a create irp with dispostion representing creation
of the file and specify DesiredAccess of 0.

we were treating no data access as lookup but in this case, we still
need to create a file. so send an open with a read access and
request no delegation to be returned.
2012-03-19 15:04:51 -04:00
Olga Kornievskaia
b4a1af0df6 fixing access_mask to nfs allow in open flags 2012-03-19 15:04:46 -04:00
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