public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: "Marc-André Hébert" <hebert.marcandre@gmail.com>
Cc: linux-mmc <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH] MMC: Fix the block device read only flag
Date: Mon, 31 Jan 2011 17:33:56 +0000	[thread overview]
Message-ID: <20110131173355.GB28016@void.printf.net> (raw)
In-Reply-To: <AANLkTin71fwTVtVY0j-VNPQpGRkwossvhN+28V=VV-pN@mail.gmail.com>

Hi,

On Mon, Jan 31, 2011 at 11:42:17AM -0500, Marc-André Hébert wrote:
> While the MMC handled the card's read only flag correctly on open,
> it did not setup the flag in the allocated disk structure. The
> consequence being that probing the /sys/class/block/mmcblkX/ro
> attribute always reported 0.
> 
> Signed-off-by: Marc-Andre Hebert <hebert.marcandre@gmail.com>
> ---
>  drivers/mmc/card/block.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index bfc8a8a..61d233a 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -621,6 +621,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct
> mmc_card *card)
>  	md->disk->private_data = md;
>  	md->disk->queue = md->queue.queue;
>  	md->disk->driverfs_dev = &card->dev;
> +	set_disk_ro(md->disk, md->read_only);
> 
>  	/*
>  	 * As discussed on lkml, GENHD_FL_REMOVABLE should:

Thanks very much, pushed to mmc-next and queued as a .38 fix.

(The patch was corrupt due to line-wrapping; something to fix for next
time.)
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

      reply	other threads:[~2011-01-31 17:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-31 16:42 [PATCH] MMC: Fix the block device read only flag Marc-André Hébert
2011-01-31 17:33 ` Chris Ball [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=20110131173355.GB28016@void.printf.net \
    --to=cjb@laptop.org \
    --cc=hebert.marcandre@gmail.com \
    --cc=linux-mmc@vger.kernel.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