[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1410942507.28850.78.camel@sauron.fi.intel.com>
Date: Wed, 17 Sep 2014 11:28:27 +0300
From: Artem Bityutskiy <dedekind1@...il.com>
To: Richard Weinberger <richard@....at>
Cc: dwmw2@...radead.org, computersforpeace@...il.com,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] UBI: Fix possible deadlock in erase_worker()
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists