All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evgeny Stambulchik <Evgeny.Stambulchik@weizmann.ac.il>
To: jonathan@jonmasters.org
Cc: Rob Landley <rob@landley.net>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix floppy.c to store correct ro/rw status in underlying gendisk
Date: Mon, 31 Oct 2005 13:57:07 +0200	[thread overview]
Message-ID: <43660693.6040601@weizmann.ac.il> (raw)
In-Reply-To: <35fb2e590510291035n297aa22cv303ae77baeb5c213@mail.gmail.com>

Jon Masters wrote:

> Let me know if this fixes it for you - should bomb out now if you try.
> The error isn't the cleanest (blame mount), but it does fail.

This works fine, thanks! For what it worth, though, mount -o remount,rw 
says remounting read-only yet still returns success. (Opposite to 
busybox, which now says "Permission denied" - rather misleading, but at 
least it fails).

My question is, shouldn't it be implemented at a more generic level? 
Floppy is just one example. Others are all kind of USB storage, ZIP/Jazz 
drives, and even normal SCSI disks (which have a RO jumper - at least 
some of them do).

I got an ancient USB disk on key with a write-protection switch. When I 
plug it in in the RO mode, everything goes exactly as it was (before 
your patch) with floppy. Now something interesting:
1. The thingy is plugged in RW and mounted
2. While connected, I switch it to RO
   dmesg says:
   -> SCSI device sda: 129024 512-byte hdwr sectors (66 MB)
   -> sda: Write Protect is on
   -> sda: Mode Sense: 03 00 80 00
   -> sda: assuming drive cache: write through
3.
# mount -o remount,rw  /mnt
mount: block device /dev/sda1 is write-protected, mounting read-only
# echo $?
0

So it seems there is some layer in bd which does know about RO status 
(and furthermore it's set by hot events)?

Regards,

Evgeny

  parent reply	other threads:[~2005-10-31 11:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-29 17:25 [PATCH] fix floppy.c to store correct ro/rw status in underlying gendisk Jon Masters
     [not found] ` <35fb2e590510291035n297aa22cv303ae77baeb5c213@mail.gmail.com>
2005-10-31 11:57   ` Evgeny Stambulchik [this message]
2005-10-31 15:58     ` Jon Masters
2005-10-31 23:17     ` Rob Landley
2005-11-01  2:36       ` Jon Masters
2005-11-01  7:21         ` Rob Landley
2005-11-01 13:53       ` Evgeny Stambulchik
2005-11-01 17:32         ` Rob Landley

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=43660693.6040601@weizmann.ac.il \
    --to=evgeny.stambulchik@weizmann.ac.il \
    --cc=jonathan@jonmasters.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob@landley.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.