target: Fix divide by zero bug in fabric_max_sectors for unconfigured devices
authorNicholas Bellinger <nab@linux-iscsi.org>
Thu, 31 Jan 2013 23:05:48 +0000 (15:05 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 31 Jan 2013 23:22:53 +0000 (15:22 -0800)
This patch fixes a possible divide by zero bug when the fabric_max_sectors
device attribute is written and backend se_device failed to be successfully
configured -> enabled.

Go ahead and use block_size=512 within se_dev_set_fabric_max_sectors()
in the event of a target_configure_device() failure case, as no valid
dev->dev_attrib.block_size value will have been setup yet.

Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_device.c

Simple merge