You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following command-chain works with 2.4.4 but not with 2.4.5. It works with a local drive like C:\ alright.
Steps to reproduce
cd /usr/src/git && git pull && git checkout -t origin/rebase-to-2.4.5
make clean && make -j8
# Map a network share to X:
rm -f X:/test
./git config -f X:\test svn-remote.svn.branches-maxRev 1
# -> succeeds
./git config -f X:\test svn-remote.svn.branches-maxRev 1
# -> fails with Rename from 'X:/test.lock' to 'X:/test' failed. Should I try again? (y/n)
git checkout v2.4.4.windows.2
make clean && make -j8
rm -f X:/test
./git config -f X:\test svn-remote.svn.branches-maxRev 1
# -> succeeds
./git config -f X:\test svn-remote.svn.branches-maxRev 1
# -> succeeds
Analysis
The error messages comes from mingw_rename function in compat/mingw.c. But git diff v2.4.4.windows.2..rebase-to-2.4.5 compat/mingw.c is empty. Maybe git diff v2.4.4.windows.2..rebase-to-2.4.5 config.c is the cause then.
So far I found out that somehow the close for the test file is delayed or not even executed at all. See the procmon analysis below. The MoveFileExW function returns SHARING_VIOLATION, as seen in the trace below. What i did track down is that the close call that is being executed before lockfile.c even tries to rename the file is this one. @kblees since you refactored the renaming in mingw.c - maybe you have any ideas?
"Time of Day","Process Name","PID","Operation","Path","Result","Detail"
"11:18:35,5242466","git.exe","8108","CreateFile","\\remote.host\test\test.lock","SUCCESS","Desired Access: Read Attributes, Delete, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open For Backup, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"11:18:35,5252744","git.exe","8108","QueryAttributeTagFile","\\remote.host\test\test.lock","SUCCESS","Attributes: A, ReparseTag: 0x0"
"11:18:35,5253114","git.exe","8108","QueryBasicInformationFile","\\remote.host\test\test.lock","SUCCESS","CreationTime: 30.06.2015 11:10:18, LastAccessTime: 30.06.2015 11:16:16, LastWriteTime: 30.06.2015 11:16:16, ChangeTime: 30.06.2015 11:16:16, FileAttributes: A"
"11:18:35,5302017","git.exe","8108","CreateFile","\\remote.host\test","SUCCESS","Desired Access: Write Data/Add File, Synchronize, Disposition: Open, Options: Open For Backup, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Superseded"
"11:18:35,5357504","git.exe","8108","SetRenameInformationFile","\\remote.host\test\test.lock","SHARING VIOLATION","ReplaceIfExists: True, FileName: \\remote.host\test\test"
"11:18:35,5358329","git.exe","8108","CloseFile","\\remote.host\test\test.lock","SUCCESS",""
"11:18:35,5435852","git.exe","8108","CreateFile","\\remote.host\test\test","SUCCESS","Desired Access: Write Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open For Backup, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"11:18:35,5443905","git.exe","8108","SetBasicInformationFile","\\remote.host\test\test","SUCCESS","CreationTime: 01.01.1601 02:00:00, LastAccessTime: 01.01.1601 02:00:00, LastWriteTime: 01.01.1601 02:00:00, ChangeTime: 01.01.1601 02:00:00, FileAttributes: AN"
"11:18:35,5455575","git.exe","8108","CloseFile","\\remote.host\test\test","SUCCESS",""
"11:18:35,5603613","git.exe","8108","CreateFile","\\remote.host\test\test","SUCCESS","Desired Access: Read Attributes, Disposition: Open, Options: Open For Backup, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"11:18:35,5610020","git.exe","8108","QueryBasicInformationFile","\\remote.host\test\test","SUCCESS","CreationTime: 29.06.2015 12:26:05, LastAccessTime: 29.06.2015 12:26:05, LastWriteTime: 29.06.2015 12:26:05, ChangeTime: 30.06.2015 11:18:35, FileAttributes: A"
"11:18:35,5610244","git.exe","8108","CloseFile","\\remote.host\test\test","SUCCESS",""
"11:20:31,8243699","git.exe","8108","CreateFile","\\remote.host\test\test.lock","SUCCESS","Desired Access: Read Attributes, Disposition: Open, Options: Open For Backup, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"11:20:31,8252595","git.exe","8108","QueryBasicInformationFile","\\remote.host\test\test.lock","SUCCESS","CreationTime: 30.06.2015 11:10:18, LastAccessTime: 30.06.2015 11:16:16, LastWriteTime: 30.06.2015 11:16:16, ChangeTime: 30.06.2015 11:16:16, FileAttributes: A"
"11:20:31,8252778","git.exe","8108","CloseFile","\\remote.host\test\test.lock","SUCCESS",""
"11:20:31,8318213","git.exe","8108","CreateFile","\\remote.host\test\test.lock","SUCCESS","Desired Access: Write Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open For Backup, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"11:20:31,8328637","git.exe","8108","SetBasicInformationFile","\\remote.host\test\test.lock","SUCCESS","CreationTime: 01.01.1601 02:00:00, LastAccessTime: 01.01.1601 02:00:00, LastWriteTime: 01.01.1601 02:00:00, ChangeTime: 01.01.1601 02:00:00, FileAttributes: AN"
"11:20:31,8338574","git.exe","8108","CloseFile","\\remote.host\test\test.lock","SUCCESS",""
"11:20:31,8410566","git.exe","8108","CreateFile","\\remote.host\test\test.lock","SUCCESS","Desired Access: Read Attributes, Delete, Disposition: Open, Options: Non-Directory File, Open For Backup, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"11:20:31,8422082","git.exe","8108","QueryAttributeTagFile","\\remote.host\test\test.lock","SUCCESS","Attributes: A, ReparseTag: 0x0"
"11:20:31,8422277","git.exe","8108","SetDispositionInformationFile","\\remote.host\test\test.lock","SUCCESS","Delete: True"
"11:20:31,8427819","git.exe","8108","CloseFile","\\remote.host\test\test.lock","SUCCESS",""
Nailed it!
The issue is with commit 3a1b312. The problem is that munmap(contents, contents_sz); moved past the commit_lock_file(lock) call. That seems to be a problem for files that are on windows shares. git.exe still holds a handle to device\mup\file_in_question
Activity
nalla commentedon Jun 30, 2015
So far I found out that somehow the
closefor thetestfile is delayed or not even executed at all. See theprocmonanalysis below. TheMoveFileExWfunction returnsSHARING_VIOLATION, as seen in the trace below. What i did track down is that theclosecall that is being executed beforelockfile.ceven tries to rename the file is this one. @kblees since you refactored the renaming inmingw.c- maybe you have any ideas?nalla commentedon Jun 30, 2015
Nailed it!
The issue is with commit 3a1b312. The problem is that
munmap(contents, contents_sz);moved past thecommit_lock_file(lock)call. That seems to be a problem for files that are on windows shares.git.exestill holds a handle todevice\mup\file_in_questionkblees commentedon Jun 30, 2015
Dito 😄
See #229
nalla commentedon Jun 30, 2015
Yes! just saw that reference showing up right before clicking on comment ;)
dscho commentedon Jun 30, 2015
Thanks, both!
config.c: fix writing config files on Windows network shares