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

Re: [PATCH] git_open_noatime: return with errno=0 on success

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Aug 5, 2015, 08:59 UTC
Message-ID
<CA+55aFx-WXxCbVTWdJHFf4WA2MNXS3UMerv4cD1wtsZGaQkJLw@mail.gmail.com>
In-Reply-To
<xmqqfv3y6a24.fsf@gitster.dls.corp.google.com>
On Tue, Aug 4, 2015 at 11:03 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
> I would agree it is a good idea to clear it after seeing the first
> open fail due to lack of O_NOATIME before trying open for the second
> time, iow, more like this?

So I don't think this is _wrong_ per se, but I think the deeper issue is that somebody cares about 'errno' here in the first place.

A stale 'errno' generally shouldn't matter, because we either
 (a) return success (and nobody should look at errno)
or
 (b) return an error later, without setting errno for that _later_ error.

and I think either of those two situations are the real bug, and this "clear stale errno" is just a workaround.

But as mentioned, I don't think clearign errno is wrong, so I'm not objecting to the patch. I just suspect there's something else goign on too..

              Linus
Previous: Junio C HamanoNext: Clemens Buchacher
Message 5 of 7 in “git_open_noatime: return with errno=0 on success”
  1. git_open_noatime: return with errno=0 on successClemens Buchacher, Jul 8, 2015
  2. Eric SunshineJul 8, 2015
  3. git_open_noatime: return with errno=0 on successClemens Buchacher, Aug 4, 2015
  4. Junio C HamanoAug 4, 2015
  5. Linus TorvaldsAug 5, 2015
  6. Clemens BuchacherAug 5, 2015
  7. Junio C HamanoAug 5, 2015

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.