From bb551413526381f1aac04bf8024a8f73f7fcdae3 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Mon, 17 Dec 2007 13:21:07 +0200 Subject: [PATCH] --- yaml --- r: 84227 b: refs/heads/master c: c63a491d3737aec3c47c5e785d87021752ad9fa6 h: refs/heads/master i: 84225: ff95c804421355b096886a76cab4a64a9f6c05ec 84223: 961049f3ba812e9be893e0dc291bb2ab7bc9cc70 v: v3 --- [refs] | 2 +- trunk/drivers/mtd/ubi/eba.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index e1d288b1c9b4..12b6a50a5cde 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cae0a77125467c42f0918e78457913ee4a2f925b +refs/heads/master: c63a491d3737aec3c47c5e785d87021752ad9fa6 diff --git a/trunk/drivers/mtd/ubi/eba.c b/trunk/drivers/mtd/ubi/eba.c index b2b0f29bdc53..2ff34923e51d 100644 --- a/trunk/drivers/mtd/ubi/eba.c +++ b/trunk/drivers/mtd/ubi/eba.c @@ -797,7 +797,7 @@ int ubi_eba_write_leb_st(struct ubi_device *ubi, struct ubi_volume *vol, /* * ubi_eba_atomic_leb_change - change logical eraseblock atomically. * @ubi: UBI device description object - * @vol: volume escription object + * @vol: volume description object * @lnum: logical eraseblock number * @buf: data to write * @len: how many bytes to write @@ -955,6 +955,12 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to, /* * We may race with volume deletion/re-size, so we have to hold * @ubi->volumes_lock. + * + * Note, it is not a problem if we race with volume deletion or re-size + * here. If the volume is deleted or re-sized while we are moving an + * eraseblock which belongs to this volume, we'll end up with finding + * out that this LEB was unmapped at the end (see WL), and drop this + * PEB. */ spin_lock(&ubi->volumes_lock); vol = ubi->volumes[idx];