回复: [PATCH v2] loop: call __loop_clr_fd() with lo_mutex locked to avoid autoclear race

2021-03-26 Thread Zhang, Qiang
发件人: Pavel Tatashin 发送时间: 2021年3月27日 5:41 收件人: Zhang, Qiang 抄送: Jens Axboe; linux-bl...@vger.kernel.org; LKML 主题: Re: [PATCH v2] loop: call __loop_clr_fd() with lo_mutex locked to avoid autoclear race [Please note: This e-mail is from an EXTERNAL e

Re: [PATCH v2] loop: call __loop_clr_fd() with lo_mutex locked to avoid autoclear race

2021-03-26 Thread Pavel Tatashin
On Fri, Mar 26, 2021 at 5:00 AM wrote: > > From: Zqiang > > lo->lo_refcnt = 0 > > CPU0 CPU1 > lo_open()lo_open() > mutex_lock(&lo->lo_mutex) > atomic_inc(&lo->lo_refcnt) > lo_refcnt == 1 > mutex_unlock(&lo->lo_mut

[PATCH v2] loop: call __loop_clr_fd() with lo_mutex locked to avoid autoclear race

2021-03-26 Thread qiang . zhang
From: Zqiang lo->lo_refcnt = 0 CPU0 CPU1 lo_open()lo_open() mutex_lock(&lo->lo_mutex) atomic_inc(&lo->lo_refcnt) lo_refcnt == 1 mutex_unlock(&lo->lo_mutex)