summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMårten Lindahl <marten.lindahl@axis.com>2022-10-13 14:02:49 +0200
committerRichard Weinberger <richard@nod.at>2023-02-02 21:13:35 +0100
commit6addbe91fcccd446036d5acc8e54a9b4395ac4bb (patch)
tree7caa83c83714a4cfcffd4130de0a2dbf004831bd
parentubifs: Fix memory leak in ubifs_sysfs_init() (diff)
downloadlinux-6addbe91fcccd446036d5acc8e54a9b4395ac4bb.tar.xz
linux-6addbe91fcccd446036d5acc8e54a9b4395ac4bb.zip
ubi: block: Reduce warning print to info for static volumes
If volume size is not multiple of the sector size 512 a warning is printed saying that the last non-sector aligned bytes will be ignored. This should be valid for resizable volumes, but when creating static volumes which are read only this will always be printed even if the unaligned data is deliberate. The message is still valid but the severity should be lowered for static volumes. Signed-off-by: Mårten Lindahl <marten.lindahl@axis.com> Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--drivers/mtd/ubi/block.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
index 75eaecc8639f..d725215ae66e 100644
--- a/drivers/mtd/ubi/block.c
+++ b/drivers/mtd/ubi/block.c
@@ -354,9 +354,12 @@ static int calc_disk_capacity(struct ubi_volume_info *vi, u64 *disk_capacity)
u64 size = vi->used_bytes >> 9;
if (vi->used_bytes % 512) {
- pr_warn("UBI: block: volume size is not a multiple of 512, "
- "last %llu bytes are ignored!\n",
- vi->used_bytes - (size << 9));
+ if (vi->vol_type == UBI_DYNAMIC_VOLUME)
+ pr_warn("UBI: block: volume size is not a multiple of 512, last %llu bytes are ignored!\n",
+ vi->used_bytes - (size << 9));
+ else
+ pr_info("UBI: block: volume size is not a multiple of 512, last %llu bytes are ignored!\n",
+ vi->used_bytes - (size << 9));
}
if ((sector_t)size != size)