diff --git a/mm/gup.c b/mm/gup.c index 746070a1d8bf..81ffbd8fec9c 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -3351,8 +3351,7 @@ static unsigned long gup_fast(unsigned long start, unsigned long end, return 0; if (gup_flags & FOLL_PIN) { - seq = raw_read_seqcount(¤t->mm->write_protect_seq); - if (seq & 1) + if (!raw_seqcount_try_begin(¤t->mm->write_protect_seq, seq)) return 0; }