ubi: Fix Fastmap's update_vol()
authorRichard Weinberger <richard@nod.at>
Wed, 24 Aug 2016 12:36:15 +0000 (14:36 +0200)
committerRichard Weinberger <richard@nod.at>
Sun, 2 Oct 2016 20:55:02 +0000 (22:55 +0200)
commitf7d11b33d4e8cedf19367c09b891bbc705163976
treed2f47e8298c10817fb230b9a446df010d89df3bd
parent2e8f08deabbc7eefe4c5838aaa6aa9a23a8acf2e
ubi: Fix Fastmap's update_vol()

Usually Fastmap is free to consider every PEB in one of the pools
as newer than the existing PEB. Since PEBs in a pool are by definition
newer than everything else.
But update_vol() missed the case that a pool can contain more than
one candidate.

Cc: <stable@vger.kernel.org>
Fixes: dbb7d2a88d ("UBI: Add fastmap core")
Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/ubi/fastmap.c