adding version to the upcall
to determine that the daemon has restarted -- rather that daemon is receiving upcalls from the kernel that were processed by the old instance of the daemon -- add a version to the upcall mechanism. when daemon starts up it generates a version number (just a timestamp). it passes this value to the driver on start up via "start_ioctl" downcall. the driver saves that value in its device extensions. it uses that value in the mount and shtudown upcalls. when daemon replies to the mount command it again sends its version as a part of the reply. this reply is stored in driver;s netroot extensions. the driver uses netroot's value in each upcall to the daemon. if the daemon receives an upcall for an operation where the included version does not equal to the its current version, it fails the upcall (error_code=116). a restart of the daemon would change driver's device extension value which the driver will then use in the new mount upcalls that would establish new sessions. then the correct daemon version would be returned as a part of the mount downcalled and saved in the netroot.
This commit is contained in:
parent
765fb43156
commit
a25a5221d9
7 changed files with 101 additions and 35 deletions
|
|
@ -106,9 +106,15 @@ out_err:
|
|||
|
||||
static int marshall_mount(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
|
||||
{
|
||||
int status;
|
||||
mount_upcall_args *args = &upcall->args.mount;
|
||||
dprintf(2, "NFS41_MOUNT: writing pointer to nfs41_root %p\n", args->root);
|
||||
return safe_write(&buffer, length, &args->root, sizeof(args->root));
|
||||
dprintf(2, "NFS41_MOUNT: writing pointer to nfs41_root %p and version %d\n",
|
||||
args->root, NFS41D_VERSION);
|
||||
status = safe_write(&buffer, length, &args->root, sizeof(args->root));
|
||||
if (status) goto out;
|
||||
status = safe_write(&buffer, length, &NFS41D_VERSION, sizeof(DWORD));
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
|
||||
const nfs41_upcall_op nfs41_op_mount = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue