public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Don't register integrity profile for disabled disks
@ 2008-08-06 18:08 Martin K. Petersen
  2008-08-06 18:17 ` James Bottomley
  0 siblings, 1 reply; 3+ messages in thread
From: Martin K. Petersen @ 2008-08-06 18:08 UTC (permalink / raw)
  To: linux-scsi, James.Bottomley


Avoid registering a block integrity profile if the disk has been
disabled earlier in the probe process.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

---

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1875,7 +1876,8 @@ static int sd_probe(struct device *dev)
 
 	dev_set_drvdata(dev, sdkp);
 	add_disk(gd);
-	sd_dif_config_host(sdkp);
+	if (sdkp->capacity > 0)
+		sd_dif_config_host(sdkp);
 
 	sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n",
 		  sdp->removable ? "removable " : "");


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Don't register integrity profile for disabled disks
  2008-08-06 18:08 [PATCH] Don't register integrity profile for disabled disks Martin K. Petersen
@ 2008-08-06 18:17 ` James Bottomley
  2008-08-06 18:46   ` Martin K. Petersen
  0 siblings, 1 reply; 3+ messages in thread
From: James Bottomley @ 2008-08-06 18:17 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: linux-scsi

On Wed, 2008-08-06 at 14:08 -0400, Martin K. Petersen wrote:
> Avoid registering a block integrity profile if the disk has been
> disabled earlier in the probe process.

This is a possible thing to have happen for devices with SCSI-2
reservations ... and that's not a permanenet condition.  When the
reservation is released, tools usually do a BLKRRPART, but that won't
pick up the DIF information ... perhaps this should be in
sd_revalidate_disk?

James



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Don't register integrity profile for disabled disks
  2008-08-06 18:17 ` James Bottomley
@ 2008-08-06 18:46   ` Martin K. Petersen
  0 siblings, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2008-08-06 18:46 UTC (permalink / raw)
  To: James Bottomley; +Cc: Martin K. Petersen, linux-scsi

>>>>> "James" == James Bottomley <James.Bottomley@HansenPartnership.com> writes:

James> This is a possible thing to have happen for devices with SCSI-2
James> reservations ... and that's not a permanenet condition.  When
James> the reservation is released, tools usually do a BLKRRPART, but
James> that won't pick up the DIF information ... perhaps this should
James> be in sd_revalidate_disk?

sd_revalidate_disk can be called before the gendisk exists so I can't
register the profile from there.  At one point I tried shuffling
add_disk and revalidate in sd_probe but that caused problems with
sysfs.

I haven't tried reordering since the SCSI sysfs revamp.  I'll try that
out so just drop the patch for now.  It's mostly cosmetic anyway.

-- 
Martin K. Petersen	Oracle Linux Engineering


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-06 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-06 18:08 [PATCH] Don't register integrity profile for disabled disks Martin K. Petersen
2008-08-06 18:17 ` James Bottomley
2008-08-06 18:46   ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox