adds a critical section to nfs41_open_state. this lock is taken before generating the stateid/seqid, and released after updated stateid is saved to nfs41_open_state
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
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>
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>
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>
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>
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>
on SetEaInfo for NfsV3Attributes, wait to set nfs41_fcb.mode until the upcall returns successfully
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
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.
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>
was incorrectly using file_attributes instead of create attributes to check
if we are creating a file or a directory. it lead to creating directories
with archive set.
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>
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>
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
http://msdn.microsoft.com/en-us/library/cc232085%28v=prot.10%29.aspx : "STATUS_INVALID_PARAMETER: An invalid parameter was passed for FileName or FileNameLength, or the target file was open, or the RootDirectory field value was nonzero for a network operation."
as network filesystems are not expected to support this, return STATUS_INVALID_PARAMETER instead of STATUS_NOT_SUPPORTED
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
fail attempts to set/get reparse points when the filename is no longer than the vnetroot name (plus a \) to prevent these operations on a volume. also adds checks for non-null buffers to pass Set/GetPointInvalidParamTest
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
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.
use RtlUnicodeToUTF8N() instead of RtlUnicodeStringToAnsiString() to preserve unicode filenames; passes fileio test UnicodeOnDiskTest
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
file can be opened with a delete_on_close flag set. this file can be
opened again as long as opens specify "file_share_delete" access.
after receiving the cleanup irp, the handle enters "delete-pending"
state. opens in this state must fail with status_delete_pending.
file query for standard_info.delete_pending now should return true.
calling setattr with disposition=1 puts the file in "delete-pending"
state.
calling setattr with dispositon=0 will clear delete_on_close only
if file is in "delete-pending" state. otherwise, setattr is ignored.