torture: Avoid double ->up_read()

If rcu_torture_one_read_start() called in rcu_torture_updown_one() when
there is no writer thread, it will call rcutorture_one_extend() with
RCUTORTURE_RDR_UPDOWN, and an ->up_read() has already been issued in
this case and rcu_torture_one_read_start() will return false. Therefore
the other cur_ops->up_read() is not necessary after the if is taken.
Hence remove it.

While we are at it, reorder the WRITE_ONCE() and WARN_ONCE() to the
order that they should be: checking whether there are greater or equal
numbers of ups than downs *before* increasing the number of ups.

Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
1 file changed