public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Alex Tomas <bzzz@tmi.comex.ru>
Cc: linux-scsi@vger.kernel.org,
	James Bottomley <James.Bottomley@steeleye.com>,
	Jens Axboe <axboe@suse.de>
Subject: Re: hot scsi disk resize
Date: Mon, 3 Mar 2003 18:15:36 +0000	[thread overview]
Message-ID: <20030303181536.A30199@infradead.org> (raw)
In-Reply-To: <m3bs0s9xij.fsf@lexa.home.net>; from bzzz@tmi.comex.ru on Mon, Mar 03, 2003 at 08:21:24PM +0300

On Mon, Mar 03, 2003 at 08:21:24PM +0300, Alex Tomas wrote:
> +		if (err >= 0)
> +			err = length;
> +	} else if (!strncmp("rescan", buffer + 5, 6)) {
> +		p = buffer + 12;
> +
> +		host = simple_strtoul(p, &p, 0);
> +		channel = simple_strtoul(p + 1, &p, 0);
> +		id = simple_strtoul(p + 1, &p, 0);
> +		lun = simple_strtoul(p + 1, &p, 0);
> +		err = scsi_rescan_single_device(host, channel, id, lun);
> +		if (err >= 0)
> +			err = length;

Please don't add more procfs option.  A resize attribute for the
sysfs node of the scsi_device is the better choice in my opinion.

> +		buffer = kmalloc(512, GFP_DMA);
> +	else
> +		buffer = kmalloc(512, GFP_KERNEL);
> +
> +    	sd_read_capacity(sdkp, gd->disk_name, SRpnt, buffer);
> +	set_capacity(gd, sdkp->capacity);	
> +	scsi_release_request(SRpnt);
> +	kfree(buffer);

Don't you need some kind of serialization here?

> --- linux/fs/block_dev.c	Mon Jan 20 02:23:49 2003
> +++ edited/fs/block_dev.c	Mon Mar  3 18:49:47 2003
> @@ -623,6 +623,8 @@
>  			up(&whole->bd_sem);
>  		}
>  	} else {
> +		if (!part)
> +			bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);

This needs more explanation.


  reply	other threads:[~2003-03-03 18:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-03 17:21 hot scsi disk resize Alex Tomas
2003-03-03 18:15 ` Christoph Hellwig [this message]
2003-03-04  5:37   ` Alex Tomas
2003-03-04  7:00   ` alexey
2003-03-17 16:21     ` James Bottomley
2003-03-17 16:30       ` Christoph Hellwig
2003-03-04  9:31 ` Fabien Salvi
2003-03-04  9:42   ` alexey
2003-03-05 10:18     ` Fabien Salvi

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=20030303181536.A30199@infradead.org \
    --to=hch@infradead.org \
    --cc=James.Bottomley@steeleye.com \
    --cc=axboe@suse.de \
    --cc=bzzz@tmi.comex.ru \
    --cc=linux-scsi@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