diff options
author | srimugunthan dhandapani <srimugunthan.dhandapani@gmail.com> | 2011-08-26 06:38:39 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-08-26 06:38:39 -0400 |
commit | 7606f85a701ed8feeac065e133ff9a51c267aa0d (patch) | |
tree | 6c6d307b349c0897a6f76c4d16e8ae50adc7897b /fs/ubifs/sb.c | |
parent | d37854cf99319966f34bb19c7a897b87d478b56c (diff) |
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: srimugunthan <srimugunthan.dhandapani@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Diffstat (limited to 'fs/ubifs/sb.c')
-rw-r--r-- | fs/ubifs/sb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index 93d938ad3d2a..6094c5a5d7a8 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c | |||
@@ -247,7 +247,7 @@ static int create_default_filesystem(struct ubifs_info *c) | |||
247 | mst->total_dirty = cpu_to_le64(tmp64); | 247 | mst->total_dirty = cpu_to_le64(tmp64); |
248 | 248 | ||
249 | /* The indexing LEB does not contribute to dark space */ | 249 | /* The indexing LEB does not contribute to dark space */ |
250 | tmp64 = (c->main_lebs - 1) * c->dark_wm; | 250 | tmp64 = ((long long)(c->main_lebs - 1) * c->dark_wm); |
251 | mst->total_dark = cpu_to_le64(tmp64); | 251 | mst->total_dark = cpu_to_le64(tmp64); |
252 | 252 | ||
253 | mst->total_used = cpu_to_le64(UBIFS_INO_NODE_SZ); | 253 | mst->total_used = cpu_to_le64(UBIFS_INO_NODE_SZ); |