staging: erofs: fix `erofs_workgroup_{try_to_freeze, unfreeze}'
authorGao Xiang <gaoxiang25@huawei.com>
Thu, 22 Nov 2018 17:16:02 +0000 (01:16 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:09:02 +0000 (10:09 +0100)
commit08ec9e6892cc792d7f8fe4d13bd8a0e91fb23488
tree1488852cf04cc39ecd30b2ec87689a5fa41093d3
parentb0a18cab6aebc744b46860200509aa22a5dd042e
staging: erofs: fix `erofs_workgroup_{try_to_freeze, unfreeze}'

commit 73f5c66df3e26ab750cefcb9a3e08c71c9f79cad upstream.

There are two minor issues in the current freeze interface:

   1) Freeze interfaces have not related with CONFIG_DEBUG_SPINLOCK,
      therefore fix the incorrect conditions;

   2) For SMP platforms, it should also disable preemption before
      doing atomic_cmpxchg in case that some high priority tasks
      preempt between atomic_cmpxchg and disable_preempt, then spin
      on the locked refcount later.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/erofs/internal.h