linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Mansfield <patmans@us.ibm.com>
To: Olaf Hering <olh@suse.de>, viro@zenII.linux.org.uk
Cc: linux-scsi@vger.kernel.org
Subject: Re: 2.6.11rc2 prints disksize twice
Date: Mon, 31 Jan 2005 09:05:46 -0800	[thread overview]
Message-ID: <20050131170546.GA29904@us.ibm.com> (raw)
In-Reply-To: <20050131121537.GA32111@suse.de>

On Mon, Jan 31, 2005 at 01:15:37PM +0100, Olaf Hering wrote:
> I think its not a functional problem,
> but parts of the disk detection is printed twice.

Yes ...

> ...
> SCSI device sdc: 71096640 512-byte hdwr sectors (36401 MB)
> SCSI device sdc: drive cache: write through
> SCSI device sdc: 71096640 512-byte hdwr sectors (36401 MB)
> SCSI device sdc: drive cache: write through
> ...
> 

I looked into it some, there was a change from Al to always set
bd_invalidated in register_disk(), and then to call blkdev_get. This means
the block_dev.c do_open will call rescan_partitions, and in turn call
revalidate_disk even for non-removable media.

This change:

http://linux.bkbits.net:8080/linux-2.5/diffs/fs/partitions/check.c@1.127?nav=index.html|src/|src/fs|src/fs/partitions|hist/fs/partitions/check.c

The log comment from Al says "Work around devices with bogus media change
indication on the first open".

Al - What did that fix? Why was that done in the generic block code, and
not the affected driver (multiple revalidate_disk call in the
driver on device discovery)? 

I tested this patch with scsi fixed and removable disks with no problems,
but it could break whatever Al fixed. Otherwise it should work with any
block driver that calls (for removable/modifiable media) check_disk_change
on open and that has a revalidate_disk function and the device is not
broken (it looks like that is the correct use of the two functions, I'm
not certain).

diff -uprN -X /home/patman/dontdiff linux-2.6.11-rc1/fs/partitions/check.c no-double-sd-linux-2.6.11-rc1/fs/partitions/check.c
--- linux-2.6.11-rc1/fs/partitions/check.c	Fri Dec 24 13:35:28 2004
+++ no-double-sd-linux-2.6.11-rc1/fs/partitions/check.c	Fri Jan 21 11:19:00 2005
@@ -375,8 +375,6 @@ int rescan_partitions(struct gendisk *di
 	bdev->bd_invalidated = 0;
 	for (p = 1; p < disk->minors; p++)
 		delete_partition(disk, p);
-	if (disk->fops->revalidate_disk)
-		disk->fops->revalidate_disk(disk);
 	if (!get_capacity(disk) || !(state = check_partition(disk, bdev)))
 		return 0;
 	for (p = 1; p < state->limit; p++) {

-- Patrick Mansfield

      reply	other threads:[~2005-01-31 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-31 12:15 2.6.11rc2 prints disksize twice Olaf Hering
2005-01-31 17:05 ` Patrick Mansfield [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=20050131170546.GA29904@us.ibm.com \
    --to=patmans@us.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=olh@suse.de \
    --cc=viro@zenII.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).