mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Huang Shijie <b32955@freescale.com>
Cc: dwmw2@infradead.org, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: cmdlinepart: fix the overflow of big mtd partitions
Date: Thu, 15 Nov 2012 15:45:04 +0200	[thread overview]
Message-ID: <1352987104.2221.50.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <1351749497-31692-1-git-send-email-b32955@freescale.com>

[-- Attachment #1: Type: text/plain, Size: 971 bytes --]

On Thu, 2012-11-01 at 13:58 +0800, Huang Shijie wrote:
> When the kernel parses the following cmdline
> 
> 	#mtdparts=gpmi-nand:16m(boot),16m(kernel),1g(home),4g(test),-(usr)
> 
> for a big nand chip Micron MT29F64G08AFAAAWP(8GB), we got the following wrong
> result:
> 
> 	.............................................
> 		"mtd: partition size too small (0)"
> 	.............................................
> 
> We can not get any partition.
> 
> The "4g(test)" partition triggers a overflow of the "size". The memparse()
> returns 4g to the "size", but the size is "unsigned long" type, so a overflow
> occurs, the "size" becomes zero in the end.
> 
> This patch changes the "size"/"offset" to "unsigned long long" type,
> and replaces the UINT_MAX with ULLONG_MAX for macros SIZE_REMAINING and
> OFFSET_CONTINUOUS.
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com>

Pushed to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      reply	other threads:[~2012-11-15 13:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-01  5:58 Huang Shijie
2012-11-15 13:45 ` Artem Bityutskiy [this message]

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=1352987104.2221.50.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=b32955@freescale.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome