Re: [PATCH v3 2/2] mm: prevent gup_fast from racing with COW during fork

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

 



On Fri, Nov 06, 2020 at 06:17:16PM +0100, Ahmed S. Darwish wrote:
> Hi Jason,
> 
> On Fri, Nov 06, 2020 at 11:55:14AM -0400, Jason Gunthorpe wrote:
> ...
> > +	if (gup_flags & FOLL_PIN) {
> > +		seq = raw_read_seqcount(&current->mm->write_protect_seq);
> > +		if (seq & 1)
> > +			return 0;
> > +	}
> > +
> ...
> > +	if (gup_flags & FOLL_PIN) {
> > +		if (read_seqcount_t_retry(&current->mm->write_protect_seq,
> > +					  seq)) {
> > +			unpin_user_pages(pages, nr_pinned);
> > +			return 0;
> > +		}
> > +	}
> 
> From seqlock.h:
> 
>     /**
>      * raw_read_seqcount() - read the raw seqcount_t counter value
>      * ...
>      * Return: count to be passed to read_seqcount_retry()
>      */
>     #define raw_read_seqcount(s)
> 
> Please avoid using the internal API (read_seqcount_*t*_retry) and just
> use read_seqcount_retry() as the documentation suggests.

Oh, yes I didn't notice this one in all the discussion that spawned
from the first thread. Thanks

Jason




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux