From: Andrew Morton <akpm@linux-foundation.org>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: linux-mmc@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
504391@bugs.debian.org,
Wouter van Heyst <larstiq@larstiq.dyndns.org>,
Pierre Ossman <pierre@ossman.eu>
Subject: Re: [PATCH] mmc: add module parameter to set whether cards are assumed removable
Date: Mon, 16 Nov 2009 12:23:29 -0800 [thread overview]
Message-ID: <20091116122329.847916b6.akpm@linux-foundation.org> (raw)
In-Reply-To: <1257914676.2237.57.camel@localhost>
On Wed, 11 Nov 2009 04:44:36 +0000
Ben Hutchings <ben@decadent.org.uk> wrote:
> Some people run general-purpose distribution kernels on netbooks with
> a card that is physically non-removable or logically non-removable
> (e.g. used for /home) and cannot be cleanly unmounted during suspend.
> Add a module parameter to set whether cards are assumed removable or
> non-removable, with the default set by CONFIG_MMC_UNSAFE_RESUME.
>
The description really doesn't give me enough info to work out what's
happening here and why this is being proposed. But it smells nasty.
> index ab37a6d..bb22ffd 100644
> --- a/drivers/mmc/core/Kconfig
> +++ b/drivers/mmc/core/Kconfig
> @@ -3,7 +3,7 @@
> #
>
> config MMC_UNSAFE_RESUME
> - bool "Allow unsafe resume (DANGEROUS)"
> + bool "Assume MMC/SD cards are non-removable (DANGEROUS)"
> help
> If you say Y here, the MMC layer will assume that all cards
> stayed in their respective slots during the suspend. The
> @@ -14,3 +14,5 @@ config MMC_UNSAFE_RESUME
> This option is usually just for embedded systems which use
> a MMC/SD card for rootfs. Most people should say N here.
>
> + This option sets a default which can be overridden by the
> + module parameter "removable=0" or "removable=1".
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index d98b0e2..010c964 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -48,6 +48,22 @@ int use_spi_crc = 1;
> module_param(use_spi_crc, bool, 0);
>
> /*
> + * We normally treat cards as removed during suspend if they are not
> + * known to be on a non-removable bus, to avoid the risk of writing
> + * back data to a different card after resume. Allow this to be
> + * overridden if necessary.
> + */
So we have a module parameter which nobody knows about. If they don't
set this parameter which they don't know about, the kernel will trash
their filesystem??
> +#ifdef CONFIG_MMC_UNSAFE_RESUME
> +int mmc_assume_removable;
> +#else
> +int mmc_assume_removable = 1;
> +#endif
> +module_param_named(removable, mmc_assume_removable, bool, 0644);
> +MODULE_PARM_DESC(
> + removable,
> + "MMC/SD cards are removable and may be removed during suspend");
> +
next prev parent reply other threads:[~2009-11-16 20:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-11 4:44 [PATCH] mmc: add module parameter to set whether cards are assumed removable Ben Hutchings
2009-11-16 20:23 ` Andrew Morton [this message]
2009-11-16 22:31 ` Ben Hutchings
2009-11-17 7:53 ` Stefan Richter
2009-11-30 12:39 ` Pierre Ossman
2009-11-30 12:54 ` Alan Cox
2009-11-30 13:09 ` Pierre Ossman
2009-11-30 13:32 ` Maxim Levitsky
2009-11-30 13:51 ` Alan Cox
2009-11-30 15:27 ` Maxim Levitsky
2009-11-22 11:42 ` Bug#504391: " Wouter van Heyst
2009-11-22 12:32 ` Ben Hutchings
2009-12-01 19:57 ` Wouter van Heyst
2009-11-30 12:38 ` Adrian Hunter
2009-11-30 12:48 ` Alan Cox
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=20091116122329.847916b6.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=504391@bugs.debian.org \
--cc=ben@decadent.org.uk \
--cc=larstiq@larstiq.dyndns.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=pierre@ossman.eu \
/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