Re: [PATCH] UBI: Fix possible deadlock in erase_worker()

2014-09-19 Thread Richard Weinberger
Am 19.09.2014 12:47, schrieb Artem Bityutskiy: > On Fri, 2014-09-19 at 11:46 +0200, Richard Weinberg >> Or we apply "[PATCH 1/2] UBI: Call worker functions without work_sem held". >> :) > > But I explained in the other e-mail that the semaphore is needed, and > why. Sorry, I completely misunders

Re: [PATCH] UBI: Fix possible deadlock in erase_worker()

2014-09-19 Thread Artem Bityutskiy
On Fri, 2014-09-19 at 11:46 +0200, Richard Weinberg > Or we apply "[PATCH 1/2] UBI: Call worker functions without work_sem held". :) But I explained in the other e-mail that the semaphore is needed, and why. -- Best Regards, Artem Bityutskiy -- To unsubscribe from this list: send the line "unsu

Re: [PATCH] UBI: Fix possible deadlock in erase_worker()

2014-09-19 Thread Richard Weinberger
Am 17.09.2014 11:35, schrieb Artem Bityutskiy: > 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_s

Re: [PATCH] UBI: Fix possible deadlock in erase_worker()

2014-09-17 Thread Artem Bityutskiy
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

Re: [PATCH] UBI: Fix possible deadlock in erase_worker()

2014-09-17 Thread Artem Bityutskiy
On Wed, 2014-09-17 at 10:40 +0200, Richard Weinberger wrote: > /* > * nested locking. NOTE: rwsems are not allowed to recurse > * (which occurs if the same task tries to acquire the same > * lock instance multiple times), but multiple locks of the > * same lock class might be taken, if the orde

Re: [PATCH] UBI: Fix possible deadlock in erase_worker()

2014-09-17 Thread Richard Weinberger
Am 17.09.2014 10:28, schrieb Artem Bityutskiy: > 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_s

Re: [PATCH] UBI: Fix possible deadlock in erase_worker()

2014-09-17 Thread Artem Bityutskiy
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