Re: git bugs

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ben Lynn
Subject: Re: git bugs
Date: Tuesday, June 10, 2008 - 4:09 pm

>> Nice! I believe I can prove there are no races now.

I agree completely. My proof only holds in an abstract setting. It
assumes things such as a strictly nondecreasing system clock is and
that ctime and mtime work in an ideal sense.


Good point. I confess I've only learned about mmap very recently, from
browsing the git code. All this time, I've been using streams, file
descriptors, etc. mmap is so much better!

What's Linux do in this case? For indexing purposes, so long as the
mtime is updated after the last write before git gets to it, things
should be fine.


Definitely. e.g. rig the mtime by 2^32 seconds, or add 2^32 bytes to a
file within a second.


I had thought about this. I hacked some code up where the index looks
at the current system time when updating a cache entry to determine if
the hash is racy. Is doing one time(NULL) call per file reasonable?
I'm guessing it must be cheaper that a stat call.


Agreed. Another assumption of my proof is that the index is
trustworthy. If you tamper with it, all bets are off. You can't stop
determined users from hurting themselves.


Interesting. I had hacked a version of the index that did this (before
changing it to use a different solution).

In general, is the format of the index file set in stone? Is that why
it's better to use the size zero trick for the race condition rather
than introduce a new flag for example? Or are these wrinkles too small
to justify a potentially painful upgrade?

-Ben
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
git bugs, Ben Lynn, (Tue Jun 10, 1:41 am)
Re: git bugs, Daniel Barkalow, (Tue Jun 10, 9:58 am)
Re: git bugs, Linus Torvalds, (Tue Jun 10, 10:44 am)
Re: git bugs, Ben Lynn, (Tue Jun 10, 11:45 am)
Re: git bugs, Linus Torvalds, (Tue Jun 10, 1:06 pm)
Re: git bugs, Ben Lynn, (Tue Jun 10, 4:09 pm)
Re: git bugs, Junio C Hamano, (Tue Jun 10, 4:38 pm)
Re: git bugs, Ben Lynn, (Tue Jun 10, 5:02 pm)
Re: git bugs, Junio C Hamano, (Tue Jun 10, 5:20 pm)
Re: git bugs, Ben Lynn, (Tue Jun 10, 5:24 pm)
Re: git bugs, Ben Lynn, (Tue Jun 10, 5:53 pm)
Re: git bugs, Linus Torvalds, (Tue Jun 10, 6:36 pm)
Re: git bugs, Ben Lynn, (Tue Jun 10, 7:04 pm)
Re: git bugs, Linus Torvalds, (Tue Jun 10, 7:12 pm)
Re: git bugs, Ben Lynn, (Tue Jun 10, 7:31 pm)
Re: git bugs, Linus Torvalds, (Tue Jun 10, 7:39 pm)
Re: git bugs, Ben Lynn, (Tue Jun 10, 10:58 pm)
Re: git bugs, Ben Lynn, (Tue Jun 10, 11:18 pm)
Re: git bugs, Stephen R. van den Berg, (Wed Jun 11, 5:46 am)
Re: git bugs, Linus Torvalds, (Wed Jun 11, 7:52 am)
Re: git bugs, Linus Torvalds, (Wed Jun 11, 7:54 am)
Re: git bugs, Ben Lynn, (Wed Jun 11, 10:52 am)
Re: git bugs, Linus Torvalds, (Wed Jun 11, 11:10 am)
Re: git bugs, Ben Lynn, (Wed Jun 11, 11:48 am)
Re: git bugs, Linus Torvalds, (Wed Jun 11, 11:53 am)
Re: git bugs, Ben Lynn, (Wed Jun 11, 1:57 pm)
Re: git bugs, Junio C Hamano, (Wed Jun 11, 2:50 pm)
Re: git bugs, Shawn O. Pearce, (Wed Jun 11, 8:17 pm)
Re: git bugs, Ben Lynn, (Wed Jun 11, 11:46 pm)
Re: git bugs, Ben Lynn, (Wed Jun 11, 11:51 pm)
Re: git bugs, Johannes Schindelin, (Thu Jun 12, 12:12 am)
Re: git bugs, Junio C Hamano, (Thu Jun 12, 1:06 pm)
Re: git bugs, Jeff King, (Fri Jun 13, 3:10 am)
Re: git bugs, Junio C Hamano, (Fri Jun 13, 4:09 pm)
Re: git bugs, Jeff King, (Fri Jun 13, 11:25 pm)