[RFC PATCH 5/9] tcmu: fix tcmu_dev_configured check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We cannot use the uio_dev existence check to test if the
device has been configured. If uio_register_device succeeds
then it will be set even if we later fail in tcmu_netlink_event
and call uio_unregister_device.

Signed-off-by: Mike Christie <mchristi@xxxxxxxxxx>
---
 drivers/target/target_core_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index f1062ac..9f133ee 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -1524,7 +1524,7 @@ static int tcmu_check_and_free_pending_cmd(struct tcmu_cmd *cmd)
 
 static bool tcmu_dev_configured(struct tcmu_dev *udev)
 {
-	return udev->uio_info.uio_dev ? true : false;
+	return udev->se_dev.dev_flags & DF_CONFIGURED;
 }
 
 static void tcmu_blocks_release(struct tcmu_dev *udev)
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux