git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [External] Re: [PATCH 1/1] freshen_file(): use NULL `times' for implicit current-time

From
Jeff King <peff@peff.net>
Date
Apr 15, 2020, 16:05 UTC
Message-ID
<20200415160535.GF2464307@coredump.intra.peff.net>
In-Reply-To
<20200415090906.wudutxpiyw7ooas6@C02Z11TTLVDN.corpad.adbkng.com>
On Wed, Apr 15, 2020 at 11:09:06AM +0200, luciano.rocha@booking.com wrote:
Show 16 quoted lines
> > The old code was setting the time based on the system time from time().
> > We've occasionally hit cases where the filesystem time and the system
> > time do not match exactly (this might be true on an NFS mount, for
> > example).
> > 
> > It's not clear to me whether utime(NULL) would be using the system or
> > filesystem time in such a case. If the former, then there's no change in
> > behavior. If the latter, I'd argue that it's probably an _improvement_,
> > since we're simulating the case that we wrote a new file with a new
> > mtime.
> 
> I'm not that familiar with kernel code, so can't say for sure. From a
> cursory look, it doesn't seem like it uses the remote server's time.
> 
> But it does seem to have a higher precision, for filesystems that
> support it.
Yeah, that's another point in its favor.

It seems pretty clear to me that utime(NULL) should give either the same or better behavior in all cases.

-Peff
Previous: luciano.rocha@booking.comNext: Junio C Hamano
Message 4 of 8 in “freshen_file(): use NULL `times' for implicit current-time”
  1. 1/1 freshen_file(): use NULL `times' for implicit current-timeluciano.rocha@booking.com, Apr 14, 2020
  2. Jeff KingApr 14, 2020
  3. luciano.rocha@booking.comApr 15, 2020
  4. Jeff KingApr 15, 2020
  5. Junio C HamanoApr 15, 2020
  6. Junio C HamanoApr 15, 2020
  7. brian m. carlsonApr 15, 2020
  8. Junio C HamanoApr 16, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.