[PATCH v12 3/4]: mtdoops: Make page (record) size configurable

Simon Kagstrom simon.kagstrom at netinsight.net
Tue Nov 3 02:27:54 EST 2009


On Tue, 03 Nov 2009 08:23:58 +0200
Artem Bityutskiy <dedekind1 at gmail.com> wrote:

> On Thu, 2009-10-29 at 13:41 +0100, Simon Kagstrom wrote:
> > The main justification for this is to allow catching long messages
> > during a panic, where the top part might otherwise be lost since moving
> > to the next block can require a flash erase.
> > 
> > Signed-off-by: Simon Kagstrom <simon.kagstrom at netinsight.net>
> > Reviewed-by: Anders Grafstrom <anders.grafstrom at netinsight.net>
> > ---
> > ChangeLog:
> >  * Rebased over "[PATCH v12 2/4]: mtdoops: Add a maximum MTD partition size"
> > 
> >  drivers/mtd/mtdoops.c |   75 ++++++++++++++++++++++++++++--------------------
> >  1 files changed, 44 insertions(+), 31 deletions(-)
> 
> Pushed this one to my tree, on top of the previous patch which I
> tweaked, thanks.

Thanks! I was going to send an updated patch in, but I've had some
other work to do lately. I'll send in a new version of the final patch
before the end of the day.


I noticed a small issue in your updated patch:

> +/* Maximum MTD partition size, MiB */
> +#define MTDOOPS_MAX_MTD_SIZE 32

> @@ -310,6 +312,12 @@ static void mtdoops_notify_add(struct mtd_info *mtd)
>  		return;
>  	}
>  
> +	if (mtd->size > MTDOOPS_MAX_MTD_SIZE) {
> +		printk(KERN_ERR "mtdoops: mtd%d is too large (limit is %d MiB)\n",
> +		       mtd->index, MTDOOPS_MAX_MTD_SIZE);

mtd->size should be in bytes, right? So this will only check that it's
larger than 32 bytes, which most users will probably want ;-)

// Simon



More information about the linux-mtd mailing list