]> git.karo-electronics.de Git - linux-beck.git/commitdiff
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)
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

index 8bd468332ec0a8f24b0bc7f892015afc37f47101..d6384d9657885c31c01e8fa1a5a2ed82530b0891 100644 (file)
@@ -304,6 +304,7 @@ static int update_vol(struct ubi_device *ubi, struct ubi_attach_info *ai,
                        aeb->pnum = new_aeb->pnum;
                        aeb->copy_flag = new_vh->copy_flag;
                        aeb->scrub = new_aeb->scrub;
+                       aeb->sqnum = new_aeb->sqnum;
                        ubi_free_aeb(ai, new_aeb);
 
                /* new_aeb is older */