On Tue, 19 Aug 2025, Takashi Yano wrote:

> On Mon, 18 Aug 2025 16:30:48 -0700 (PDT)
> Jeremy Drake wrote:
> > -      bool self = (lf->lf_flags == lock->lf_flags)
> > +      bool self = ((lf->lf_flags & ~F_WAIT) == (lock->lf_flags & ~F_WAIT))
> >               && (lf->lf_id == lock->lf_id);
> >
> >        if (bsd_flock || ((type & SELF) && !self) || ((type & OTHERS) && 
> > self))
>
> The patch itself LGTM, however, I wonder why it is not necessary to compare
> also 'lf_type' here. Or is it enough to compare only 'lf_id' by any chance?

I don't know, I was only looking at the commit in question and debugging
to see how to un-regress the tests.  It wasn't looking at lf_type before
or after.  lf_flags contains whether it's posix, bsd flock, or now ofd
lock.  lf_type contains whether it's read lock, write lock, or unlocked.
lf_id contains the pid or a unique id.

Reply via email to