Re: [PATCH] fix 2.5 scsi queue depth setting

J.E.J. Bottomley
2002-11-06T17:15:28Z

In this block:

+int scsi_slave_attach(struct scsi_device *sdev)
+{
+ if (sdev->attached++ == 0) {
+ /*
+ * No one was attached.
+ */
+ if ((sdev->host->hostt->slave_attach != NULL) &&
+ (sdev->host->hostt->slave_attach(sdev) != 0)) {
+ printk(KERN_INFO "scsi: failed low level driver"
+ " attach, some SCSI device might not be"
+ " configured\n");
+ return 1;
+ }
+ if ((sdev->new_queue_depth == 0) &&
+ (sdev->host->cmd_per_lun != 0))
+ scsi_adjust_queue_depth(sdev, 0,
+ sdev->host->cmd_per_lun);
+ scsi_build_commandblocks(sdev);

I've a marginal preference for calling scsi_build_commandblocks first, so we
have a single command block going into the slave_attach (remember the adjust
queue depth stuff is deferred building of command blocks). That way, we can
error out if the current_queue_depth is still zero without having to do a
slave detach.

Other than that, this patch looks like an excellent solution. Thanks!

James