Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2017-12-13 14:25:31 +0100
committerHannes Reinecke <hare@suse.de>2017-12-13 14:25:31 +0100
commitd412065ffebb697ff652206dacba476d0486c18c (patch)
treeda1d292bdf6181eb7537e31ce13beed12cefb665
parent11152c71af9784066ac127aa70feb8fba4735d03 (diff)
scsi: check for device state in __scsi_remove_target()rpm-4.4.103-6.33
(bsc#1072589). suse-commit: e430cfcd4b1b46cfce183bf09d17c18d317daadf
-rw-r--r--drivers/scsi/scsi_sysfs.c5
-rw-r--r--include/linux/mbcache.h52
2 files changed, 4 insertions, 53 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 995539f6d70d..e176c7d3d469 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1343,7 +1343,10 @@ static void __scsi_remove_target(struct scsi_target *starget)
* check.
*/
if (sdev->channel != starget->channel ||
- sdev->id != starget->id ||
+ sdev->id != starget->id)
+ continue;
+ if (sdev->sdev_state == SDEV_DEL ||
+ sdev->sdev_state == SDEV_CANCEL ||
!get_device(&sdev->sdev_gendev))
continue;
spin_unlock_irqrestore(shost->host_lock, flags);
diff --git a/include/linux/mbcache.h b/include/linux/mbcache.h
deleted file mode 100644
index 86c9a8b480c5..000000000000
--- a/include/linux/mbcache.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef _LINUX_MBCACHE_H
-#define _LINUX_MBCACHE_H
-
-#include <linux/hash.h>
-#include <linux/list_bl.h>
-#include <linux/list.h>
-#include <linux/atomic.h>
-#include <linux/fs.h>
-
-struct mb_cache;
-
-struct mb_cache_entry {
- /* List of entries in cache - protected by cache->c_list_lock */
- struct list_head e_list;
- /* Hash table list - protected by hash chain bitlock */
- struct hlist_bl_node e_hash_list;
- atomic_t e_refcnt;
- /* Key in hash - stable during lifetime of the entry */
- u32 e_key;
- u32 e_referenced:1;
- u32 e_reusable:1;
- /* Block number of hashed block - stable during lifetime of the entry */
- sector_t e_block;
-};
-
-struct mb_cache *mb_cache_create(int bucket_bits);
-void mb_cache_destroy(struct mb_cache *cache);
-
-int mb_cache_entry_create(struct mb_cache *cache, gfp_t mask, u32 key,
- sector_t block, bool reusable);
-void __mb_cache_entry_free(struct mb_cache_entry *entry);
-static inline int mb_cache_entry_put(struct mb_cache *cache,
- struct mb_cache_entry *entry)
-{
- if (!atomic_dec_and_test(&entry->e_refcnt))
- return 0;
- __mb_cache_entry_free(entry);
- return 1;
-}
-
-void mb_cache_entry_delete_block(struct mb_cache *cache, u32 key,
- sector_t block);
-struct mb_cache_entry *mb_cache_entry_get(struct mb_cache *cache, u32 key,
- sector_t block);
-struct mb_cache_entry *mb_cache_entry_find_first(struct mb_cache *cache,
- u32 key);
-struct mb_cache_entry *mb_cache_entry_find_next(struct mb_cache *cache,
- struct mb_cache_entry *entry);
-void mb_cache_entry_touch(struct mb_cache *cache,
- struct mb_cache_entry *entry);
-
-#endif /* _LINUX_MBCACHE_H */