From a0d2e128068b3afabcd722f3d4770cd19d82faa8 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 26 Apr 2012 13:14:05 -0400 Subject: [PATCH] rename: skip upcall when same filename matches destination Signed-off-by: Casey Bodley --- sys/nfs41_driver.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c index ac998dc..340c003 100644 --- a/sys/nfs41_driver.c +++ b/sys/nfs41_driver.c @@ -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,