From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756211AbdDMHPK (ORCPT ); Thu, 13 Apr 2017 03:15:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:33052 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756099AbdDMHPH (ORCPT ); Thu, 13 Apr 2017 03:15:07 -0400 Date: Thu, 13 Apr 2017 09:15:00 +0200 From: Johannes Thumshirn To: Minchan Kim Cc: Andrew Morton , kernel-team@lge.com, linux-kernel@vger.kernel.org, Hannes Reinecke , Sergey Senozhatsky Subject: Re: [PATCH v2 1/6] zram: handle multiple pages attached bio's bvec Message-ID: <20170413071500.GA5457@linux-x5ow.site> References: <1492052365-16169-1-git-send-email-minchan@kernel.org> <1492052365-16169-2-git-send-email-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1492052365-16169-2-git-send-email-minchan@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 13, 2017 at 11:59:20AM +0900, 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 system panic. > > [1] in mainline solved solved the problem by limiting max_sectors with > SECTORS_PER_PAGE 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(ie, bio split). > > [1] 0bc315381fe9, zram: set physical queue limits to avoid array out of > bounds accesses > > * from v1 > * Do not exceed page boundary when set up bv.bv_len in make_request > * change "remained" variable name with "unwritten" > > Cc: Hannes Reinecke > Reported-by: Johannes Thumshirn > Tested-by: Johannes Thumshirn > Reviewed-by: Johannes Thumshirn > Reviewed-by: Sergey Senozhatsky > Signed-off-by: Minchan Kim > --- Hi Minchan, A quick amendment to your patch you forgot to remove the queue limit setting which I introduced with commit 0bc315381fe9. Thanks, Johannes -- Johannes Thumshirn Storage jthumshirn@suse.de +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850