From: Alex Riesen <raa.lkml@gmail.com>
To: Paul Umbers <paul.umbers@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <junkio@cox.net>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: Git Cygwin - unable to create any repository - help!
Date: Thu, 17 Jan 2008 00:45:27 +0100 [thread overview]
Message-ID: <20080116234527.GA3499@steel.home> (raw)
In-Reply-To: <a5eb9c330801161344i1da447c7sb447bf6274d408e8@mail.gmail.com>
Paul Umbers, Wed, Jan 16, 2008 22:44:10 +0100:
> Here's the log from the latest strace.
Something is fishy here (aside from the horrible selection of
information in the trace output):
56 1151793 [main] git 3244 symlink_info::check: 0 = symlink.check (c:\workspace\git\git-1.5.3\.git\objects\2e, 0x22BBE0) (0x2A)
58 1151851 [main] git 3244 path_conv::check: this->path(c:\workspace\git\git-1.5.3\.git\objects\2e\d63d326ffdb2fd4b703780f4d61f1893cac63b), has_acls(1)
65 1151916 [main] git 3244 fhandler_base::open: (c:\workspace\git\git-1.5.3\.git\objects\tmp_obj_rOxD3L, 0x110000)
206 1152122 [main] git 3244 fhandler_base::set_flags: flags 0x110000, supplied_bin 0x10000
76 1152198 [main] git 3244 fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
308 1152506 [main] git 3244 fhandler_base::set_flags: filemode set to binary
146 1152652 [main] git 3244 fhandler_base::open: 0 = NtCreateFile (0x6D0, 20100, c:\workspace\git\git-1.5.3\.git\objects\tmp_obj_rOxD3L, io, NULL, 0, 7, 1, 4400, NULL, 0)
74 1152726 [main] git 3244 fhandler_base::open: 1 = fhandler_base::open (c:\workspace\git\git-1.5.3\.git\objects\tmp_obj_rOxD3L, 0x110000)
105 1152831 [main] git 3244 fhandler_base::open_fs: 1 = fhandler_disk_file::open (c:\workspace\git\git-1.5.3\.git\objects\tmp_obj_rOxD3L, 0x10000)
5915 1158746 [main] git 3244 fhandler_disk_file::link: CreateHardLinkA failed
94 1158840 [main] git 3244 seterrno_from_win_error: /ext/build/netrel/src/cygwin-1.5.25-7/winsup/cygwin/fhandler_disk_file.cc:893 windows error 183
72 1158912 [main] git 3244 geterrno_from_win_error: windows error 183 == errno 17
64 1158976 [main] git 3244 __set_errno: void seterrno_from_win_error(const char*, int, DWORD):310 val 17
65 1159041 [main] git 3244 fhandler_base::close: closing '/cygdrive/c/workspace/git/git-1.5.3/.git/objects/tmp_obj_rOxD3L' handle 0x6D0
124 1159165 [main] git 3244 link: -1 = link (/cygdrive/c/workspace/git/git-1.5.3/.git/objects/tmp_obj_rOxD3L, /cygdrive/c/workspace/git/git-1.5.3/.git/objects/2e/d63d326ffdb2fd4b703780f4d61f1893cac63b)
87 1159252 [main] git 3244 normalize_posix_path: src /cygdrive/c/workspace/git/git-1.5.3/.git/objects/tmp_obj_rOxD3L
94 1159346 [main] git 3244 normalize_posix_path: /cygdrive/c/workspace/git/git-1.5.3/.git/objects/tmp_obj_rOxD3L = normalize_posix_path (/cygdrive/c/workspace/git/git-1.5.3/.git/objects/tmp_obj_rOxD3L)
65 1159411 [main] git 3244 mount_info::conv_to_win32_path: conv_to_win32_path (/cygdrive/c/workspace/git/git-1.5.3/.git/objects/tmp_obj_rOxD3L)
104 1159515 [main] git 3244 mount_info::cygdrive_win32_path: src '/cygdrive/c/workspace/git/git-1.5.3/.git/objects/tmp_obj_rOxD3L', dst 'c:\workspace\git\git-1.5.3\.git\objects\tmp_obj_rOxD3L'
73 1159588 [main] git 3244 set_flags: flags: binary (0x2)
62 1159650 [main] git 3244 mount_info::conv_to_win32_path: src_path /cygdrive/c/workspace/git/git-1.5.3/.git/objects/tmp_obj_rOxD3L, dst c:\workspace\git\git-1.5.3\.git\objects\tmp_obj_rOxD3L, flags 0x2A, rc 0
130 1159780 [main] git 3244 symlink_info::check: not a symlink
66 1159846 [main] git 3244 symlink_info::check: 0 = symlink.check (c:\workspace\git\git-1.5.3\.git\objects\tmp_obj_rOxD3L, 0x22C110) (0x2A)
67 1159913 [main] git 3244 path_conv::check: this->path(c:\workspace\git\git-1.5.3\.git\objects\tmp_obj_rOxD3L), has_acls(1)
64 1159977 [main] git 3244 unlink: _unlink (c:\workspace\git\git-1.5.3\.git\objects\tmp_obj_rOxD3L)
763 1160740 [main] git 3244 unlink: 1 = CloseHandle (0x6D0)
144 1160884 [main] git 3244 unlink: CreateFile (FILE_FLAG_DELETE_ON_CLOSE) succeeded
66 1160950 [main] git 3244 unlink: 0 = unlink (/cygdrive/c/workspace/git/git-1.5.3/.git/objects/tmp_obj_rOxD3L)
Could you locate move_temp_to_file and make it unconditionally rename
the tempfile into target sha1 file? It should become something like that:
int move_temp_to_file(const char *tmpfile, const char *filename)
{
int ret = link_temp_to_file(tmpfile, filename);
/*
* Coda hack - coda doesn't like cross-directory links,
* so we fall back to a rename, which will mean that it
* won't be able to check collisions, but that's not a
* big deal.
*
* The same holds for FAT formatted media.
*
* When this succeeds, we just return 0. We have nothing
* left to unlink.
*/
if (!rename(tmpfile, filename))
return 0;
ret = errno;
unlink(tmpfile);
if (ret) {
if (ret != EEXIST) {
return error("unable to write sha1 filename %s: %s\n", filename, strerror(ret));
}
/* FIXME!!! Collision check here ? */
return error("failed to write sha1 filename %s: %s\n", filename, strerror(ret));
}
return 0;
}
Does someone know, why this function seem to return 0 (success) on
something which looks like an SHA1 collision? And destroy the
tempfile, even though it is not moved anywhere.
next prev parent reply other threads:[~2008-01-16 23:46 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-14 17:21 Git Cygwin - unable to create any repository - help! Paul Umbers
2008-01-14 20:29 ` Alex Riesen
2008-01-14 22:21 ` Paul Umbers
2008-01-15 5:48 ` Alex Riesen
2008-01-15 15:21 ` Paul Umbers
2008-01-15 20:04 ` Alex Riesen
2008-01-15 20:12 ` Paul Umbers
2008-01-15 21:20 ` Alex Riesen
2008-01-15 21:57 ` Paul Umbers
2008-01-15 22:51 ` Alex Riesen
2008-01-15 21:59 ` Paul Umbers
2008-01-15 22:55 ` Alex Riesen
2008-01-15 23:02 ` Robin Rosenberg
2008-01-16 7:18 ` Alex Riesen
2008-01-16 15:42 ` Paul Umbers
2008-01-16 17:55 ` Junio C Hamano
2008-01-16 18:10 ` Paul Umbers
2008-01-16 18:38 ` Alex Riesen
2008-01-16 18:57 ` Paul Umbers
2008-01-16 18:31 ` Alex Riesen
2008-01-16 18:48 ` Paul Umbers
2008-01-16 19:12 ` Alex Riesen
2008-01-16 19:17 ` Alex Riesen
2008-01-16 21:44 ` Paul Umbers
2008-01-16 23:45 ` Alex Riesen [this message]
2008-01-17 18:37 ` Paul Umbers
2008-01-17 18:51 ` Linus Torvalds
2008-01-17 19:17 ` Johannes Schindelin
2008-01-17 20:13 ` Paul Umbers
2008-01-17 20:24 ` Linus Torvalds
2008-01-17 20:38 ` Pascal Obry
2008-01-17 20:50 ` Johannes Schindelin
2008-01-17 20:53 ` Pascal Obry
2008-01-17 22:32 ` Paul Umbers
2008-01-17 20:18 ` Alex Riesen
2008-01-17 18:53 ` Nicholas Wourms
2008-01-17 20:30 ` Alex Riesen
2008-01-16 18:50 ` Paul Umbers
2008-01-15 17:08 ` Pascal Obry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080116234527.GA3499@steel.home \
--to=raa.lkml@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=paul.umbers@gmail.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).