ea: refactor SetEaInfo for use on open
when open is given an ea buffer, pass it to new function nfs41_ea_set() after successful file creation. matches NTFS behavior on all dispositions: sets EAs on FILE_CREATE, FILE_OVERWRITE, FILE_OVERWRITE_IF, FILE_SUPERSEDE. does not set EAs on FILE_OPEN. only sets EAs on FILE_OPEN_IF if file did not previously exist. see new function create_with_ea() nfs41_ea_set() returns nfs error codes. uses NFS4ERR_FBIG when the EaValueLength exceeds NFS4_EASIZE (256). this gets mapped to windows error ERROR_FILE_TOO_LARGE, which the driver now converts to STATUS_EA_TOO_LARGE Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
parent
5a4439a894
commit
b2e6a60710
5 changed files with 151 additions and 83 deletions
|
|
@ -442,6 +442,16 @@ static int check_execute_access(nfs41_open_state *state)
|
|||
return status;
|
||||
}
|
||||
|
||||
static int create_with_ea(
|
||||
IN uint32_t disposition,
|
||||
IN uint32_t lookup_status)
|
||||
{
|
||||
/* only set EAs on file creation */
|
||||
return disposition == FILE_SUPERSEDE || disposition == FILE_CREATE
|
||||
|| disposition == FILE_OVERWRITE || disposition == FILE_OVERWRITE_IF
|
||||
|| (disposition == FILE_OPEN_IF && lookup_status == NFS4ERR_NOENT);
|
||||
}
|
||||
|
||||
static int handle_open(nfs41_upcall *upcall)
|
||||
{
|
||||
int status = 0;
|
||||
|
|
@ -665,7 +675,14 @@ supersede_retry:
|
|||
args->mode = info.mode;
|
||||
args->changeattr = info.change;
|
||||
}
|
||||
|
||||
/* set extended attributes on file creation */
|
||||
if (args->ea && create_with_ea(args->disposition, lookup_status)) {
|
||||
status = nfs41_ea_set(state, args->ea);
|
||||
status = nfs_to_windows_error(status, ERROR_FILE_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
upcall->state_ref = state;
|
||||
nfs41_open_state_ref(upcall->state_ref);
|
||||
out:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue