Message ID | 1437602898-15229-3-git-send-email-sbaugh@catern.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Jul 22, 2015 at 03:08:17PM -0700, Spencer Baugh wrote: > done: > + /* > + * If no real LUNs are accessible, report an allocation length > + * of 1 LUN to account for virtual LUN 0. > + */ > + if (lun_count == 0) > + lun_count = 1; > + Shouldn't the code actually report the virtual lun zero instead of just accounting for it? -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c index 87d4adb..d8a32e5 100644 --- a/drivers/target/target_core_spc.c +++ b/drivers/target/target_core_spc.c @@ -1241,6 +1241,13 @@ sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd) * See SPC3 r07, page 159. */ done: + /* + * If no real LUNs are accessible, report an allocation length + * of 1 LUN to account for virtual LUN 0. + */ + if (lun_count == 0) + lun_count = 1; + lun_count *= 8; buf[0] = ((lun_count >> 24) & 0xff); buf[1] = ((lun_count >> 16) & 0xff);