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]

 



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.

(I guess you just missed changing that last one... I'm in process of
 changing all these "*_seqcount_t_*" stuff to "do_*" as we talked on the
 v2 thread. Hopefully there will be no more confusion after that.)

Kind regards,

--
Ahmed S. Darwish
Linutronix GmbH




[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