summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Lavnikevich <d.lavnikevich@sam-solutions.com>2014-03-10 14:39:51 +0300
committerSascha Hauer <s.hauer@pengutronix.de>2014-03-12 21:26:37 +0100
commit95147b1d95585b5e51ed0066ff418bc17bcb0c7d (patch)
tree82281dd1319a0da22607d571ca36053d9625c58f
parent76a88c0227a74c48828b8d307f0afab2b2537aec (diff)
downloadbarebox-95147b1d95585b5e51ed0066ff418bc17bcb0c7d.tar.gz
ubi: Fix for creating ubi volumes with 64bit size
Since MTD is already supports >= 4GB device sizes it is better to allow ubi valumes also be created of larger sizes. Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com> Signed-off-by: Grigory Milev <g.milev@sam-solutions.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--commands/ubi.c4
-rw-r--r--drivers/mtd/ubi/cdev.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/commands/ubi.c b/commands/ubi.c
index 57ae790..8a409c2 100644
--- a/commands/ubi.c
+++ b/commands/ubi.c
@@ -15,12 +15,12 @@ static int do_ubimkvol(int argc, char *argv[])
{
struct ubi_mkvol_req req;
int fd, ret;
- size_t size;
+ uint64_t size;
if (argc != 4)
return COMMAND_ERROR_USAGE;
- size = strtoul_suffix(argv[3], NULL, 0);
+ size = strtoull_suffix(argv[3], NULL, 0);
req.name_len = min_t(int, strlen(argv[2]), UBI_VOL_NAME_MAX);
strncpy(req.name, argv[2], req.name_len);
req.name[req.name_len] = 0;
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index 4b8eb4c..dcd138f 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -222,7 +222,7 @@ static int ubi_cdev_ioctl(struct cdev *cdev, int cmd, void *buf)
break;
case UBI_IOCMKVOL:
if (!req->bytes)
- req->bytes = ubi->avail_pebs * ubi->leb_size;
+ req->bytes = (__s64)ubi->avail_pebs * ubi->leb_size;
return ubi_create_volume(ubi, req);
};