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

2015-08-05 Thread Linus Torvalds
On Tue, Aug 4, 2015 at 11:03 PM, Junio C Hamano gits...@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

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

2015-08-05 Thread Clemens Buchacher
On Wed, Aug 05, 2015 at 10:59:09AM +0200, Linus Torvalds wrote: On Tue, Aug 4, 2015 at 11:03 PM, Junio C Hamano gits...@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

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

2015-08-05 Thread Junio C Hamano
Clemens Buchacher clemens.buchac...@intel.com writes: On Wed, Aug 05, 2015 at 10:59:09AM +0200, Linus Torvalds wrote: ... 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

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

2015-08-04 Thread Clemens Buchacher
In read_sha1_file_extended we die if read_object fails with a fatal error. We detect a fatal error if errno is non-zero and is not ENOENT. If the object could not be read because it does not exist, this is not considered a fatal error and we want to return NULL. Somewhere down the line,

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

2015-08-04 Thread Junio C Hamano
Clemens Buchacher clemens.buchac...@intel.com writes: diff --git a/sha1_file.c b/sha1_file.c index 77cd81d..62b7ad6 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -1453,6 +1453,7 @@ int git_open_noatime(const char *name) static int sha1_file_open_flag = O_NOATIME; for (;;) {

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

2015-07-08 Thread Clemens Buchacher
In read_sha1_file_extended we die if read_object fails with a fatal error. We detect a fatal error if errno is non-zero and is not ENOENT. If the object could not be read because it does not exist, this is not considered a fatal error and we want to return NULL. Somewhere down the line,

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

2015-07-08 Thread Eric Sunshine
On Wed, Jul 8, 2015 at 8:38 AM, Clemens Buchacher clemens.buchac...@intel.com wrote: In read_sha1_file_extended we die if read_object fails with a fatal error. We detect a fatal error if errno is non-zero and is not ENOENT. If the object could not be read because it does not exist, this is not