Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1615707

Re: [PATCH 1/5] zram: handle multiple pages attached bio's bvec

From Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/5] zram: handle multiple pages attached bio's bvec
Date 2017-04-04 07:00 +0200
Message-ID <tsoJs-8um-15@gated-at.bofh.it> (permalink)
References <ts2zg-2z9-3@gated-at.bofh.it> <ts2zg-2z9-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <axboe@kernel.dk>
> Cc: Hannes Reinecke <hare@suse.com>
> Reported-by: Johannes Thumshirn <jthumshirn@suse.de>
> Tested-by: Johannes Thumshirn <jthumshirn@suse.de>
> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> Signed-off-by: Minchan Kim <minchan@kernel.org>

Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>


> +		unsigned int remained = bvec.bv_len;
...
> +		} while (remained);

a tiny nitpick,  "-ed" in variable name looks a bit unusual.

	-ss

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/5] zram: handle multiple pages attached bio's bvec Minchan Kim <minchan@kernel.org> - 2017-04-03 07:20 +0200
  Re: [PATCH 1/5] zram: handle multiple pages attached bio's bvec Andrew Morton <akpm@linux-foundation.org> - 2017-04-04 00:50 +0200
    Re: [PATCH 1/5] zram: handle multiple pages attached bio's bvec Minchan Kim <minchan.kim@lge.com> - 2017-04-04 01:20 +0200
  Re: [PATCH 1/5] zram: handle multiple pages attached bio's bvec Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-04-04 07:00 +0200

csiph-web