Skip to content

Commit 3b5d535

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Two core changes and the rest in drivers, one core change to quirk the behaviour of the Iomega Zip drive and one to fix a hang caused by tag reallocation problems, which has mostly been seen by the iscsi client. Note the latter fixes the problem but still has a slight sysfs memory leak, so will be amended in the next pull request (once we've run the fix for the fix through our testing)" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: target: Fix recursive locking in __configfs_open_file() scsi: devinfo: Add BLIST_SKIP_IO_HINTS for Iomega ZIP scsi: mpi3mr: Clear reset history on ready and recheck state after timeout scsi: core: Fix refcount leak for tagset_refcnt
2 parents fb07430 + 14d4ac1 commit 3b5d535

4 files changed

Lines changed: 18 additions & 10 deletions

File tree

drivers/scsi/mpi3mr/mpi3mr_fw.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,7 @@ static int mpi3mr_bring_ioc_ready(struct mpi3mr_ioc *mrioc)
16181618
ioc_info(mrioc,
16191619
"successfully transitioned to %s state\n",
16201620
mpi3mr_iocstate_name(ioc_state));
1621+
mpi3mr_clear_reset_history(mrioc);
16211622
return 0;
16221623
}
16231624
ioc_status = readl(&mrioc->sysif_regs->ioc_status);
@@ -1637,6 +1638,15 @@ static int mpi3mr_bring_ioc_ready(struct mpi3mr_ioc *mrioc)
16371638
elapsed_time_sec = jiffies_to_msecs(jiffies - start_time)/1000;
16381639
} while (elapsed_time_sec < mrioc->ready_timeout);
16391640

1641+
ioc_state = mpi3mr_get_iocstate(mrioc);
1642+
if (ioc_state == MRIOC_STATE_READY) {
1643+
ioc_info(mrioc,
1644+
"successfully transitioned to %s state after %llu seconds\n",
1645+
mpi3mr_iocstate_name(ioc_state), elapsed_time_sec);
1646+
mpi3mr_clear_reset_history(mrioc);
1647+
return 0;
1648+
}
1649+
16401650
out_failed:
16411651
elapsed_time_sec = jiffies_to_msecs(jiffies - start_time)/1000;
16421652
if ((retry < 2) && (elapsed_time_sec < (mrioc->ready_timeout - 60))) {

drivers/scsi/scsi_devinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ static struct {
190190
{"IBM", "2076", NULL, BLIST_NO_VPD_SIZE},
191191
{"IBM", "2105", NULL, BLIST_RETRY_HWERROR},
192192
{"iomega", "jaz 1GB", "J.86", BLIST_NOTQ | BLIST_NOLUN},
193-
{"IOMEGA", "ZIP", NULL, BLIST_NOTQ | BLIST_NOLUN},
193+
{"IOMEGA", "ZIP", NULL, BLIST_NOTQ | BLIST_NOLUN | BLIST_SKIP_IO_HINTS},
194194
{"IOMEGA", "Io20S *F", NULL, BLIST_KEY},
195195
{"INSITE", "Floptical F*8I", NULL, BLIST_KEY},
196196
{"INSITE", "I325VM", NULL, BLIST_KEY},

drivers/scsi/scsi_scan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
361361
* since we use this queue depth most of times.
362362
*/
363363
if (scsi_realloc_sdev_budget_map(sdev, depth)) {
364+
kref_put(&sdev->host->tagset_refcnt, scsi_mq_free_tags);
364365
put_device(&starget->dev);
365366
kfree(sdev);
366367
goto out;

drivers/target/target_core_configfs.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ static ssize_t target_core_item_dbroot_store(struct config_item *item,
108108
const char *page, size_t count)
109109
{
110110
ssize_t read_bytes;
111-
struct file *fp;
112111
ssize_t r = -EINVAL;
112+
struct path path = {};
113113

114114
mutex_lock(&target_devices_lock);
115115
if (target_devices) {
@@ -131,17 +131,14 @@ static ssize_t target_core_item_dbroot_store(struct config_item *item,
131131
db_root_stage[read_bytes - 1] = '\0';
132132

133133
/* validate new db root before accepting it */
134-
fp = filp_open(db_root_stage, O_RDONLY, 0);
135-
if (IS_ERR(fp)) {
134+
r = kern_path(db_root_stage, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &path);
135+
if (r) {
136136
pr_err("db_root: cannot open: %s\n", db_root_stage);
137+
if (r == -ENOTDIR)
138+
pr_err("db_root: not a directory: %s\n", db_root_stage);
137139
goto unlock;
138140
}
139-
if (!S_ISDIR(file_inode(fp)->i_mode)) {
140-
filp_close(fp, NULL);
141-
pr_err("db_root: not a directory: %s\n", db_root_stage);
142-
goto unlock;
143-
}
144-
filp_close(fp, NULL);
141+
path_put(&path);
145142

146143
strscpy(db_root, db_root_stage);
147144
pr_debug("Target_Core_ConfigFS: db_root set to %s\n", db_root);

0 commit comments

Comments
 (0)