Home Home > GIT Browse > openSUSE-42.3
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2017-08-03 16:49:17 +0200
committerOliver Neukum <oneukum@suse.de>2017-08-03 16:49:17 +0200
commit29aaea1b4185d3dc203e7e89cae107e06e371f7f (patch)
tree7ffe188dd80e58905ea7933439f7942ce76b40d7
parentbb037964821a8c88d2400225b01a53e054f48a9d (diff)
parent9156c39bd92a327297caf80137748403055dcaf2 (diff)
Merge branch 'SLE12-SP3' into openSUSE-42.3rpm-4.4.79-4
-rw-r--r--drivers/scsi/scsi_scan.c5
-rw-r--r--drivers/scsi/scsi_sysfs.c8
-rw-r--r--drivers/scsi/scsi_transport_fc.c37
-rw-r--r--fs/nfs/file.c4
-rw-r--r--include/scsi/scsi_device.h3
-rw-r--r--include/scsi/scsi_transport_fc.h1
6 files changed, 21 insertions, 37 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index bd711a015e25..f9dec52c8e1a 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -391,11 +391,12 @@ static void scsi_target_reap_ref_release(struct kref *kref)
= container_of(kref, struct scsi_target, reap_ref);
/*
- * if we get here and the target is still in the CREATED state that
+ * if we get here and the target is still in a CREATED state that
* means it was allocated but never made visible (because a scan
* turned up no LUNs), so don't call device_del() on it.
*/
- if (starget->state != STARGET_CREATED) {
+ if ((starget->state != STARGET_CREATED) &&
+ (starget->state != STARGET_CREATED_REMOVE)) {
transport_remove_device(&starget->dev);
device_del(&starget->dev);
}
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 3a7340ed42a7..c1b95eeeb5ba 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1372,11 +1372,15 @@ restart:
spin_lock_irqsave(shost->host_lock, flags);
list_for_each_entry(starget, &shost->__targets, siblings) {
if (starget->state == STARGET_DEL ||
- starget->state == STARGET_REMOVE)
+ starget->state == STARGET_REMOVE ||
+ starget->state == STARGET_CREATED_REMOVE)
continue;
if (starget->dev.parent == dev || &starget->dev == dev) {
kref_get(&starget->reap_ref);
- starget->state = STARGET_REMOVE;
+ if (starget->state == STARGET_CREATED)
+ starget->state = STARGET_CREATED_REMOVE;
+ else
+ starget->state = STARGET_REMOVE;
spin_unlock_irqrestore(shost->host_lock, flags);
__scsi_remove_target(starget);
scsi_target_reap(starget);
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 05b3d4237fe2..9abd78457449 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -1624,9 +1624,7 @@ store_fc_private_host_tgtid_bind_type(struct device *dev,
&fc_host_rport_bindings(shost), peers);
list_del(&rport->peers);
rport->port_state = FC_PORTSTATE_DELETED;
- spin_unlock_irqrestore(shost->host_lock, flags);
fc_queue_work(shost, &rport->rport_delete_work);
- spin_lock_irqsave(shost->host_lock, flags);
}
spin_unlock_irqrestore(shost->host_lock, flags);
}
@@ -2452,9 +2450,7 @@ fc_remove_host(struct Scsi_Host *shost)
list_for_each_entry_safe(vport, next_vport, &fc_host->vports, peers) {
list_del(&vport->peers);
vport->flags |= FC_VPORT_DELETING;
- spin_unlock_irqrestore(shost->host_lock, flags);
fc_queue_work(shost, &vport->vport_delete_work);
- spin_lock_irqsave(shost->host_lock, flags);
}
/* Remove any remote ports */
@@ -2462,18 +2458,14 @@ fc_remove_host(struct Scsi_Host *shost)
&fc_host->rports, peers) {
list_del(&rport->peers);
rport->port_state = FC_PORTSTATE_DELETED;
- spin_unlock_irqrestore(shost->host_lock, flags);
fc_queue_work(shost, &rport->rport_delete_work);
- spin_lock_irqsave(shost->host_lock, flags);
}
list_for_each_entry_safe(rport, next_rport,
&fc_host->rport_bindings, peers) {
list_del(&rport->peers);
rport->port_state = FC_PORTSTATE_DELETED;
- spin_unlock_irqrestore(shost->host_lock, flags);
fc_queue_work(shost, &rport->rport_delete_work);
- spin_lock_irqsave(shost->host_lock, flags);
}
spin_unlock_irqrestore(shost->host_lock, flags);
@@ -2523,13 +2515,7 @@ fc_starget_delete(struct work_struct *work)
{
struct fc_rport *rport =
container_of(work, struct fc_rport, stgt_delete_work);
- struct Scsi_Host *shost = rport_to_shost(rport);
- unsigned long flags;
- spin_lock_irqsave(shost->host_lock, flags);
- rport->flags &= ~FC_RPORT_TGT_DELETE_PENDING;
- rport->scsi_target_id = -1;
- spin_unlock_irqrestore(shost->host_lock, flags);
fc_terminate_rport_io(rport);
scsi_remove_target(&rport->dev);
}
@@ -2560,13 +2546,6 @@ fc_rport_final_delete(struct work_struct *work)
scsi_flush_work(shost);
/*
- * if a target delete is pending, flush the SCSI host work_q
- * so that we don't race against it.
- */
- if (rport->flags & FC_RPORT_TGT_DELETE_PENDING)
- scsi_flush_work(shost);
-
- /*
* Cancel any outstanding timers. These should really exist
* only when rmmod'ing the LLDD and we're asking for
* immediate termination of the rports
@@ -2585,10 +2564,8 @@ fc_rport_final_delete(struct work_struct *work)
spin_unlock_irqrestore(shost->host_lock, flags);
/* Delete SCSI target and sdevs */
- if (rport->scsi_target_id != -1) {
- scsi_remove_target(&rport->dev);
- rport->scsi_target_id = -1;
- }
+ if (rport->scsi_target_id != -1)
+ fc_starget_delete(&rport->stgt_delete_work);
/*
* Notify the driver that the rport is now dead. The LLDD will
@@ -3163,7 +3140,6 @@ fc_timeout_deleted_rport(struct work_struct *work)
dev_printk(KERN_ERR, &rport->dev,
"blocked FC remote port time out: no longer"
" a FCP target, removing starget\n");
- rport->flags |= FC_RPORT_TGT_DELETE_PENDING;
spin_unlock_irqrestore(shost->host_lock, flags);
scsi_target_unblock(&rport->dev, SDEV_TRANSPORT_OFFLINE);
fc_queue_work(shost, &rport->stgt_delete_work);
@@ -3188,8 +3164,8 @@ fc_timeout_deleted_rport(struct work_struct *work)
"blocked FC remote port time out: removing"
" rport%s\n",
(rport->scsi_target_id != -1) ? " and starget" : "");
- spin_unlock_irqrestore(shost->host_lock, flags);
fc_queue_work(shost, &rport->rport_delete_work);
+ spin_unlock_irqrestore(shost->host_lock, flags);
return;
}
@@ -3250,13 +3226,12 @@ fc_timeout_deleted_rport(struct work_struct *work)
* all attached scsi devices.
*/
rport->flags |= FC_RPORT_DEVLOSS_CALLBK_DONE;
- rport->flags |= FC_RPORT_TGT_DELETE_PENDING;
- spin_unlock_irqrestore(shost->host_lock, flags);
fc_queue_work(shost, &rport->stgt_delete_work);
do_callback = 1;
- } else
- spin_unlock_irqrestore(shost->host_lock, flags);
+ }
+
+ spin_unlock_irqrestore(shost->host_lock, flags);
/*
* Notify the driver that the rport is now dead. The LLDD will
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 6e2df53f40e0..b63bb210f457 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -687,6 +687,8 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from)
if (result)
goto out;
}
+ if (iocb->ki_pos > i_size_read(inode))
+ nfs_revalidate_mapping(inode, file->f_mapping);
result = count;
if (!count)
@@ -817,7 +819,7 @@ do_setlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
*/
nfs_sync_mapping(filp->f_mapping);
if (!NFS_PROTO(inode)->have_delegation(inode, FMODE_READ))
- nfs_zap_mapping(inode, filp->f_mapping);
+ nfs_zap_caches(inode);
out:
return status;
}
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index bb2e2b9c9cab..f8c8779fbe9e 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -254,6 +254,9 @@ enum scsi_target_state {
STARGET_RUNNING,
STARGET_REMOVE,
STARGET_DEL,
+#ifndef __GENKSYMS__
+ STARGET_CREATED_REMOVE,
+#endif
};
/*
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index f247e7294ab7..9b5a77493bb5 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -368,7 +368,6 @@ struct fc_rport { /* aka fc_starget_attrs */
#define FC_RPORT_SCAN_PENDING 0x02
#define FC_RPORT_FAST_FAIL_TIMEDOUT 0x04
#define FC_RPORT_DEVLOSS_CALLBK_DONE 0x08
-#define FC_RPORT_TGT_DELETE_PENDING 0x10
#define dev_to_rport(d) \
container_of(d, struct fc_rport, dev)