tracking open state in setattr for reboot recovery
This commit is contained in:
parent
a645f7030c
commit
2ae743efe7
3 changed files with 14 additions and 4 deletions
|
|
@ -414,6 +414,11 @@ void nfs41_open_stateid_arg(
|
|||
IN nfs41_open_state *state,
|
||||
OUT struct __stateid_arg *arg);
|
||||
|
||||
void client_state_add(
|
||||
IN nfs41_open_state *state);
|
||||
void client_state_remove(
|
||||
IN nfs41_open_state *state);
|
||||
|
||||
/* lock.c */
|
||||
void nfs41_lock_stateid_arg(
|
||||
IN nfs41_open_state *state,
|
||||
|
|
|
|||
|
|
@ -118,9 +118,8 @@ void nfs41_open_stateid_arg(
|
|||
arg->open = state;
|
||||
}
|
||||
|
||||
|
||||
/* client list of associated open state */
|
||||
static void client_state_add(
|
||||
void client_state_add(
|
||||
IN nfs41_open_state *state)
|
||||
{
|
||||
nfs41_client *client = state->session->client;
|
||||
|
|
@ -130,7 +129,7 @@ static void client_state_add(
|
|||
LeaveCriticalSection(&client->state.lock);
|
||||
}
|
||||
|
||||
static void client_state_remove(
|
||||
void client_state_remove(
|
||||
IN nfs41_open_state *state)
|
||||
{
|
||||
nfs41_client *client = state->session->client;
|
||||
|
|
|
|||
|
|
@ -452,7 +452,8 @@ static int handle_setattr(nfs41_upcall *upcall)
|
|||
dprintf(1, "nfs41_open() failed with %s\n", nfs_error_string(status));
|
||||
status = nfs_to_windows_error(status, ERROR_FILE_NOT_FOUND);
|
||||
goto out;
|
||||
}
|
||||
} else
|
||||
client_state_add(state);
|
||||
state->do_close = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -481,6 +482,11 @@ static int handle_setattr(nfs41_upcall *upcall)
|
|||
break;
|
||||
}
|
||||
|
||||
switch (args->set_class) {
|
||||
case FileAllocationInformation:
|
||||
case FileEndOfFileInformation:
|
||||
client_state_remove(state);
|
||||
}
|
||||
out:
|
||||
free(args->buf);
|
||||
return status;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue