Re: [PATCH v2 5/6] reftable/stack: allow passing flags to `reftable_stack_add()`

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

 



On Mon, Aug 11, 2025 at 02:34:49PM -0500, Justin Tobler wrote:
> On 25/08/04 11:40AM, Patrick Steinhardt wrote:
> > diff --git a/reftable/stack.c b/reftable/stack.c
> > index d6e4ea93a37..f77d7f58e8e 100644
> > --- a/reftable/stack.c
> > +++ b/reftable/stack.c
> > @@ -737,10 +737,10 @@ static int reftable_stack_init_addition(struct reftable_addition *add,
> >  static int stack_try_add(struct reftable_stack *st,
> >  			 int (*write_table)(struct reftable_writer *wr,
> >  					    void *arg),
> > -			 void *arg)
> > +			 void *arg, unsigned flags)
> >  {
> >  	struct reftable_addition add = REFTABLE_ADDITION_INIT;
> > -	int err = reftable_stack_init_addition(&add, st, 0);
> > +	int err = reftable_stack_init_addition(&add, st, flags);
> 
> Ok, so now if the `REFTABLE_STACK_NEW_ADDITION_RELOAD` flag is provided,
> reftable_stack_init_addition() will attempt to reload the stack if it is
> outdated before locking the stack. I assume Git itself hasn't needed
> this because it just uses reftable_stack_new_addition() directly when
> neccessary.

Not in all code paths, and arguably Git should pass the flag in those
code paths that don't yet. We already perform all verification under the
lock anyway, so this would be the right thing to do.

In this patch series I wanted to focus on improvements to the library
for now, not to the backend. But honestly, there isn't really a good
reason to not already fix this while we're working on this.

Patrick




[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