All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ma Haijun <mahaijuns@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] fs/ext4: fix partition size get truncated in calculation
Date: Wed,  8 Jan 2014 06:49:43 +0800	[thread overview]
Message-ID: <1389134983-9510-1-git-send-email-mahaijuns@gmail.com> (raw)

It may cause file system corruption when do a write operation.
This issue only affects boards that use 32 bit lbaint_t.

Signed-off-by: Ma Haijun <mahaijuns@gmail.com>
---
 fs/ext4/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/dev.c b/fs/ext4/dev.c
index 787e041..e0b513a 100644
--- a/fs/ext4/dev.c
+++ b/fs/ext4/dev.c
@@ -41,7 +41,7 @@ void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
 	get_fs()->dev_desc = rbdd;
 	part_info = info;
 	part_offset = info->start;
-	get_fs()->total_sect = (info->size * info->blksz) >>
+	get_fs()->total_sect = ((uint64_t)info->size * info->blksz) >>
 		get_fs()->dev_desc->log2blksz;
 }
 
-- 
1.8.3.2

             reply	other threads:[~2014-01-07 22:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 22:49 Ma Haijun [this message]
2014-01-20 22:59 ` [U-Boot] fs/ext4: fix partition size get truncated in calculation Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1389134983-9510-1-git-send-email-mahaijuns@gmail.com \
    --to=mahaijuns@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.