UBI: correct ubi_wl_flush locking
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Thu, 7 Jun 2012 12:15:30 +0000 (15:15 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Thu, 21 Jun 2012 13:32:38 +0000 (16:32 +0300)
commit63812c1ccd6fde6b01a5f5af307e74dd52f3bb95
treed2966828c71ec35700bdd49a20b2b2aea75e6c31
parentb7708576ccd0390ed8d014d40adfbe192576d1eb
UBI: correct ubi_wl_flush locking

Commit "62f38455 UBI: modify ubi_wl_flush function to clear work queue for a lnum"
takes the 'work_sem' semaphore in write mode for the entire loop, which is not
very good because it will block other workers for potentially long time. We do
not need to have it in write mode - read mode is enough, and we do not need to
hole it over the entire loop. So this patch turns changes the locking: takes
'work_sem' in read mode and pushes it down to the loop.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/ubi/wl.c