On (04/03/17 14:17), Minchan Kim wrote: > Johannes Thumshirn reported system goes the panic when using NVMe over > Fabrics loopback target with zram. > > The reason is zram expects each bvec in bio contains a single page > but nvme can attach a huge bulk of pages attached to the bio's bvec > so that zram's index arithmetic could be wrong so that out-of-bound > access makes panic. > > It can be solved by limiting max_sectors with SECTORS_PER_PAGE like > [1] but it makes zram slow because bio should split with each pages > so this patch makes zram aware of multiple pages in a bvec so it > could solve without any regression. > > [1] 0bc315381fe9, zram: set physical queue limits to avoid array out of > bounds accesses > > Cc: Jens Axboe <[email protected]> > Cc: Hannes Reinecke <[email protected]> > Reported-by: Johannes Thumshirn <[email protected]> > Tested-by: Johannes Thumshirn <[email protected]> > Reviewed-by: Johannes Thumshirn <[email protected]> > Signed-off-by: Johannes Thumshirn <[email protected]> > Signed-off-by: Minchan Kim <[email protected]>
Reviewed-by: Sergey Senozhatsky <[email protected]> > + unsigned int remained = bvec.bv_len; ... > + } while (remained); a tiny nitpick, "-ed" in variable name looks a bit unusual. -ss

