]> www.infradead.org Git - mtd-utils.git/commit
ubimkvol: check for free LEBs
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 2 Sep 2008 13:46:48 +0000 (16:46 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 2 Sep 2008 13:50:58 +0000 (16:50 +0300)
commit214ddd398850d003dcd1943da6a039f324646b5b
treeb9830bc7e4942a5aab8bcc61eead896bb21875ff
parentdf0965a0b0dea9210078e616e1af696966fbb1ac
ubimkvol: check for free LEBs

Check for free LEBs before trying to create a volume. This fixes
the following issue:

$ ubimkvol /dev/ubi0 -n 0 -N test_fs -m
ubimkvol: error!: cannot UBI create volume
          error 22 (Invalid argument)
Error: cannot create UBI volume

"Invalid argument" ? Not understandable. But the thing is that
-m makes ubimkvol use available space, which is zero, then it
passes zero to the ioctl, which fails in request validation
code, because 0 invalid volume size.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
ubi-utils/new-utils/src/ubimkvol.c