Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7606f85a authored by srimugunthan dhandapani's avatar srimugunthan dhandapani Committed by Artem Bityutskiy
Browse files

UBIFS: fix the dark space calculation



The dark space calculation should be 64 bit type-casted, when
assigning to tmp64 (similar to how total_free is calculated).
Overflow will occur for very large flashes.

Signed-off-by: default avatarsrimugunthan <srimugunthan.dhandapani@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@intel.com>
parent d37854cf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ static int create_default_filesystem(struct ubifs_info *c)
	mst->total_dirty = cpu_to_le64(tmp64);

	/*  The indexing LEB does not contribute to dark space */
	tmp64 = (c->main_lebs - 1) * c->dark_wm;
	tmp64 = ((long long)(c->main_lebs - 1) * c->dark_wm);
	mst->total_dark = cpu_to_le64(tmp64);

	mst->total_used = cpu_to_le64(UBIFS_INO_NODE_SZ);
+1 −1

File changed.

Contains only whitespace changes.