[PATCH 08/10] staging: erofs: locked before registering for all new workgroups

2018-11-20 Thread Gao Xiang
Let's make sure that the one registering a workgroup will also take the primary work lock at first for two reasons: 1) There's no need to introduce such a race window (and consequently overhead) between registering and locking, other tasks could break in by chance, and the race seems un

Re: [PATCH 08/10] staging: erofs: locked before registering for all new workgroups

2018-11-22 Thread Greg Kroah-Hartman
On Tue, Nov 20, 2018 at 10:34:23PM +0800, Gao Xiang wrote: > Let's make sure that the one registering a workgroup will also > take the primary work lock at first for two reasons: > 1) There's no need to introduce such a race window (and consequently > overhead) between registering and lockin

Re: [PATCH 08/10] staging: erofs: locked before registering for all new workgroups

2018-11-22 Thread Gao Xiang
Hi Greg, On 2018/11/22 18:24, Greg Kroah-Hartman wrote: >> +/* lock all primary followed works before visible to others */ >> +if (unlikely(!mutex_trylock(&work->lock))) >> +/* for a new workgroup, try_lock *never* fails */ >> +DBG_BUGON(1); > Again, drop this, if i