Re: [PATCH 4/6] UBI: Fastmap: Fix races in ubi_wl_get_peb()

2014-12-07 Thread Richard Weinberger
Am 07.12.2014 um 08:36 schrieb Tanya Brokhman: > On 12/5/2014 11:08 PM, Richard Weinberger wrote: > >> >> spin_unlock(&ubi->wl_lock); >> +if (retried) { >> +ubi_err(ubi, "Unable to get a free PEB from user WL pool"); >> +ret = -ENOSPC; >>

Re: [PATCH 4/6] UBI: Fastmap: Fix races in ubi_wl_get_peb()

2014-12-06 Thread Tanya Brokhman
On 12/5/2014 11:08 PM, Richard Weinberger wrote: spin_unlock(&ubi->wl_lock); +if (retried) { +ubi_err(ubi, "Unable to get a free PEB from user WL pool"); +ret = -ENOSPC; +goto out; +} +retried = 1; Why did you decide to

Re: [PATCH 4/6] UBI: Fastmap: Fix races in ubi_wl_get_peb()

2014-12-05 Thread Richard Weinberger
Tanya, Am 05.12.2014 um 17:54 schrieb Tanya Brokhman: > Hi Richard > > On 12/5/2014 3:20 PM, Richard Weinberger wrote: >> Tanya, >> >> Am 05.12.2014 um 14:09 schrieb Tanya Brokhman: >>> On 11/24/2014 3:20 PM, Richard Weinberger wrote: ubi_wl_get_peb() has two problems, it reads the pool

Re: [PATCH 4/6] UBI: Fastmap: Fix races in ubi_wl_get_peb()

2014-12-05 Thread Tanya Brokhman
Hi Richard On 12/5/2014 3:20 PM, Richard Weinberger wrote: Tanya, Am 05.12.2014 um 14:09 schrieb Tanya Brokhman: On 11/24/2014 3:20 PM, Richard Weinberger wrote: ubi_wl_get_peb() has two problems, it reads the pool size and usage counters without any protection. While reading one value would

Re: [PATCH 4/6] UBI: Fastmap: Fix races in ubi_wl_get_peb()

2014-12-05 Thread Richard Weinberger
Tanya, Am 05.12.2014 um 14:09 schrieb Tanya Brokhman: > On 11/24/2014 3:20 PM, Richard Weinberger wrote: >> ubi_wl_get_peb() has two problems, it reads the pool >> size and usage counters without any protection. >> While reading one value would be perfectly fine it reads multiple >> values and com

Re: [PATCH 4/6] UBI: Fastmap: Fix races in ubi_wl_get_peb()

2014-12-05 Thread Tanya Brokhman
On 11/24/2014 3:20 PM, Richard Weinberger wrote: ubi_wl_get_peb() has two problems, it reads the pool size and usage counters without any protection. While reading one value would be perfectly fine it reads multiple values and compares them. This is racy and can lead to incorrect pool handling. F

[PATCH 4/6] UBI: Fastmap: Fix races in ubi_wl_get_peb()

2014-11-24 Thread Richard Weinberger
ubi_wl_get_peb() has two problems, it reads the pool size and usage counters without any protection. While reading one value would be perfectly fine it reads multiple values and compares them. This is racy and can lead to incorrect pool handling. Furthermore ubi_update_fastmap() is called without w