Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752161AbcCLJYj (ORCPT ); Sat, 12 Mar 2016 04:24:39 -0500 Received: from mail-pf0-f169.google.com ([209.85.192.169]:34095 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751650AbcCLJY0 (ORCPT ); Sat, 12 Mar 2016 04:24:26 -0500 Date: Sat, 12 Mar 2016 00:24:21 -0900 From: Kent Overstreet To: Ming Lei Cc: Ming Lin , Jens Axboe , Linux Kernel Mailing List Subject: Re: e827091cb1 "block: merge: get the 1st and last bvec via helpers" broken Message-ID: <20160312092421.GA20839@kmo-pixel> References: <20160312074329.GA19066@kmo-pixel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Content-Length: 924 Lines: 21 On Sat, Mar 12, 2016 at 04:49:41PM +0800, Ming Lei wrote: > On Sat, Mar 12, 2016 at 3:43 PM, Kent Overstreet > wrote: > > I don't know exactly how it's broken, but with that patch segment counting is > > broken - I'm seeing blk_rq_map_sg() overrun the end of the sgtable. > > > > I suggest reverting it for 4.5... > > Kent, could you share your test case? I'd like to figure out the root cause. xfstest 036 on bcachefs. > BTW, I don't object to revert it given it is close to v4.5 release, but I am > curious how it breaks segment couting. If you want to debug your version (personally I'd just revert to the simpler one), I'd start by having your helper use both methods to calculate the last biovec, and then assert that they're equal. Also make sure you're testing with a sub-page sized blocksize, if filesystem blocksize == page size you're not going to be testing the interesting cases