Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1222565
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | "Nicholas A. Bellinger" <nab@linux-iscsi.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH-v2 1/2] mpt3sas: Refcount sas_device objects and fix unsafe list usage |
| Date | Fri, 11 Sep 2015 09:00:01 +0200 |
| Message-ID | <q7qtr-2nR-3@gated-at.bofh.it> (permalink) |
| References | <q35QC-36a-9@gated-at.bofh.it> <q35QC-36a-11@gated-at.bofh.it> <q6pJ7-3l8-5@gated-at.bofh.it> <q6OHw-5QY-17@gated-at.bofh.it> <q6VJ0-7BX-9@gated-at.bofh.it> |
| X-Original-To | Chaitra Basappa <chaitra.basappa@avagotech.com> |
| Dkim-Signature | v=1; a=rsa-sha256; c=simple/simple; d=linux-iscsi.org; s=default.private; t=1441954170; bh=tDUTNUiGKB9RfTKql0tO0ffTbaM3XGK dL7haXiZOJd0=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To: References:Content-Type:Mime-Version:Content-Transfer-Encoding; b=yUc0ha0GI4WaeRqXuttp4Y2yw0PQahNj7e0oZLrMz11Sr6x22Ws1nHgW883eU12C3 zd1UjbzOHX+89Czlt2D33XAlV9/kqLi3qWTtRCQhO7rznapEUHoWSB8SAMxXtbuL16F rjv6nV2fd52iZS5pD6XEYpWXT7g7UYD+OtGLcDI= |
| Content-Type | text/plain; charset="UTF-8" |
| X-Mailer | Evolution 3.4.4-1 |
| MIME-Version | 1.0 |
| Content-Transfer-Encoding | 7bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 86 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Sreekanth Reddy <sreekanth.reddy@avagotech.com>, "Nicholas A. Bellinger" <nab@daterainc.com>, linux-scsi <linux-scsi@vger.kernel.org>, linux-kernel <linux-kernel@vger.kernel.org>, James Bottomley <James.Bottomley@hansenpartnership.com>, Calvin Owens <calvinowens@fb.com>, Christoph Hellwig <hch@infradead.org>, PDL-MPT-FUSIONLINUX <MPT-FusionLinux.pdl@avagotech.com>, kernel-team <kernel-team@fb.com> |
| X-Original-Date | Thu, 10 Sep 2015 23:55:37 -0700 |
| X-Original-Message-ID | <1441954537.21634.21.camel@haakon3.risingtidesystems.com> |
| X-Original-References | <1440921279-9973-1-git-send-email-nab@daterainc.com> <1440921279-9973-2-git-send-email-nab@daterainc.com> <CAK=zhgrTpxiiEbHCvLL09EhyLq+xAdteMU1Gzd3jPg9UGo=BDA@mail.gmail.com> <e0bde29b9384f924b2868cd81b7b1c8d@mail.gmail.com> <1441836181.6836.4.camel@haakon3.risingtidesystems.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1222565 |
Show key headers only | View raw
On Wed, 2015-09-09 at 15:03 -0700, Nicholas A. Bellinger wrote: > On Wed, 2015-09-09 at 19:59 +0530, Chaitra Basappa wrote: > > From: Sreekanth Reddy [mailto:sreekanth.reddy@avagotech.com] > > Sent: Tuesday, September 08, 2015 5:26 PM > > To: Nicholas A. Bellinger > > Cc: linux-scsi; linux-kernel; James Bottomley; Calvin Owens; Christoph > > Hellwig; MPT-FusionLinux.pdl; kernel-team; Nicholas Bellinger; Chaitra > > Basappa > > Subject: Re: [PATCH-v2 1/2] mpt3sas: Refcount sas_device objects and fix > > unsafe list usage > > > > On Sun, Aug 30, 2015 at 1:24 PM, Nicholas A. Bellinger <nab@daterainc.com> > > wrote: > > > From: Nicholas Bellinger <nab@linux-iscsi.org> > > > > > > These objects can be referenced concurrently throughout the driver, we > > > need a way to make sure threads can't delete them out from under each > > > other. This patch adds the refcount, and refactors the code to use it. > > > > > > Additionally, we cannot iterate over the sas_device_list without > > > holding the lock, or we risk corrupting random memory if items are > > > added or deleted as we iterate. This patch refactors > > > _scsih_probe_sas() to use the sas_device_list in a safe way. > > > > > > This patch is a port of Calvin's PATCH-v4 for mpt2sas code, atop > > > mpt3sas changes in scsi.git/for-next. > > > > > > Cc: Calvin Owens <calvinowens@fb.com> > > > Cc: Christoph Hellwig <hch@infradead.org> > > > Cc: Sreekanth Reddy <sreekanth.reddy@avagotech.com> > > > Cc: MPT-FusionLinux.pdl <MPT-FusionLinux.pdl@avagotech.com> > > > Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> > > > --- > > > drivers/scsi/mpt3sas/mpt3sas_base.h | 25 +- > > > drivers/scsi/mpt3sas/mpt3sas_scsih.c | 479 > > > +++++++++++++++++++++---------- > > > drivers/scsi/mpt3sas/mpt3sas_transport.c | 18 +- > > > 3 files changed, 364 insertions(+), 158 deletions(-) > > > > > > @@ -2763,7 +2874,7 @@ _scsih_block_io_device(struct MPT3SAS_ADAPTER *ioc, > > > u16 handle) > > > struct scsi_device *sdev; > > > struct _sas_device *sas_device; > > > > > > > [Sreekanth] Here sas_device_lock spin lock needs to be acquired before > > calling > > __mpt3sas_get_sdev_by_addr() function. > > > > [Chaitra]Here instead of calling " __mpt3sas_get_sdev_by_handle()" function > > calling > > "mpt3sas_get_sdev_by_handle()" function will fixes "invalid page access" > > type of kernel panic > > > > > - sas_device = _scsih_sas_device_find_by_handle(ioc, handle); > > > + sas_device = __mpt3sas_get_sdev_by_handle(ioc, handle); > > > if (!sas_device) > > > return; > > > > > Whoops, missed this comment in _scsih_block_io_device() from Sreekanth's > earlier reply. > > Here's the updated incremental patch atop target-pending/for-next-merge > to use the protected callers for both cases. > > Please review + ACK ASAP. The mpt3sas -v2 series + v4.3-rc0 breakage incremental patch here made it into linux-next-09102015, and at this point I don't see a scenario where keeping around the broken list_head dereferences makes sense. So that said, I'd like to send a target-pending/for-next-merge PULL request out to Linus in the next 48 hours. Any objections from Avago folks..? Thank you, --nab -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
RE: [PATCH-v2 1/2] mpt3sas: Refcount sas_device objects and fix unsafe list usage Chaitra Basappa <chaitra.basappa@avagotech.com> - 2015-09-09 16:40 +0200
Re: [PATCH-v2 1/2] mpt3sas: Refcount sas_device objects and fix unsafe list usage "Nicholas A. Bellinger" <nab@linux-iscsi.org> - 2015-09-10 00:10 +0200
Re: [PATCH-v2 1/2] mpt3sas: Refcount sas_device objects and fix unsafe list usage "Nicholas A. Bellinger" <nab@linux-iscsi.org> - 2015-09-11 09:00 +0200
Re: [PATCH-v2 1/2] mpt3sas: Refcount sas_device objects and fix unsafe list usage James Bottomley <James.Bottomley@HansenPartnership.com> - 2015-09-11 20:00 +0200
Re: [PATCH-v2 1/2] mpt3sas: Refcount sas_device objects and fix unsafe list usage "Nicholas A. Bellinger" <nab@linux-iscsi.org> - 2015-09-11 22:10 +0200
csiph-web