aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas/mpt2sas_ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_ctl.c')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_ctl.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
index 14e473d1fa7b..c2a51018910f 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
@@ -1963,7 +1963,6 @@ _ctl_ioctl_main(struct file *file, unsigned int cmd, void __user *arg)
1963{ 1963{
1964 enum block_state state; 1964 enum block_state state;
1965 long ret = -EINVAL; 1965 long ret = -EINVAL;
1966 unsigned long flags;
1967 1966
1968 state = (file->f_flags & O_NONBLOCK) ? NON_BLOCKING : 1967 state = (file->f_flags & O_NONBLOCK) ? NON_BLOCKING :
1969 BLOCKING; 1968 BLOCKING;
@@ -1989,13 +1988,8 @@ _ctl_ioctl_main(struct file *file, unsigned int cmd, void __user *arg)
1989 !ioc) 1988 !ioc)
1990 return -ENODEV; 1989 return -ENODEV;
1991 1990
1992 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 1991 if (ioc->shost_recovery)
1993 if (ioc->shost_recovery) {
1994 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock,
1995 flags);
1996 return -EAGAIN; 1992 return -EAGAIN;
1997 }
1998 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
1999 1993
2000 if (_IOC_SIZE(cmd) == sizeof(struct mpt2_ioctl_command)) { 1994 if (_IOC_SIZE(cmd) == sizeof(struct mpt2_ioctl_command)) {
2001 uarg = arg; 1995 uarg = arg;
@@ -2098,7 +2092,6 @@ _ctl_compat_mpt_command(struct file *file, unsigned cmd, unsigned long arg)
2098 struct mpt2_ioctl_command karg; 2092 struct mpt2_ioctl_command karg;
2099 struct MPT2SAS_ADAPTER *ioc; 2093 struct MPT2SAS_ADAPTER *ioc;
2100 enum block_state state; 2094 enum block_state state;
2101 unsigned long flags;
2102 2095
2103 if (_IOC_SIZE(cmd) != sizeof(struct mpt2_ioctl_command32)) 2096 if (_IOC_SIZE(cmd) != sizeof(struct mpt2_ioctl_command32))
2104 return -EINVAL; 2097 return -EINVAL;
@@ -2113,13 +2106,8 @@ _ctl_compat_mpt_command(struct file *file, unsigned cmd, unsigned long arg)
2113 if (_ctl_verify_adapter(karg32.hdr.ioc_number, &ioc) == -1 || !ioc) 2106 if (_ctl_verify_adapter(karg32.hdr.ioc_number, &ioc) == -1 || !ioc)
2114 return -ENODEV; 2107 return -ENODEV;
2115 2108
2116 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 2109 if (ioc->shost_recovery)
2117 if (ioc->shost_recovery) {
2118 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock,
2119 flags);
2120 return -EAGAIN; 2110 return -EAGAIN;
2121 }
2122 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
2123 2111
2124 memset(&karg, 0, sizeof(struct mpt2_ioctl_command)); 2112 memset(&karg, 0, sizeof(struct mpt2_ioctl_command));
2125 karg.hdr.ioc_number = karg32.hdr.ioc_number; 2113 karg.hdr.ioc_number = karg32.hdr.ioc_number;