summaryrefslogtreecommitdiff
path: root/mkfs.ubifs
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-03-07 16:08:30 +0200
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-03-07 16:08:30 +0200
commitc36e0067ffdae9ca83abae89f2d22dc9013d9734 (patch)
treea2fff0358202748b8b671679b8fef6d7ca6398e1 /mkfs.ubifs
parentac10be41ad321752682f2549ebc42b2512012f60 (diff)
mkfs.ubifs: do not ignore --max-leb-cnt when formatting an UBI volume
When the output file is an UBI volume - mkfs.ubifs just sets --max-leb-cnt to the volume size and ignores the user-supplied --max-leb-cnt value, which is wrong. Let's set it to the volume size only if the user did not supply --max-leb-cnt. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'mkfs.ubifs')
-rw-r--r--mkfs.ubifs/mkfs.ubifs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
index f77e5e6..bb25dc3 100644
--- a/mkfs.ubifs/mkfs.ubifs.c
+++ b/mkfs.ubifs/mkfs.ubifs.c
@@ -667,7 +667,8 @@ static int get_options(int argc, char**argv)
if (out_ubi) {
c->min_io_size = c->di.min_io_size;
c->leb_size = c->vi.leb_size;
- c->max_leb_cnt = c->vi.rsvd_lebs;
+ if (c->max_leb_cnt == -1)
+ c->max_leb_cnt = c->vi.rsvd_lebs;
}
if (c->min_io_size == -1)