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

Re: [PATCH 3/3] refs.c: remove lock_fd from struct ref_lock

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 15, 2015, 18:35 UTC
Message-ID
<xmqqbnipkzol.fsf@gitster.dls.corp.google.com>
In-Reply-To
<552E2608.7020104@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 29 quoted lines
> This whole series LGTM; however, I suggest that this patch be split up.
> See below.
>
>> Signed-off-by: Stefan Beller <sbeller@google.com>
>> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>> ---
>>  refs.c | 16 ++++++----------
>>  1 file changed, 6 insertions(+), 10 deletions(-)
>> 
>> diff --git a/refs.c b/refs.c
>> index 14e52ca..4066752 100644
>> --- a/refs.c
>> +++ b/refs.c
>> [...]
>> @@ -2335,8 +2333,8 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
>>  		goto error_return;
>>  	}
>>  
>> -	lock->lock_fd = hold_lock_file_for_update(lock->lk, ref_file, lflags);
>> -	if (lock->lock_fd < 0) {
>> +	if (hold_lock_file_for_update(lock->lk, ref_file, lflags) < 0) {
>> +		last_errno = errno;
>>  		if (errno == ENOENT && --attempts_remaining > 0)
>>  			/*
>>  			 * Maybe somebody just deleted one of the
>> [...]
>
> Here you add the line "last_errno = errno". It is a good change, but it
> is not part of removing ref_lock::lock_fd.

I think this patch came from an ancient codebase before 06839515 (lock_ref_sha1_basic: do not die on locking errors, 2014-11-19), which added the "last_errno = errno", and was not rebased to match more recent codebase.

I am planning to apply these on top of v2.4.0-rc, so there will be no new "save to last_errno" in the end.

Thanks.
Previous: Michael Haggerty
Message 7 of 7 in “Large transactions in git”
  1. 0/3 Large transactions in gitStefan Beller, Apr 14, 2015
  2. 1/3 update-ref: test handling large transactions properlyStefan Beller, Apr 14, 2015
  3. 2/3 t7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZEStefan Beller, Apr 14, 2015
  4. 3/3 refs.c: remove lock_fd from struct ref_lockStefan Beller, Apr 14, 2015
  5. Junio C HamanoApr 14, 2015
  6. Michael HaggertyApr 15, 2015
  7. Junio C HamanoApr 15, 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.