block: do not deliver removed device information 43/104743/1
authortaeyoung <ty317.kim@samsung.com>
Wed, 14 Dec 2016 07:48:16 +0000 (16:48 +0900)
committertaeyoung <ty317.kim@samsung.com>
Wed, 14 Dec 2016 07:48:16 +0000 (16:48 +0900)
Previously, removed flag was not checked when
a certian device info is delivered. Thus apps
got the removed device information. Now, removed
flag is checked and thus removed device information
is not delivered to app anymore.

Change-Id: I36ed129ae0f92f76e682de27b98c59f3ecdcd38d
Signed-off-by: taeyoung <ty317.kim@samsung.com>
src/block/block.c

index 6f6acca..8468ddf 100644 (file)
@@ -780,6 +780,8 @@ static struct block_device *find_block_device_by_id(int id)
                DD_LIST_FOREACH(th_manager[i].block_dev_list, elem, bdev) {
                        if (!bdev->data)
                                continue;
+                       if (bdev->removed)
+                               continue;
                        if (bdev->data->id == id) {
                                pthread_mutex_unlock(&(th_manager[i].mutex));
                                return bdev;