Commit d38dce5b authored by Artem Bityutskiy's avatar Artem Bityutskiy

UBI: do not panic if volume check fails

If a volume paranoid check fails, do not return an error
code to the caller, but just print error messages and go
forward. The primary reason for this is that it is difficult
to recover and cancel the operation at that stage.
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent cfcf0ec8
...@@ -358,7 +358,8 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req) ...@@ -358,7 +358,8 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
ubi->vol_count += 1; ubi->vol_count += 1;
spin_unlock(&ubi->volumes_lock); spin_unlock(&ubi->volumes_lock);
err = paranoid_check_volumes(ubi); if (paranoid_check_volumes(ubi))
dbg_err("check failed while creating volume %d", vol_id);
return err; return err;
out_sysfs: out_sysfs:
...@@ -465,8 +466,9 @@ int ubi_remove_volume(struct ubi_volume_desc *desc, int no_vtbl) ...@@ -465,8 +466,9 @@ int ubi_remove_volume(struct ubi_volume_desc *desc, int no_vtbl)
ubi->vol_count -= 1; ubi->vol_count -= 1;
spin_unlock(&ubi->volumes_lock); spin_unlock(&ubi->volumes_lock);
if (!no_vtbl) if (!no_vtbl && paranoid_check_volumes(ubi))
err = paranoid_check_volumes(ubi); dbg_err("check failed while removing volume %d", vol_id);
return err; return err;
out_err: out_err:
...@@ -587,7 +589,8 @@ int ubi_resize_volume(struct ubi_volume_desc *desc, int reserved_pebs) ...@@ -587,7 +589,8 @@ int ubi_resize_volume(struct ubi_volume_desc *desc, int reserved_pebs)
(long long)vol->used_ebs * vol->usable_leb_size; (long long)vol->used_ebs * vol->usable_leb_size;
} }
err = paranoid_check_volumes(ubi); if (paranoid_check_volumes(ubi))
dbg_err("check failed while re-sizing volume %d", vol_id);
return err; return err;
out_acc: out_acc:
...@@ -635,8 +638,8 @@ int ubi_rename_volumes(struct ubi_device *ubi, struct list_head *rename_list) ...@@ -635,8 +638,8 @@ int ubi_rename_volumes(struct ubi_device *ubi, struct list_head *rename_list)
} }
} }
if (!err) if (!err && paranoid_check_volumes(ubi))
err = paranoid_check_volumes(ubi); ;
return err; return err;
} }
...@@ -688,7 +691,8 @@ int ubi_add_volume(struct ubi_device *ubi, struct ubi_volume *vol) ...@@ -688,7 +691,8 @@ int ubi_add_volume(struct ubi_device *ubi, struct ubi_volume *vol)
return err; return err;
} }
err = paranoid_check_volumes(ubi); if (paranoid_check_volumes(ubi))
dbg_err("check failed while adding volume %d", vol_id);
return err; return err;
out_gluebi: out_gluebi:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment