From patchwork Tue Aug 13 19:18:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ed Cashin X-Patchwork-Id: 2844406 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 57C8C9F2F5 for ; Wed, 14 Aug 2013 11:21:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3226F204CD for ; Wed, 14 Aug 2013 11:21:52 +0000 (UTC) Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mail.kernel.org (Postfix) with ESMTP id C817120489 for ; Wed, 14 Aug 2013 11:21:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r7EBHLnJ006036; Wed, 14 Aug 2013 07:17:22 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r7DJJ02m012252 for ; Tue, 13 Aug 2013 15:19:00 -0400 Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.21]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r7DJIwjB016490 for ; Tue, 13 Aug 2013 15:18:59 -0400 Received: from server506.appriver.com (server506d.appriver.com [50.56.144.156]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7DJIutY010694 for ; Tue, 13 Aug 2013 15:18:57 -0400 X-Note-AR-ScanTimeLocal: 8/13/2013 2:18:55 PM X-Policy: GLOBAL - coraid.com X-Policy: GLOBAL - coraid.com X-Policy: GLOBAL - coraid.com X-Policy: GLOBAL - coraid.com X-Policy: GLOBAL - coraid.com X-Policy: Too many policies to list X-Primary: ecashin@coraid.com X-Note: This Email was scanned by AppRiver SecureTide X-Virus-Scan: V- X-Note-SnifferID: 0 X-Note: TCH-CT/SI:0-104/SG:2 8/13/2013 2:18:14 PM X-GBUdb-Analysis: 0, 10.242.229.139, Ugly c=1 p=-0.971458 Source White X-Signature-Violations: 0-0-0-6218-c X-Note-419: 31.2022 ms. Fail:0 Chk:1343 of 1343 total X-Note: SCH-CT/SI:0-1343/SG:1 8/13/2013 2:18:46 PM X-Note: Spam Tests Failed: X-Country-Path: ->PRIVATE->UNITED STATES X-Note-Sending-IP: 10.242.229.139 X-Note-Reverse-DNS: X-Note-Return-Path: ecashin@coraid.com X-Note: User Rule Hits: X-Note: Global Rule Hits: G323 G324 G325 G326 G330 G331 G438 X-Note: Encrypt Rule Hits: X-Note: Mail Class: VALID X-Note: Headers Injected Received: from [10.242.229.139] (HELO smtp.exg6.exghost.com) by server506.appriver.com (CommuniGate Pro SMTP 6.0.2) with ESMTPS id 1623489; Tue, 13 Aug 2013 14:18:51 -0500 Received: from coraid.com (98.192.52.118) by smtp.exg6.exghost.com (50.56.144.22) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 13 Aug 2013 14:18:44 -0500 Date: Tue, 13 Aug 2013 15:18:43 -0400 From: Ed L Cashin To: Kent Overstreet Message-ID: <20130813191841.GA55109@Ed-Cashins-MacBook-Pro.local> References: <1375912471-5106-1-git-send-email-kmo@daterainc.com> <1375912471-5106-5-git-send-email-kmo@daterainc.com> <2D8F228B-65AE-4046-A910-6B354AF0058E@coraid.com> <20130809000943.GC15409@kmo-pixel> <20130809010530.GG15409@kmo-pixel> <54e7d248ba68ecf7e7ad4a4180145b72@coraid.com> <20130813185158.GA8981@kmo-pixel> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130813185158.GA8981@kmo-pixel> User-Agent: Mutt/1.5.21 (2010-09-15) X-Rerouted-By-Exchange: X-Rerouted-By-Exchange: X-Rerouted-By-Exchange: X-Rerouted-By-Exchange: X-Rerouted-By-Exchange: X-Rerouted-By-Exchange: X-Rerouted-By-Exchange: X-RedHat-Spam-Score: -2.3 (BAYES_00, DCC_REPUT_00_12, SPF_PASS, URIBL_BLOCKED) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.21 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Wed, 14 Aug 2013 07:17:20 -0400 Cc: "axboe@kernel.dk" , "linux-kernel@vger.kernel.org" , "linux-raid@vger.kernel.org" , "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" Subject: Re: [dm-devel] [PATCH 04/22] block: Abstract out bvec iterator 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=-9.7 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 Tue, Aug 13, 2013 at 11:51:58AM -0700, Kent Overstreet wrote: > On Tue, Aug 13, 2013 at 10:03:04AM -0400, Ed Cashin wrote: > > On Aug 9, 2013, Ed Cashin wrote: > > > On Aug 8, 2013, at 9:05 PM, Kent Overstreet wrote: > > > ... > > > > It's in the for-jens branch now. > > > > > > > > > Just examining the patches, I like the way it cleans up the aoe code. I > > > had a question about a new BUG added by the for-jens branch the > > > read-response handling path of the aoe driver. > > > > The aoe driver in linux-bcache/for-jens commit 4c36c973a8f45 is > > passing my tests. > > > > Here is a patch against that branch illustrating my suggestion for > > handling bad target responses gracefully. > > Thanks - shall I just fold that into the aoe immutable bvec patch? Yes, that would be good, thanks. Unfortunately, the way I usually send patches to vger didn't work this time. It looks like the MTA didn't retry after the greylisting used SMTP temporary failures. So I'm trying a different way to send and including the same patch for the benefit of the Cc list. commit 2c39f50b1ee02e2ac07fd072a883a91713da53cc Author: Ed Cashin Date: Tue Aug 13 10:50:28 2013 -0400 aoe: bad AoE responses fail I/O without BUG Instead of having a BUG when the AoE target does something wrong, just fail the I/O and log the problem with rate limiting. diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index cacd48e..b9916a6 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -1096,7 +1096,6 @@ bvcpy(struct sk_buff *skb, struct bio *bio, struct bvec_iter iter, long cnt) int soff = 0; struct bio_vec bv; - BUG_ON(cnt > iter.bi_size); iter.bi_size = cnt; __bio_for_each_segment(bv, bio, iter, iter) { @@ -1196,6 +1195,14 @@ noskb: if (buf) clear_bit(BIO_UPTODATE, &buf->bio->bi_flags); break; } + if (n > f->iter.bi_size) { + pr_err_ratelimited("%s e%ld.%d. bytes=%ld need=%u\n", + "aoe: too-large data size in read from", + (long) d->aoemajor, d->aoeminor, + n, f->iter.bi_size); + clear_bit(BIO_UPTODATE, &buf->bio->bi_flags); + break; + } bvcpy(skb, f->buf->bio, f->iter, n); case ATA_CMD_PIO_WRITE: case ATA_CMD_PIO_WRITE_EXT: