mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
UBI: fix autoresize handling in R/O mode
commit abb3e01103
upstream.
Currently UBI fails in autoresize when it is in R/O mode (e.g., because the
underlying MTD device is R/O). This patch fixes the issue - we just skip
autoresize and print a warning.
Reported-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1168fb4bf4
commit
56a631f3bf
1 changed files with 5 additions and 0 deletions
|
@ -816,6 +816,11 @@ static int autoresize(struct ubi_device *ubi, int vol_id)
|
||||||
struct ubi_volume *vol = ubi->volumes[vol_id];
|
struct ubi_volume *vol = ubi->volumes[vol_id];
|
||||||
int err, old_reserved_pebs = vol->reserved_pebs;
|
int err, old_reserved_pebs = vol->reserved_pebs;
|
||||||
|
|
||||||
|
if (ubi->ro_mode) {
|
||||||
|
ubi_warn("skip auto-resize because of R/O mode");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clear the auto-resize flag in the volume in-memory copy of the
|
* Clear the auto-resize flag in the volume in-memory copy of the
|
||||||
* volume table, and 'ubi_resize_volume()' will propagate this change
|
* volume table, and 'ubi_resize_volume()' will propagate this change
|
||||||
|
|
Loading…
Reference in a new issue