Re: [PATCH] rollback index if git-commit is interrupted by a signal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, 29 May 2008, Paolo Bonzini wrote:

> > >  static void rollback_index_files(void)
> > >  {
> > > -	switch (commit_style) {
> > > -	case COMMIT_AS_IS:
> > > -		break; /* nothing to do */
> > > -	case COMMIT_NORMAL:
> > > -		rollback_lock_file(&index_lock);
> > > -		break;
> > > -	case COMMIT_PARTIAL:
> > > -		rollback_lock_file(&index_lock);
> > > -		rollback_lock_file(&false_lock);
> > > -		break;
> > > -	}
> > > +	rollback_lock_file(&index_lock);
> > > +	rollback_lock_file(&false_lock);
> > >  }
> > 
> > Your commit message gives _no_ good reason for this change.  As a 
> > matter of fact, I imagine that this could be a regression.
> 
> Without this change, there could be races between the time the lock file 
> is created and the time the commit_style variable is set, leading to the 
> rollback not being performed.

IMO it would make much more sense to _guarantee_ that the commity_style 
variable is set before the index is locked.  It is feasible, and there is 
no good reason not to do that.

Ciao,
Dscho
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux