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
This commit is contained in:
Olga Kornievskaia 2012-01-20 15:01:11 -05:00
parent c22c2b6080
commit fb87e417fc
3 changed files with 58 additions and 39 deletions

View file

@ -602,6 +602,8 @@ static int handle_open(nfs41_upcall *upcall)
nfs_to_basic_info(&info, &args->basic_info);
nfs_to_standard_info(&info, &args->std_info);
args->mode = info.mode;
if (state->delegation.state)
args->deleg_type = state->delegation.state->state.type;
}
}
if (status) {
@ -636,6 +638,8 @@ static int marshall_open(unsigned char *buffer, uint32_t *length, nfs41_upcall *
if (status) goto out;
status = safe_write(&buffer, length, &args->changeattr, sizeof(args->changeattr));
if (status) goto out;
status = safe_write(&buffer, length, &args->deleg_type, sizeof(args->deleg_type));
if (status) goto out;
if (upcall->last_error == ERROR_REPARSE) {
unsigned short len = (args->symlink.len + 1) * sizeof(WCHAR);
status = safe_write(&buffer, length, &args->symlink_embedded, sizeof(BOOLEAN));

View file

@ -55,6 +55,7 @@ typedef struct __open_upcall_args {
DWORD mode;
LONGLONG changeattr;
HANDLE srv_open;
DWORD deleg_type;
BOOLEAN created;
BOOLEAN symlink_embedded;
} open_upcall_args;