UBI: Fastmap: Fix fastmap usage in ubi_volume_notify()

There is no need to switch to ro mode if ubi_update_fastmap() fails.
Also get rid of the ifdef.

Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Tanya Brokhman <tlinder@codeaurora.org>
This commit is contained in:
Richard Weinberger 2014-10-06 15:14:16 +02:00
parent 5e0246e332
commit 84b678f497

View File

@ -154,23 +154,22 @@ static struct device_attribute dev_mtd_num =
*/ */
int ubi_volume_notify(struct ubi_device *ubi, struct ubi_volume *vol, int ntype) int ubi_volume_notify(struct ubi_device *ubi, struct ubi_volume *vol, int ntype)
{ {
int ret;
struct ubi_notification nt; struct ubi_notification nt;
ubi_do_get_device_info(ubi, &nt.di); ubi_do_get_device_info(ubi, &nt.di);
ubi_do_get_volume_info(ubi, vol, &nt.vi); ubi_do_get_volume_info(ubi, vol, &nt.vi);
#ifdef CONFIG_MTD_UBI_FASTMAP
switch (ntype) { switch (ntype) {
case UBI_VOLUME_ADDED: case UBI_VOLUME_ADDED:
case UBI_VOLUME_REMOVED: case UBI_VOLUME_REMOVED:
case UBI_VOLUME_RESIZED: case UBI_VOLUME_RESIZED:
case UBI_VOLUME_RENAMED: case UBI_VOLUME_RENAMED:
if (ubi_update_fastmap(ubi)) { ret = ubi_update_fastmap(ubi);
ubi_err(ubi, "Unable to update fastmap!"); if (ret)
ubi_ro_mode(ubi); ubi_msg(ubi, "Unable to write a new fastmap: %i", ret);
}
} }
#endif
return blocking_notifier_call_chain(&ubi_notifiers, ntype, &nt); return blocking_notifier_call_chain(&ubi_notifiers, ntype, &nt);
} }