[PATCH v12 2/4]: mtdoops: Add a maximum MTD partition size

Artem Bityutskiy dedekind1 at gmail.com
Thu Oct 29 11:27:09 EDT 2009


On Thu, 2009-10-29 at 13:41 +0100, Simon Kagstrom wrote:
> A configurable maximum MTD partition size for mtdoops avoids mistakes
> where the user gives e.g., a rootfs partition to mtdoops (which will
> happily erase it).
> 
> Signed-off-by: Simon Kagstrom <simon.kagstrom at netinsight.net>
> ---
>  drivers/mtd/Kconfig   |   13 +++++++++++++
>  drivers/mtd/mtdoops.c |   11 +++++++----
>  2 files changed, 20 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
> index ecf90f5..9a69af8 100644
> --- a/drivers/mtd/Kconfig
> +++ b/drivers/mtd/Kconfig
> @@ -315,6 +315,19 @@ config MTD_OOPS
>  	  To use, add console=ttyMTDx to the kernel command line,
>  	  where x is the MTD device number to use.
>  
> +config MTD_OOPS_MAX_MTD_SIZE
> +	int "Maximum MTD oops partition size (kbytes)"
> +	default 4096
> +	range 8 1048576
> +	depends on MTD_OOPS
> +	help
> +	  This parameter sets the maximum MTD partition size for use with
> +	  MTD oops. The default value is used as a safeguard against using
> +	  e.g., a root filesystem partition as a MTDoops device (in which
> +	  case it will be erased).
> +
> +	  No need to change unless you have a very large MTDoops partition.
> +
>  source "drivers/mtd/chips/Kconfig"

Could we please just make it hard limited to something like 64MiB in the
driver itself. This configuration option is not really needed. There are
not many users of this driver, and I do not think any of them would ever
need a big partition for mtdoops, so there is not reason to make things
more complex than they are by introducing this configuration option.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list