lkml.org 
[lkml]   [2014]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] UBI: Fix possible deadlock in erase_worker()
From
Date
On Tue, 2014-09-16 at 09:48 +0200, Richard Weinberger wrote:
> If sync_erase() failes with EINTR, ENOMEM, EAGAIN or
> EBUSY erase_worker() re-schedules the failed work.
> This will lead to a deadlock because erase_worker() is called
> with work_sem held in read mode. And schedule_erase() will take
> this lock again.

IIRC, the assumption was that the R/W semaphore may be taken in read
mode many times, so it wouldn't hurt to do:

down_read()
down_read()
up_read()
up_read()

If this is right, then the lockdep warning is incorrect.

--
Best Regards,
Artem Bityutskiy



\
 
 \ /
  Last update: 2014-09-17 11:01    [W:0.088 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site