driver: fix for is_root_directory()
is_root_directory() was failing to take mount paths into account, causing it to ignore the cached volume attributes and make unnecessary upcalls when a mount path was specified because the mount path is only available during nfs41_CreateVNetRoot(), its length is now saved in the new field NFS41_V_NET_ROOT_EXTENSION.MountPathLen for use in is_root_directory() Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
parent
7a6379b198
commit
2e10b99489
1 changed files with 11 additions and 4 deletions
|
|
@ -387,6 +387,7 @@ typedef struct _NFS41_V_NET_ROOT_EXTENSION {
|
||||||
FILE_FS_ATTRIBUTE_INFORMATION FsAttrs;
|
FILE_FS_ATTRIBUTE_INFORMATION FsAttrs;
|
||||||
DWORD sec_flavor;
|
DWORD sec_flavor;
|
||||||
DWORD timeout;
|
DWORD timeout;
|
||||||
|
USHORT MountPathLen;
|
||||||
BOOLEAN read_only;
|
BOOLEAN read_only;
|
||||||
BOOLEAN write_thru;
|
BOOLEAN write_thru;
|
||||||
BOOLEAN nocache;
|
BOOLEAN nocache;
|
||||||
|
|
@ -2977,6 +2978,7 @@ NTSTATUS nfs41_CreateVNetRoot(
|
||||||
Config->SrvName.MaximumLength =
|
Config->SrvName.MaximumLength =
|
||||||
pSrvCall->pSrvCallName->MaximumLength - sizeof(WCHAR);
|
pSrvCall->pSrvCallName->MaximumLength - sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
|
pVNetRootContext->MountPathLen = Config->MntPt.Length;
|
||||||
pVNetRootContext->timeout = Config->timeout;
|
pVNetRootContext->timeout = Config->timeout;
|
||||||
|
|
||||||
status = map_sec_flavor(&Config->SecFlavor, &pVNetRootContext->sec_flavor);
|
status = map_sec_flavor(&Config->SecFlavor, &pVNetRootContext->sec_flavor);
|
||||||
|
|
@ -4284,10 +4286,15 @@ static BOOLEAN is_root_directory(
|
||||||
{
|
{
|
||||||
__notnull PV_NET_ROOT VNetRoot = (PV_NET_ROOT)
|
__notnull PV_NET_ROOT VNetRoot = (PV_NET_ROOT)
|
||||||
RxContext->pRelevantSrvOpen->pVNetRoot;
|
RxContext->pRelevantSrvOpen->pVNetRoot;
|
||||||
/* compare the FileObject name with the VNetRoot prefix to determine
|
__notnull PNFS41_V_NET_ROOT_EXTENSION pVNetRootContext =
|
||||||
* whether it's the root directory (allowing for added \) */
|
NFS41GetVNetRootExtension(RxContext->pRelevantSrvOpen->pVNetRoot);
|
||||||
return RxContext->CurrentIrpSp->FileObject->FileName.Length <=
|
|
||||||
VNetRoot->PrefixEntry.Prefix.Length + sizeof(WCHAR);
|
/* calculate the root directory's length, including vnetroot prefix,
|
||||||
|
* mount path, and a trailing \ */
|
||||||
|
const USHORT RootPathLen = VNetRoot->PrefixEntry.Prefix.Length +
|
||||||
|
pVNetRootContext->MountPathLen + sizeof(WCHAR);
|
||||||
|
|
||||||
|
return RxContext->CurrentIrpSp->FileObject->FileName.Length <= RootPathLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS nfs41_QueryVolumeInformation(
|
NTSTATUS nfs41_QueryVolumeInformation(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue