rename: skip upcall when same filename matches destination

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2012-04-26 13:14:05 -04:00 committed by unknown
parent 787202cb9d
commit a0d2e12806

View file

@ -5348,6 +5348,19 @@ NTSTATUS nfs41_SetFileInformation(
nfs41_fcb->StandardInfo.EndOfFile = info->EndOfFile;
break;
}
case FileRenameInformation:
{
/* noop if filename and destination are the same */
PFILE_RENAME_INFORMATION rinfo =
(PFILE_RENAME_INFORMATION)RxContext->Info.Buffer;
const UNICODE_STRING dst = { (USHORT)rinfo->FileNameLength,
(USHORT)rinfo->FileNameLength, rinfo->FileName };
if (RtlCompareUnicodeString(&dst,
SrvOpen->pAlreadyPrefixedName, FALSE) == 0) {
status = STATUS_SUCCESS;
goto out;
}
}
}
status = nfs41_UpcallCreate(NFS41_FILE_SET, &nfs41_fobx->sec_ctx,