]> git.baikalelectronics.ru Git - kernel.git/commit
UBIFS: allow for racing between GC and TNC
authorAdrian Hunter <ext-adrian.hunter@nokia.com>
Fri, 22 Aug 2008 11:23:35 +0000 (14:23 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Mon, 25 Aug 2008 11:34:02 +0000 (14:34 +0300)
commit19c10391b8f5b5b366d5d73ad7e52c01532a8c9c
tree39017065a8418b60362686a7771afe138e100c08
parent511777d24d189821c6842837965cc6a281e57e8f
UBIFS: allow for racing between GC and TNC

The TNC mutex is unlocked prematurely when reading leaf nodes
with non-hashed keys.  This is unsafe because the node may be
moved by garbage collection and the eraseblock unmapped, although
that has never actually happened during stress testing.

This patch fixes the flaw by detecting the race and retrying with
the TNC mutex locked.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
fs/ubifs/gc.c
fs/ubifs/misc.h
fs/ubifs/tnc.c
fs/ubifs/ubifs.h