block,scsi,libata: implement alt_size
Subsystems (4)
PATCH 1/1 block,scsi,libata: implement alt_size
Hello,
This patchset implements alt_size, which is a size hint to the users of a block device. It's primarily to communicate the BIOS (HPA) size on ATA devices to userland, so that dmraid can consider it when trying to figure out BIOS raid layout. This is critical as dmraid can be tricked into assemblying the wrong raid when fed with the unlocked size and if the disk content is right (or, rather, wrong) and good number of distros are shipping with ignore_hpa=1 as default.
This patch contains the following three patches.
0001-block-add-alt_size.patch
0002-scsi-add-scsi_device-alt_capacity.patch
0003-libata-export-HPA-size-as-alt_size.patch
Without the above three patches, I get the following on my nv RAID-0 if HPA unlocking is turned on.
# ~/work/dmraid/tools/dmraid -a y
RAID set "nvidia_djgdjigi" was activated
# mount /dev/dm-0 /mnt/tmp mount: wrong fs type, bad option, bad superblock on /dev/dm-0, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so
With the above three patches and modified dmraid,
ck804:~/os/work/build # ~/work/dmraid/tools/dmraid -a y -v -v -v
...
NOTICE: /dev/sdb: using BIOS sectors 234439535
RAID set "nvidia_djgdjigi" was activated
...
ck804:~/os/work/build # mount /dev/dm-0 /mnt/tmp ck804:~/os/work/build # umount /dev/dm-0
Any ideas on through which tree this should be pushed? I'll post dmraid patches as a reply to this thread for reference.
Thanks.
This patchset is against the current linus#master[1] and contains the following changes.
block/genhd.c | 26 ++++++++++++++++++++++++++ drivers/ata/libata-core.c | 2 ++ drivers/ata/libata-scsi.c | 2 ++ drivers/scsi/sd.c | 1 + include/linux/genhd.h | 13 ++++++++++++- include/linux/libata.h | 1 + include/scsi/scsi_device.h | 1 + 7 files changed, 45 insertions(+), 1 deletion(-)
--
tejun
[1] 45c82b5a770be66845687a7d027c8b52946d59af
PATCH 1/3 block: add alt_size
ATA disks have two sizes - the user visible size and native size. The user visible size is usually used by the BIOS to hide certain area (e.g. recovery partition) or trim size for various reasons. IDE and libata can unlock these HPA areas and IDE does so by default and libata depending on kernel parameters (some distros default to unlock to maintain compatibility with IDE).
This usually doesn't matter but certain tools need to know what BIOS wants the disk to look like. For example, certain BIOS RAID formats put the metadata at the end of the disk where the 'end' is the trimmed size, so without knowing the BIOS size, dmraid can't work reliably if HPA is unlocked.
This patch adds alt_size to genhd and exports it via sysfs. alt_size is always smaller than the regular size. Being a hint, alt_size can also be set from userland by writing to the sysfs node mostly for debugging and testing. Because initialization order isn't enforced, the alt_size < size limitation is applied while getting the attribute.
--- block/genhd.c | 26 ++++++++++++++++++++++++++ include/linux/genhd.h | 13 ++++++++++++- 2 files changed, 38 insertions(+), 1 deletions(-)
block/genhd.c +26 -0
@@ -824,6 +824,29 @@ static ssize_t disk_ro_show(struct device *dev,return sprintf (buf,"%d\n" ,get_disk_ro (disk) ?1 :0 ); } +static ssize_t disk_alt_size_show (struct device *dev, +struct device_attribute *attr,char *buf) +{ +struct gendisk *disk =dev_to_disk (dev); + +return sprintf (buf,"%llu\n" , + (unsigned long long )get_alt_capacity (disk)); +} + +static ssize_t disk_alt_size_store (struct device *dev, +struct device_attribute *attr, +const char *buf,size_t count) +{ +struct gendisk *disk =dev_to_disk (dev); +sector_t new_size =simple_strtoull (buf,NULL ,0 ); + +set_alt_capacity (disk, new_size); + +if (get_alt_capacity (disk) == new_size) +return count; +return -EINVAL ; +} +static ssize_t disk_capability_show (struct device *dev,struct device_attribute *attr,char *buf) {
@@ -837,6 +860,8 @@ static DEVICE_ATTR(ext_range, S_IRUGO, disk_ext_range_show, NULL); static DEVICE_ATTR(removable, S_IRUGO, disk_removable_show, NULL); static DEVICE_ATTR(ro, S_IRUGO, disk_ro_show, NULL); static DEVICE_ATTR(size, S_IRUGO, part_size_show, NULL); +static DEVICE_ATTR(alt_size, S_IRUGO | S_IWUSR, disk_alt_size_show, + disk_alt_size_store); static DEVICE_ATTR(capability, S_IRUGO, disk_capability_show, NULL); static DEVICE_ATTR(stat, S_IRUGO, part_stat_show, NULL);#ifdef CONFIG_FAIL_MAKE_REQUEST
@@ -855,6 +880,7 @@ static struct attribute *disk_attrs[] = { &dev_attr_removable.attr, &dev_attr_ro.attr, &dev_attr_size.attr, + &dev_attr_alt_size.attr, &dev_attr_capability.attr, &dev_attr_stat.attr, #ifdef CONFIG_FAIL_MAKE_REQUEST
include/linux/genhd.h +12 -1
@@ -159,7 +159,8 @@ struct gendisk {struct timer_rand_state *random; -atomic_t sync_io;/* RAID */ +sector_t alt_nr_sects;/* alt sects, should be <= part0.sects */ +atomic_t sync_io;/* RAID */ struct work_struct async_notify;#ifdef CONFIG_BLK_DEV_INTEGRITY struct blk_integrity *integrity;
@@ -364,10 +365,20 @@ static inline sector_t get_capacity(struct gendisk *disk) {return disk->part0.nr_sects; } +static inline sector_t get_alt_capacity (struct gendisk *disk) +{ +if (disk->alt_nr_sects && disk->alt_nr_sects < disk->part0.nr_sects) +return disk->alt_nr_sects; +return 0 ; +}static inline void set_capacity (struct gendisk *disk,sector_t size) { disk->part0.nr_sects = size; } +static inline void set_alt_capacity (struct gendisk *disk,sector_t size) +{ + disk->alt_nr_sects = size; +}#ifdef CONFIG_SOLARIS_X86_PARTITION
Signature · 1 line
1.6.0.2
PATCH 2/3 scsi: add scsi_device->alt_capacity
In reply to Tejun HeoAdd scsi_device->alt_capacity and let sd pass it over to genhd. This is to allow SCSI low level drivers to configure alt_capacity via slave_configure().
--- drivers/scsi/sd.c | 1 + include/scsi/scsi_device.h | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
drivers/scsi/sd.c +1 -0
@@ -1751,6 +1751,7 @@ static int sd_revalidate_disk(struct gendisk *disk)blk_queue_ordered (sdkp->disk->queue, ordered, sd_prepare_flush);set_capacity (disk, sdkp->capacity); +set_alt_capacity (disk, sdp->alt_capacity);kfree (buffer); out:
include/scsi/scsi_device.h +1 -0
@@ -92,6 +92,7 @@ struct scsi_device {unsigned int manufacturer;/* Manufacturer of device, for using * vendor-specific cmd's */ unsigned sector_size;/* size in bytes */ +size_t alt_capacity;/* alternative capacity, used by sd */ void *hostdata;/* available to low-level driver */ char type;
Signature · 1 line
1.6.0.2
PATCH 3/3 libata: export HPA size as alt_size
In reply to Tejun HeoExport HPA size as alt_size so that userland tools which need the BIOS size can determine it.
--- drivers/ata/libata-core.c | 2 ++ drivers/ata/libata-scsi.c | 2 ++ include/linux/libata.h | 1 + 3 files changed, 5 insertions(+), 0 deletions(-)
drivers/ata/libata-core.c +2 -0
@@ -1537,6 +1537,8 @@ static int ata_hpa_resize(struct ata_device *dev) }/* let's unlock HPA */ + dev->alt_n_sectors = sectors; + rc =ata_set_max_sectors (dev, native_sectors);if (rc == -EACCES ) {/* if device aborted the command, skip HPA resizing */
drivers/ata/libata-scsi.c +2 -0
@@ -1104,6 +1104,8 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,blk_queue_update_dma_alignment (sdev->request_queue,ATA_SECT_SIZE -1 ); sdev->manage_start_stop =1 ; + + sdev->alt_capacity = dev->alt_n_sectors; }if (dev->flags &ATA_DFLAG_AN )
include/linux/libata.h +1 -0
@@ -582,6 +582,7 @@ struct ata_device {#endif /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ u64 n_sectors;/* size of device, if ATA */ +u64 alt_n_sectors;/* size bios wants us to see */ unsigned int class;/* ATA_DEV_xxx */ unsigned long unpark_deadline;
Signature · 1 line
1.6.0.2
PATCH 1/1 libata: change drive ready wait after hard reset to 5s
This fixes problems during resume with drives that take longer than 1s to be ready. The ATA-6 spec appears to allow 5 seconds for a drive to be ready.
On one affected system, this patch changes "PM: resume devices took..." message from 17 seconds to 4 seconds, and gets rid of a lot of ugly timeout/error messages.
Without this patch, the libata code moves on after 1s, tries to send a soft reset (which the drive doesn't see because it isn't ready) which also times out, then an IDENTIFY command is sent to the drive which times out, and finally the error handler will try to send another hard reset which will finally get things working.
Sorry to send as an attachment, but my mail server will wrap text.
include/linux/libata.h renamed from include/linux/libata.h.orig +1 -1
@@ -271,7 +271,7 @@ enum {* advised to wait only for the following duration before * doing SRST. */ -ATA_TMOUT_PMP_SRST_WAIT =1000 , +ATA_TMOUT_PMP_SRST_WAIT =5000 ,/* ATA bus states */ BUS_UNKNOWN = 0,
Re: [PATCH] libata: change drive ready wait after hard reset to 5s
I believe this is the reference that Stuart refers to in the ATA-6 spec:
http://www.t10.org/t13/project/d1410r3a-ATA-ATAPI-6.pdf
Here's the snippet, (p327):
"
Transition D0HR1:D0HR1: When the sample indicates that DASP- is negated
and less than 450 ms have
elapsed since the negation of RESET-, then the device shall make a
transition to the D0HR1: Sample_DASP-
state. When the sample indicates that DASP- is negated and greater than
450 ms but less than 5 s have
elapsed since the negation of RESET-, then the device may make a
transition to the D0HR1: Sample_DASP-
state.
Transition D0HR1:D0HR3: When the sample indicates that DASP- is negated and 5 s have elapsed since the
negation of RESET-, then the device shall clear bit 7 in the Error register and make a transition to the D0HR3:Set_status state. When the sample indicates that DASP- is negated and greater than 450 ms but less than 5 s
have elapsed since the negation of RESET-, then the device may clear bit 7 in the Error register and make a
transition to the D0HR3: Set_status state.
"
Quoted 20 lines · Stuart
This fixes problems during resume with drives that take longer than 1s to be ready. The ATA-6 spec appears to allow 5 seconds for a drive to be ready.
On one affected system, this patch changes "PM: resume devices took..." message from 17 seconds to 4 seconds, and gets rid of a lot of ugly timeout/error messages.
Without this patch, the libata code moves on after 1s, tries to send a soft reset (which the drive doesn't see because it isn't ready) which also times out, then an IDENTIFY command is sent to the drive which times out, and finally the error handler will try to send another hard reset which will finally get things working.
Sorry to send as an attachment, but my mail server will wrap text.
Signed-off-by Stuart Hayes <[email protected]>
Signature · 3 lines
Mario Limonciello *Dell | Linux Engineering* [email protected]
PATCH 1/1 libata: change drive ready wait after hard reset to 5s
In reply to [email protected]I'm re-sending this patch... I didn't get a response last time I sent this in a week ago. (Is there something wrong with it?) Thanks! ... Stuart
This fixes problems during resume with drives that take longer than 1s to be ready. The ATA-6 spec appears to allow 5 seconds for a drive to be ready.
On one affected system, this patch changes "PM: resume devices took..." message from 17 seconds to 4 seconds, and gets rid of a lot of ugly timeout/error messages.
Without this patch, the libata code moves on after 1s, tries to send a soft reset (which the drive doesn't see because it isn't ready) which also times out, then an IDENTIFY command is sent to the drive which times out, and finally the error handler will try to send another hard reset which will finally get things working.
Sorry to send as an attachment, but my mail server will wrap text.
include/linux/libata.h renamed from include/linux/libata.h.orig +1 -1
@@ -271,7 +271,7 @@ enum {* advised to wait only for the following duration before * doing SRST. */ -ATA_TMOUT_PMP_SRST_WAIT =1000 , +ATA_TMOUT_PMP_SRST_WAIT =5000 ,/* ATA bus states */ BUS_UNKNOWN = 0,
PATCH 1/1 dmraid: use alt_size
In reply to Tejun HeoHello again,
This patchset is for dmraid-1.0.0.rc15 and NOT for kernel. It contains the following three patches to make dmraid use alt_size if available.
0001-dmraid-set-read_info-to-offset-by-default-in-read_.patch 0002-dmraid-add-alt_size-to-dev_info.patch 0003-dmraid-make-nv-use-alt_size-if-available.patch
Thanks.
Signature · 1 line
tejun
PATCH 1/3 dmraid: set read_info to @offset by default in read_raid_dev()
read_info is passed from optional f_read_metatdata() to f_setup_rd(). If f_read_metadata() doesn't exist or doesn't initialize it, read_info contains garbage. Initialize it to @offset by default.
--- lib/format/format.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
lib/format/format.c +1 -1
@@ -435,7 +435,7 @@ read_raid_dev(struct lib_context *lc, {struct raid_dev *rd =NULL ;void *meta; -union read_info info; +union read_info info = { .u64 = offset };/* * In case the metadata format handler provides a special
Signature · 1 line
1.6.0.2
PATCH 2/3 dmraid: add alt_size to dev_info
In reply to Tejun HeoAdd alt_size to dev_info and set it during device scanning if available.
--- include/dmraid/metadata.h | 1 + lib/device/scan.c | 51 ++++++++++++++++++++++++++++++++------------ 2 files changed, 38 insertions(+), 14 deletions(-)
include/dmraid/metadata.h +1 -0
@@ -120,6 +120,7 @@ struct dev_info {char *path;/* Actual device node path. */ char *serial;/* ATA/SCSI serial number. */ uint64_t sectors;/* Device size. */ +uint64_t alt_sectors;/* Alternative device size. (BIOS size) */ };/* Metadata areas and size stored on a RAID device. */
lib/device/scan.c +37 -14
66 lines not on this page · raw message
Signature · 1 line
1.6.0.2
PATCH 3/3 dmraid: make nv use alt_size if available
In reply to Tejun Heonv puts metatdata at the end of a device, so it's important that dmraid and BIOS agree where the end of the device is. Later kernel exports the BIOS as via sysfs and it's available as di->alt_sectors. Use it if available.
--- lib/format/ataraid/nv.c | 15 +++++++++++---- lib/format/ataraid/nv.h | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-)
lib/format/ataraid/nv.c +11 -4
@@ -216,9 +216,16 @@ static int setup_rd(struct lib_context *lc, struct raid_dev *rd,static struct raid_dev *nv_read (struct lib_context *lc,struct dev_info *di) { -return read_raid_dev (lc, di,NULL , -sizeof (struct nv ),NV_CONFIGOFFSET , - to_cpu, is_nv,NULL , setup_rd, handler); +uint64_t sectors = di->alt_sectors ? di->alt_sectors : di->sectors; +struct raid_dev *rd; + + rd =read_raid_dev (lc, di,NULL ,sizeof (struct nv ), +NV_CONFIGOFFSET (sectors), + to_cpu, is_nv,NULL , setup_rd, handler); +if (rd && di->alt_sectors) +log_notice (lc,"%s: using BIOS sectors %" PRIu64, + di->path, di->alt_sectors); +return rd; }/* Write private RAID metadata to device */
@@ -427,7 +434,7 @@ setup_rd(struct lib_context *lc, struct raid_dev *rd,if (!(rd->meta_areas =alloc_meta_areas (lc, rd, handler,1 )))return 0 ; - rd->meta_areas->offset =NV_CONFIGOFFSET >>9 ; + rd->meta_areas->offset = info->u64 >>9 ; rd->meta_areas->size =sizeof (*nv); rd->meta_areas->area = (void *) nv;
lib/format/ataraid/nv.h +1 -1
@@ -23,7 +23,7 @@#include <stdint.h> -#define NV_CONFIGOFFSET ((di->sectors - 2) << 9) +#define NV_CONFIGOFFSET (sects) (((sects) - 2) << 9)#define NV_DATAOFFSET 0#define NV_ID_LENGTH 8
Signature · 1 line
1.6.0.2
PATCH 1/1 dmraid: use alt_size
In reply to Tejun HeoHello again,
This patchset is for dmraid-1.0.0.rc15 and NOT for kernel. It contains the following three patches to make dmraid use alt_size if available.
0001-dmraid-set-read_info-to-offset-by-default-in-read_.patch 0002-dmraid-add-alt_size-to-dev_info.patch 0003-dmraid-make-nv-use-alt_size-if-available.patch
Thanks.
Signature · 1 line
tejun
Quoted 29 lines · Tejun Heo
Hello,
This patchset implements
alt_size, which is a size hint to the users of a block device. It's primarily to communicate the BIOS (HPA) size on ATA devices to userland, so that dmraid can consider it when trying to figure out BIOS raid layout. This is critical as dmraid can be tricked into assemblying the wrong raid when fed with the unlocked size and if the disk content is right (or, rather, wrong) and good number of distros are shipping with ignore_hpa=1 as default.This patch contains the following three patches.
0001-block-add-alt_size.patch
0002-scsi-add-scsi_device-alt_capacity.patch
0003-libata-export-HPA-size-as-alt_size.patchWithout the above three patches, I get the following on my nv RAID-0 if HPA unlocking is turned on.
# ~/work/dmraid/tools/dmraid -a y
RAID set "nvidia_djgdjigi" was activated# mount /dev/dm-0 /mnt/tmp mount: wrong fs type, bad option, bad superblock on /dev/dm-0, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or soWith the above three patches and modified dmraid,
Quoted 7 lines
ck804:~/os/work/build # ~/work/dmraid/tools/dmraid -a y -v -v -v
...
NOTICE:/dev/sdb: using BIOS sectors 234439535
RAID set "nvidia_djgdjigi" was activated
...
ck804:~/os/work/build # mount/dev/dm-0/mnt/tmpck804:~/os/work/build # umount/dev/dm-0
But the net result is that you are telling dmraid that it is OK to proceed, even though part of the disk it wants is really missing. That seems unwise, because are you not basically proceeding with a known corrupt dataset at that point?
Jeff
Hello, Jeff.
Quoted 4 lines · Jeff Garzik
But the net result is that you are telling dmraid that it is OK to proceed, even though part of the disk it wants is really missing. That seems unwise, because are you not basically proceeding with a known corrupt dataset at that point?
Can you elaborate a bit? I don't really understand what you mean. To clarify...
* What happens now.
BIOS sets up HPA expecting the raid driver to look at the metadata which is at fixed offset from the end of the HPA locked size. dmraid doesn't know about it so looks at the wrong place. Results can be failed assembly or corrupt assembly depending on what's actually on the disk.
* With the patches applied.
BIOS does the same but libata tells dmraid the BIOS size. dmraid looks at the same offset as the BIOS and everything is well.
Thanks.
Signature · 1 line
tejun
Quoted 9 lines · Tejun Heo
Hello,
This patchset implements
alt_size, which is a size hint to the users of a block device. It's primarily to communicate the BIOS (HPA) size on ATA devices to userland, so that dmraid can consider it when trying to figure out BIOS raid layout. This is critical as dmraid can be tricked into assemblying the wrong raid when fed with the unlocked size and if the disk content is right (or, rather, wrong) and good number of distros are shipping with ignore_hpa=1 as default.
PING.
Signature · 1 line
tejun
Quoted 9 lines · Tejun Heo
Hello,
This patchset implements
alt_size, which is a size hint to the users of a block device. It's primarily to communicate the BIOS (HPA) size on ATA devices to userland, so that dmraid can consider it when trying to figure out BIOS raid layout. This is critical as dmraid can be tricked into assemblying the wrong raid when fed with the unlocked size and if the disk content is right (or, rather, wrong) and good number of distros are shipping with ignore_hpa=1 as default.
PING.
Signature · 1 line
tejun
Quoted 45 lines · Tejun Heo
Hello,
This patchset implements
alt_size, which is a size hint to the users of a block device. It's primarily to communicate the BIOS (HPA) size on ATA devices to userland, so that dmraid can consider it when trying to figure out BIOS raid layout. This is critical as dmraid can be tricked into assemblying the wrong raid when fed with the unlocked size and if the disk content is right (or, rather, wrong) and good number of distros are shipping with ignore_hpa=1 as default.This patch contains the following three patches.
0001-block-add-alt_size.patch
0002-scsi-add-scsi_device-alt_capacity.patch
0003-libata-export-HPA-size-as-alt_size.patchWithout the above three patches, I get the following on my nv RAID-0 if HPA unlocking is turned on.
# ~/work/dmraid/tools/dmraid -a y
RAID set "nvidia_djgdjigi" was activated# mount /dev/dm-0 /mnt/tmp mount: wrong fs type, bad option, bad superblock on /dev/dm-0, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or soWith the above three patches and modified dmraid,
ck804:~/os/work/build # ~/work/dmraid/tools/dmraid -a y -v -v -v
...
NOTICE:/dev/sdb: using BIOS sectors 234439535
RAID set "nvidia_djgdjigi" was activated
...
ck804:~/os/work/build # mount/dev/dm-0/mnt/tmpck804:~/os/work/build # umount/dev/dm-0Any ideas on through which tree this should be pushed? I'll post dmraid patches as a reply to this thread for reference.
Thanks.
This patchset is against the current linus#master[1] and contains the following changes.
Quoted 8 lines
block/genhd.c | 26 ++++++++++++++++++++++++++ drivers/ata/libata-core.c | 2 ++ drivers/ata/libata-scsi.c | 2 ++ drivers/scsi/sd.c | 1 + include/linux/genhd.h | 13 ++++++++++++- include/linux/libata.h | 1 + include/scsi/scsi_device.h | 1 + 7 files changed, 45 insertions(+), 1 deletion(-)
<shrug> I suppose...
It just seems like a nasty hack, but unfortunately I don't see anyone stepping up to do it properly -- with a DM device automatically layered on top that splits the device into separate regions: one block device for the 'regular' area, and one for the HPA.
Jeff
Hello,
Quoted 7 lines · Jeff Garzik
<shrug> I suppose...
It just seems like a nasty hack, but unfortunately I don't see anyone stepping up to do it properly -- with a DM device automatically layered on top that splits the device into separate
regions: one block device for the 'regular' area, and one for the HPA.
Isn't that more hacky? I don't know. All that dm needs to know is the location of the metadata which is located w.r.t. the end of the device which might be at a different location if BIOS tried to pull silly stunts. So, exporting the size BIOS might have used seems like a straight forward solution to me.
Thanks.
Signature · 1 line
tejun
Quoted 11 lines · Tejun Heo
Hello,
Quoted 7 lines · Jeff Garzik
<shrug> I suppose...
It just seems like a nasty hack, but unfortunately I don't see anyone stepping up to do it properly -- with a DM device automatically layered on top that splits the device into separate
regions: one block device for the 'regular' area, and one for the HPA.
Quoted 5 lines
Isn't that more hacky? I don't know. All that dm needs to know is the location of the metadata which is located w.r.t. the end of the device which might be at a different location if BIOS tried to pull silly stunts. So, exporting the size BIOS might have used seems like a straight forward solution to me.
"<shrug> I suppose" is basically a reluctant ack, in the absence of other solutions :)
Quoted 14 lines · Jeff Garzik
Quoted 13 lines · Tejun Heo
Hello,
Quoted 8 lines · Jeff Garzik
<shrug> I suppose...
It just seems like a nasty hack, but unfortunately I don't see anyone stepping up to do it properly -- with a DM device automatically layered on top that splits the device into separate
regions: one block device for the 'regular' area, and one for the HPA.
Quoted 9 lines
Quoted 5 lines
Isn't that more hacky? I don't know. All that dm needs to know is the location of the metadata which is located w.r.t. the end of the device which might be at a different location if BIOS tried to pull silly stunts. So, exporting the size BIOS might have used seems like a straight forward solution to me.
"<shrug> I suppose" is basically a reluctant ack, in the absence of other solutions :)
Couldn't the "fix" also just be a note to users to disable ignore_hpa if they notice that there raid arrays are not assembling correctly?
--
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 17 lines · Dan Williams
Quoted 16 lines · Jeff Garzik
Quoted 15 lines · Tejun Heo
Hello,
Quoted 7 lines · Jeff Garzik
<shrug> I suppose...
It just seems like a nasty hack, but unfortunately I don't see anyone stepping up to do it properly -- with a DM device automatically layered on top that splits the device into separate
regions: one block device for the 'regular' area, and one for the HPA.Isn't that more hacky? I don't know. All that dm needs to know is the location of the metadata which is located w.r.t. the end of the device which might be at a different location if BIOS tried to pull silly stunts. So, exporting the size BIOS might have used seems like a straight forward solution to me.
Quoted 6 lines
Quoted 3 lines
"<shrug> I suppose" is basically a reluctant ack, in the absence of other solutions :)
Couldn't the "fix" also just be a note to users to disable
ignore_hpaif they notice that there raid arrays are not assembling correctly?
I don't know. If it doesn't work automatically, the solution really isn't worth much. People generally don't (shouldn't need to) have any idea what HPA is. It basically boils down to "Linux doesn't support RAID". :-)
Maybe we should just put this issue to the rest and strongly advise people against BIOS raids.
Thanks.
Signature · 1 line
tejun
Quoted 10 lines · Tejun Heo
Quoted 2 lines
Couldn't the "fix" also just be a note to users to disable
ignore_hpaif they notice that there raid arrays are not assembling correctly?I don't know. If it doesn't work automatically, the solution really isn't worth much. People generally don't (shouldn't need to) have any idea what HPA is. It basically boils down to "Linux doesn't support RAID". :-)
Maybe we should just put this issue to the rest and strongly advise people against BIOS raids.
That's a bit too far :-). The real issue is that Linux is ignoring a property of the platform. To me ignoring HPA is like ignoring an e820 reserved memory region. You might be able to get away with it sometimes, but other times it breaks.
However, in the end I think having 'alt_size' available is a useful
mechanism for discovering and handling the ignore_hpa=1 case. The
policy about when to trust it can be left to userspace.
Thanks,
Dan
Hello,
Quoted 8 lines · Dan Williams
Quoted 7 lines · Tejun Heo
Quoted 2 lines
Couldn't the "fix" also just be a note to users to disable
ignore_hpaif they notice that there raid arrays are not assembling correctly?I don't know. If it doesn't work automatically, the solution really isn't worth much. People generally don't (shouldn't need to) have any idea what HPA is. It basically boils down to "Linux doesn't support RAID". :-)
Quoted 7 lines
Quoted 2 lines
Maybe we should just put this issue to the rest and strongly advise people against BIOS raids.
That's a bit too far :-). The real issue is that Linux is ignoring a property of the platform. To me ignoring HPA is like ignoring an e820 reserved memory region. You might be able to get away with it sometimes, but other times it breaks.
Well, somewhat but not quite. The difference is with backward compatibility and the fact that HPA has been used for many different creative ;-) purposes including working around BIOS limitations.
Quoted 3 lines
However, in the end I think having '
alt_size' available is a useful
mechanism for discovering and handling the ignore_hpa=1 case. The
policy about when to trust it can be left to userspace.
Pushing this in the kernel without updating dm-raid is kind of pointless. Who should I be poking to get the userland part moving?
Thanks.
Signature · 1 line
tejun
Quoted 2 lines · Tejun Heo
Pushing this in the kernel without updating dm-raid is kind of pointless. Who should I be poking to get the userland part moving?
Dmraid is not the only potential user. Mdadm will also care about this as I have seen a report that points to a user having what looks like an HPA issue with an Intel(R) Matrix array. So, there are two immediate users for this interface. Heinz is the right person to poke for dmraid updates. I'll handle the mdadm update.
Thanks,
Dan
Quoted 9 lines · Dan Williams
Quoted 2 lines · Tejun Heo
Pushing this in the kernel without updating dm-raid is kind of pointless. Who should I be poking to get the userland part moving?
Dmraid is not the only potential user. Mdadm will also care about this as I have seen a report that points to a user having what looks like an HPA issue with an Intel(R) Matrix array. So, there are two immediate users for this interface. Heinz is the right person to poke for dmraid updates. I'll handle the mdadm update.
Alright, then. With Jeff's reluctant ack and scheduled mdadm update, I guess this one can go upstream. I'll refresh the patchset and repost. Umm... BTW do I have Heinz's mail address right?
Thanks.
Signature · 1 line
tejun
Quoted 10 lines · Tejun Heo
Quoted 8 lines · Dan Williams
Quoted 2 lines · Tejun Heo
Pushing this in the kernel without updating dm-raid is kind of pointless. Who should I be poking to get the userland part moving?
Dmraid is not the only potential user. Mdadm will also care about this as I have seen a report that points to a user having what looks like an HPA issue with an Intel(R) Matrix array. So, there are two immediate users for this interface. Heinz is the right person to poke for dmraid updates. I'll handle the mdadm update.
Quoted 3 lines
Alright, then. With Jeff's reluctant ack and scheduled mdadm update, I guess this one can go upstream. I'll refresh the patchset and repost. Umm... BTW do I have Heinz's mail address right?
The email addr is correct according to dmraid-current.tar.bz2 (dated Sep 2008), at least. I don't have any better info.
Jeff
[ added [email protected] ]
Quoted 11 lines · Tejun Heo
Quoted 9 lines · Dan Williams
Quoted 2 lines · Tejun Heo
Pushing this in the kernel without updating dm-raid is kind of pointless. Who should I be poking to get the userland part moving?
Dmraid is not the only potential user. Mdadm will also care about this as I have seen a report that points to a user having what looks like an HPA issue with an Intel(R) Matrix array. So, there are two immediate users for this interface. Heinz is the right person to poke for dmraid updates. I'll handle the mdadm update.
Quoted 3 lines
Alright, then. With Jeff's reluctant ack and scheduled mdadm update, I guess this one can go upstream. I'll refresh the patchset and repost. Umm... BTW do I have Heinz's mail address right?
Heinz, here is the whole thread: