From patchwork Thu Oct 3 03:17:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 2979531 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CD1DDBFF0B for ; Thu, 3 Oct 2013 03:21:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D454920304 for ; Thu, 3 Oct 2013 03:21:35 +0000 (UTC) Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mail.kernel.org (Postfix) with ESMTP id 1238B202FF for ; Thu, 3 Oct 2013 03:21:35 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r933HeOk025262; Wed, 2 Oct 2013 23:17:42 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r933Hcx9016769 for ; Wed, 2 Oct 2013 23:17:38 -0400 Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.18]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r933HcoF010394 for ; Wed, 2 Oct 2013 23:17:38 -0400 Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r933Hb6L004437 for ; Wed, 2 Oct 2013 23:17:37 -0400 Received: by mail-pa0-f47.google.com with SMTP id kp14so1936072pab.6 for ; Wed, 02 Oct 2013 20:17:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=M/xWsdj1pGXqi62KLmEsWtNyL6DKfk1VKwXZ2Wh5V8A=; b=aRlvVeE1niD9WRJUoezSdxJmAuLtKJckgL+85RFNFPQWvvlfoltellwkeLXARxwyEA UutUkyz0BGFpVFACgkBN8YfeUmiEVilWHmVwj7D8ZtqrumGzONjf2vHS5k2Y1MD216ag X/Y2xSoXcR8etsHzLAxWS8aR5LbsLIh6WYETFal13Y8ugumFFfDzFCX/bK/mQt9b/ZIX JgEfK81Z4lBvdOzSr5PaZ5v220T/it+qijnOQ70FmVLkWMc5ovnht948rX1nWSxd2Quv EDFHqb8QbjzvxAisUIqs/im01rMqGOeXnnXsM/vgqYvpgg6EFmkCZN0Cav4VIwY+Tx48 AR0Q== X-Gm-Message-State: ALoCoQm8lIV+vPkshQ2Id0qzNV2a6hOfv6g7U0c2pESTyE7XaOq9FURPwUqw+hXVsd2lTJVDPeAF X-Received: by 10.66.66.161 with SMTP id g1mr517921pat.175.1380770255135; Wed, 02 Oct 2013 20:17:35 -0700 (PDT) Received: from kmo-pixel (c-50-168-77-251.hsd1.ca.comcast.net. [50.168.77.251]) by mx.google.com with ESMTPSA id qn1sm5032447pbc.34.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 02 Oct 2013 20:17:34 -0700 (PDT) Date: Wed, 2 Oct 2013 20:17:38 -0700 From: Kent Overstreet To: Mike Snitzer Message-ID: <20131003031738.GA27418@kmo-pixel> References: <1375912471-5106-1-git-send-email-kmo@daterainc.com> <1375912471-5106-17-git-send-email-kmo@daterainc.com> <20130928045909.GA19745@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130928045909.GA19745@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-RedHat-Spam-Score: -2.6 (BAYES_00,RCVD_IN_DNSWL_LOW) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.18 X-loop: dm-devel@redhat.com Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, Alasdair Kergon Subject: Re: [dm-devel] [PATCH 16/22] dm: Refactor for new bio cloning/splitting X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sat, Sep 28, 2013 at 12:59:09AM -0400, Mike Snitzer wrote: > Hey Kent, > > I haven't been able to pinpoint the issue yet, but using your for-jens > branch, if I create a dm-thin volume with this lvm command: > lvcreate -L20G -V20G -T vg/pool --name thinlv > > and try to format /dev/vg/thinlv with XFS the kernel warns and then > hangs with the following: Thanks, for whatever reason ext4 wasn't tickling that codepath but xfs does. I folded the fix into my for-jens branch, here's what changed: --- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel diff --git a/drivers/md/dm.c b/drivers/md/dm.c index b60b350..79cee1a 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1098,7 +1098,7 @@ static void clone_bio(struct dm_target_io *tio, struct bio *bio, bio_integrity_clone(clone, bio, GFP_NOIO); bio_advance(clone, to_bytes(sector - clone->bi_iter.bi_sector)); - bio->bi_iter.bi_size = to_bytes(len); + clone->bi_iter.bi_size = to_bytes(len); if (bio_integrity(bio)) bio_integrity_trim(clone, 0, len); @@ -1267,7 +1267,7 @@ static int __split_and_process_non_flush(struct clone_info *ci) if (!dm_target_is_valid(ti)) return -EIO; - len = min_t(unsigned, max_io_len(ci->sector, ti), bio_sectors(bio)); + len = min_t(sector_t, max_io_len(ci->sector, ti), ci->sector_count); __clone_and_map_data_bio(ci, ti, ci->sector, len);