diff for duplicates of <1495638636.2823.3.camel@sandisk.com> diff --git a/a/1.txt b/N1/1.txt index 02169d6..a8707e9 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -4,7 +4,7 @@ On Wed, 2017-05-24 at 07:51 +0200, Hannes Reinecke wrote: > > for the scsi_internal_device_unblock() calls from the mpt3sas driver > > because that driver can call scsi_internal_device_unblock() from > > atomic context. -> >=20 +> > > > Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> > > Cc: Christoph Hellwig <hch@lst.de> > > Cc: Hannes Reinecke <hare@suse.com> @@ -18,11 +18,10 @@ On Wed, 2017-05-24 at 07:51 +0200, Hannes Reinecke wrote: > > drivers/scsi/sd.c | 7 +++++-- > > include/scsi/scsi_device.h | 1 + > > 7 files changed, 66 insertions(+), 24 deletions(-) -> >=20 ->=20 +> > +> > [ .. ] -> > diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_tran= -sport_srp.c +> > diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c > > index 3c5d89852e9f..f617021c94f7 100644 > > --- a/drivers/scsi/scsi_transport_srp.c > > +++ b/drivers/scsi/scsi_transport_srp.c @@ -34,48 +33,46 @@ sport_srp.c > > - __shost_for_each_device(sdev, shost) > > + shost_for_each_device(sdev, shost) { > > + mutex_lock(&sdev->state_mutex); -> > if (sdev->sdev_state =3D=3D SDEV_OFFLINE) -> > sdev->sdev_state =3D SDEV_RUNNING; +> > if (sdev->sdev_state == SDEV_OFFLINE) +> > sdev->sdev_state = SDEV_RUNNING; > > - spin_unlock_irq(shost->host_lock); > > + mutex_unlock(&sdev->state_mutex); > > + } -> > } else if (rport->state =3D=3D SRP_RPORT_RUNNING) { +> > } else if (rport->state == SRP_RPORT_RUNNING) { > > /* > > * srp_reconnect_rport() has been invoked with fast_io_fail ->=20 +> > Why do you drop the host lock here? I thought that the host lock is > needed to protect shost_for_each_device()? Hello Hannes, -The only purpose of holding the host lock was to protect the SCSI device li= -st -iteration by __shost_for_each_device(). shost_for_each_device() obtains tha= -t +The only purpose of holding the host lock was to protect the SCSI device list +iteration by __shost_for_each_device(). shost_for_each_device() obtains that lock itself. From <scsi/scsi_device.h>: #define shost_for_each_device(sdev, shost) \ - for ((sdev) =3D __scsi_iterate_devices((shost), NULL); \ - =A0=A0=A0=A0=A0(sdev); \ - =A0=A0=A0=A0=A0(sdev) =3D __scsi_iterate_devices((shost), (sdev))) + for ((sdev) = __scsi_iterate_devices((shost), NULL); \ + (sdev); \ + (sdev) = __scsi_iterate_devices((shost), (sdev))) >From drivers/scsi/scsi.c: struct scsi_device *__scsi_iterate_devices(struct Scsi_Host *shost, - =A0=A0=A0struct scsi_device *prev) + struct scsi_device *prev) { - struct list_head *list =3D (prev ? &prev->siblings : &shost->__devices); - struct scsi_device *next =3D NULL; + struct list_head *list = (prev ? &prev->siblings : &shost->__devices); + struct scsi_device *next = NULL; unsigned long flags; spin_lock_irqsave(shost->host_lock, flags); - while (list->next !=3D &shost->__devices) { - next =3D list_entry(list->next, struct scsi_device, siblings); + while (list->next != &shost->__devices) { + next = list_entry(list->next, struct scsi_device, siblings); /* skip devices that we can't get a reference to */ if (!scsi_device_get(next)) break; - next =3D NULL; - list =3D list->next; + next = NULL; + list = list->next; } spin_unlock_irqrestore(shost->host_lock, flags); @@ -84,4 +81,4 @@ struct scsi_device *__scsi_iterate_devices(struct Scsi_Host *shost, return next; } -Bart.= +Bart. diff --git a/a/content_digest b/N1/content_digest index d8c86ce..63614ed 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -20,7 +20,7 @@ "> > for the scsi_internal_device_unblock() calls from the mpt3sas driver\n" "> > because that driver can call scsi_internal_device_unblock() from\n" "> > atomic context.\n" - "> >=20\n" + "> > \n" "> > Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>\n" "> > Cc: Christoph Hellwig <hch@lst.de>\n" "> > Cc: Hannes Reinecke <hare@suse.com>\n" @@ -34,11 +34,10 @@ "> > drivers/scsi/sd.c | 7 +++++--\n" "> > include/scsi/scsi_device.h | 1 +\n" "> > 7 files changed, 66 insertions(+), 24 deletions(-)\n" - "> >=20\n" - ">=20\n" + "> > \n" + "> \n" "> [ .. ]\n" - "> > diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_tran=\n" - "sport_srp.c\n" + "> > diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c\n" "> > index 3c5d89852e9f..f617021c94f7 100644\n" "> > --- a/drivers/scsi/scsi_transport_srp.c\n" "> > +++ b/drivers/scsi/scsi_transport_srp.c\n" @@ -50,48 +49,46 @@ "> > -\t\t__shost_for_each_device(sdev, shost)\n" "> > +\t\tshost_for_each_device(sdev, shost) {\n" "> > +\t\t\tmutex_lock(&sdev->state_mutex);\n" - "> > \t\t\tif (sdev->sdev_state =3D=3D SDEV_OFFLINE)\n" - "> > \t\t\t\tsdev->sdev_state =3D SDEV_RUNNING;\n" + "> > \t\t\tif (sdev->sdev_state == SDEV_OFFLINE)\n" + "> > \t\t\t\tsdev->sdev_state = SDEV_RUNNING;\n" "> > -\t\tspin_unlock_irq(shost->host_lock);\n" "> > +\t\t\tmutex_unlock(&sdev->state_mutex);\n" "> > +\t\t}\n" - "> > \t} else if (rport->state =3D=3D SRP_RPORT_RUNNING) {\n" + "> > \t} else if (rport->state == SRP_RPORT_RUNNING) {\n" "> > \t\t/*\n" "> > \t\t * srp_reconnect_rport() has been invoked with fast_io_fail\n" - ">=20\n" + "> \n" "> Why do you drop the host lock here? I thought that the host lock is\n" "> needed to protect shost_for_each_device()?\n" "\n" "Hello Hannes,\n" "\n" - "The only purpose of holding the host lock was to protect the SCSI device li=\n" - "st\n" - "iteration by __shost_for_each_device(). shost_for_each_device() obtains tha=\n" - "t\n" + "The only purpose of holding the host lock was to protect the SCSI device list\n" + "iteration by __shost_for_each_device(). shost_for_each_device() obtains that\n" "lock itself. From <scsi/scsi_device.h>:\n" "\n" "#define shost_for_each_device(sdev, shost) \\\n" - "\tfor ((sdev) =3D __scsi_iterate_devices((shost), NULL); \\\n" - "\t=A0=A0=A0=A0=A0(sdev); \\\n" - "\t=A0=A0=A0=A0=A0(sdev) =3D __scsi_iterate_devices((shost), (sdev)))\n" + "\tfor ((sdev) = __scsi_iterate_devices((shost), NULL); \\\n" + "\t\302\240\302\240\302\240\302\240\302\240(sdev); \\\n" + "\t\302\240\302\240\302\240\302\240\302\240(sdev) = __scsi_iterate_devices((shost), (sdev)))\n" "\n" ">From drivers/scsi/scsi.c:\n" "\n" "struct scsi_device *__scsi_iterate_devices(struct Scsi_Host *shost,\n" - "\t\t\t\t\t=A0=A0=A0struct scsi_device *prev)\n" + "\t\t\t\t\t\302\240\302\240\302\240struct scsi_device *prev)\n" "{\n" - "\tstruct list_head *list =3D (prev ? &prev->siblings : &shost->__devices);\n" - "\tstruct scsi_device *next =3D NULL;\n" + "\tstruct list_head *list = (prev ? &prev->siblings : &shost->__devices);\n" + "\tstruct scsi_device *next = NULL;\n" "\tunsigned long flags;\n" "\n" "\tspin_lock_irqsave(shost->host_lock, flags);\n" - "\twhile (list->next !=3D &shost->__devices) {\n" - "\t\tnext =3D list_entry(list->next, struct scsi_device, siblings);\n" + "\twhile (list->next != &shost->__devices) {\n" + "\t\tnext = list_entry(list->next, struct scsi_device, siblings);\n" "\t\t/* skip devices that we can't get a reference to */\n" "\t\tif (!scsi_device_get(next))\n" "\t\t\tbreak;\n" - "\t\tnext =3D NULL;\n" - "\t\tlist =3D list->next;\n" + "\t\tnext = NULL;\n" + "\t\tlist = list->next;\n" "\t}\n" "\tspin_unlock_irqrestore(shost->host_lock, flags);\n" "\n" @@ -100,6 +97,6 @@ "\treturn next;\n" "}\n" "\n" - Bart.= + Bart. -955c152877dfe1066930f4d2bf4089a8bdef296d8da2024276250e9b5d2b0a64 +bdb7952226a6b64b697e0a70485e0e5141045f7fbb32e19c917d7d757f84a279
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.