Re: hot scsi disk resize

James Bottomley
2003-03-17T16:21:41Z

On Tue, 2003-03-04 at 01:00, alexey@technomagesinc.com wrote:
> Here is new version of the patch. All procfs-related stuff has been removed.
> One may rescan device size writing something to /sysfs/.../<scsi device>/rescan:

I applied all of this, except this piece:

> diff -uNr linux/fs/block_dev.c edited/fs/block_dev.c
> --- 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);
> put_disk(disk);
> module_put(owner);
> if (bdev->bd_contains == bdev) {
>
>

Because adding this in will break the initial ramdisk. Thus, although
the SCSI layer does resize, the block layer may not.

I've copied Al Viro because he's more familiar with the block layer
device code than I and may have been planning to add this feature. Al,
can you tell us what needs to happen to allow for hot resizing a SCSI
disc?

Thanks,

James