Re: [PATCH v2] nvme: fix multipath crash when ANA desactivated

2019-07-12 Thread Marta Rybczynska
- On 10 Jul, 2019, at 18:38, Christoph Hellwig h...@lst.de wrote: > On Wed, Jul 10, 2019 at 07:26:46AM +0200, Marta Rybczynska wrote: >> Christoph, why would you like to put the use_ana function in the header? >> It isn't used anywhere else outside of that file. > > nvme_ctrl_use_ana has a

Re: [PATCH v2] nvme: fix multipath crash when ANA desactivated

2019-07-10 Thread Christoph Hellwig
On Wed, Jul 10, 2019 at 07:26:46AM +0200, Marta Rybczynska wrote: > Christoph, why would you like to put the use_ana function in the header? > It isn't used anywhere else outside of that file. nvme_ctrl_use_ana has a single caller in core.c as well.

Re: [PATCH v2] nvme: fix multipath crash when ANA desactivated

2019-07-10 Thread Max Gurtovoy
On 7/10/2019 12:29 AM, Christoph Hellwig wrote: On Sat, Jul 06, 2019 at 01:06:44PM +0300, Max Gurtovoy wrote: + /* check if multipath is enabled and we have the capability */ + if (!multipath) + return 0; + if (!ctrl->subsys || ((ctrl->subsys->cmic & (1 << 3)) !

Re: [PATCH v2] nvme: fix multipath crash when ANA desactivated

2019-07-09 Thread Marta Rybczynska
- On 9 Jul, 2019, at 23:29, Christoph Hellwig h...@lst.de wrote: > On Sat, Jul 06, 2019 at 01:06:44PM +0300, Max Gurtovoy wrote: >>> + /* check if multipath is enabled and we have the capability */ >>> + if (!multipath) >>> + return 0; >>> + if (!ctrl->subsys || ((ctrl->subs

Re: [PATCH v2] nvme: fix multipath crash when ANA desactivated

2019-07-09 Thread Christoph Hellwig
On Sat, Jul 06, 2019 at 01:06:44PM +0300, Max Gurtovoy wrote: >> +/* check if multipath is enabled and we have the capability */ >> +if (!multipath) >> +return 0; >> +if (!ctrl->subsys || ((ctrl->subsys->cmic & (1 << 3)) != 0)) > > shouldn't it be: > > if (!ctrl->subsys || (

Re: [PATCH v2] nvme: fix multipath crash when ANA desactivated

2019-07-06 Thread Max Gurtovoy
On 7/5/2019 5:05 PM, Marta Rybczynska wrote: Fix a crash with multipath activated. It happends when ANA log page is larger than MDTS and because of that ANA is disabled. The driver then tries to access unallocated buffer when connecting to a nvme target. The signature is as follows: [ 300.433

[PATCH v2] nvme: fix multipath crash when ANA desactivated

2019-07-05 Thread Marta Rybczynska
Fix a crash with multipath activated. It happends when ANA log page is larger than MDTS and because of that ANA is disabled. The driver then tries to access unallocated buffer when connecting to a nvme target. The signature is as follows: [ 300.433586] nvme nvme0: ANA log page size (8208) larger