All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ed Cashin <ecashin@coraid.com>
To: Kent Overstreet <kmo@daterainc.com>
Cc: "axboe@kernel.dk" <axboe@kernel.dk>,
	"neilb@suse.de" <neilb@suse.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"dm-devel@redhat.com" <dm-devel@redhat.com>,
	"linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
	ecashin@coraid.com
Subject: Re: [PATCH 04/22] block: Abstract out bvec iterator
Date: Tue, 13 Aug 2013 10:03:04 -0400	[thread overview]
Message-ID: <54e7d248ba68ecf7e7ad4a4180145b72@coraid.com> (raw)
In-Reply-To: <FEE91CF1-7CDE-45E5-B7BA-DA8522E7DFFE@coraid.com>

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.


commit 2c39f50b1ee02e2ac07fd072a883a91713da53cc
Author: Ed Cashin <ecashin@coraid.com>
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:

  parent reply	other threads:[~2013-08-13 14:03 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07 21:54 [PATCH 0/22] Immutable biovecs, block layer changes Kent Overstreet
2013-08-07 21:54 ` [PATCH 01/22] block: Use rw_copy_check_uvector() Kent Overstreet
2013-08-07 21:54 ` [PATCH 02/22] block: Consolidate duplicated bio_trim() implementations Kent Overstreet
2013-08-07 21:54 ` [PATCH 03/22] bcache: Kill unaligned bvec hack Kent Overstreet
2013-08-07 21:54 ` [PATCH 04/22] block: Abstract out bvec iterator Kent Overstreet
2013-08-07 21:54   ` Kent Overstreet
2013-08-07 21:54   ` Kent Overstreet
2013-08-07 22:24   ` Geoff Levand
2013-08-08  2:04   ` Ed Cashin
2013-08-08  2:04     ` Ed Cashin
2013-08-08  2:04     ` Ed Cashin
2013-08-09  0:09     ` Kent Overstreet
2013-08-09  0:09       ` Kent Overstreet
2013-08-09  0:59       ` Ed Cashin
2013-08-09  1:05         ` Kent Overstreet
2013-08-09 20:16           ` Ed Cashin
2013-08-13 14:03           ` Ed Cashin [this message]
2013-08-13 18:51             ` Kent Overstreet
2013-08-13 19:18               ` Ed L Cashin
2013-08-07 21:54 ` [PATCH 05/22] dm: Use bvec_iter for dm_bio_record() Kent Overstreet
2013-08-07 21:54 ` [PATCH 06/22] block: Convert bio_iovec() to bvec_iter Kent Overstreet
2013-08-07 21:54 ` [PATCH 07/22] block: Convert bio_for_each_segment() " Kent Overstreet
2013-08-07 21:54 ` Kent Overstreet
2013-08-07 21:54   ` [Cluster-devel] " Kent Overstreet
2013-08-07 21:54   ` Kent Overstreet
2013-08-07 21:54   ` Kent Overstreet
2013-08-07 21:54   ` Kent Overstreet
     [not found] ` <1375912471-5106-1-git-send-email-kmo-PEzghdH756F8UrSeD/g0lQ@public.gmane.org>
2013-08-07 21:54   ` [PATCH 08/22] block: Immutable bio vecs Kent Overstreet
2013-08-07 21:54     ` Kent Overstreet
2013-08-07 21:54 ` [PATCH 09/22] block: Convert bio_copy_data() to bvec_iter Kent Overstreet
2013-08-07 21:54 ` [PATCH 10/22] bio-integrity: Convert " Kent Overstreet
2013-08-07 21:54 ` [PATCH 11/22] block: Kill bio_segments()/bi_vcnt usage Kent Overstreet
2013-08-07 21:54 ` [PATCH 12/22] block: Convert drivers to immutable biovecs Kent Overstreet
2013-08-07 21:54 ` [PATCH 13/22] ceph: Convert " Kent Overstreet
2013-08-07 21:54 ` [PATCH 14/22] block: Kill bio_iovec_idx(), __bio_iovec() Kent Overstreet
2013-08-07 21:54 ` [PATCH 15/22] rbd: Refactor bio cloning, don't clone biovecs Kent Overstreet
2013-08-07 21:54 ` [PATCH 16/22] dm: Refactor for new bio cloning/splitting Kent Overstreet
2013-09-28  4:59   ` Mike Snitzer
2013-10-03  3:17     ` Kent Overstreet
2013-10-03  3:23       ` Mike Snitzer
2013-10-03 21:45         ` Kent Overstreet
2013-10-03 22:50           ` Mike Snitzer
2013-10-04 17:07             ` Mike Snitzer
2013-10-07  0:14               ` Mike Snitzer
2013-10-11  4:13                 ` Kent Overstreet
2013-10-11 21:16                   ` Mike Snitzer
2013-10-11 22:11                     ` Kent Overstreet
2013-08-07 21:54 ` [PATCH 17/22] block: Remove bi_idx hacks Kent Overstreet
2013-08-07 21:54 ` [PATCH 18/22] block: Generic bio chaining Kent Overstreet
2013-08-10  7:38   ` Kent Overstreet
2013-08-10  7:38     ` Kent Overstreet
2013-08-07 21:54 ` [PATCH 19/22] block: Rename bio_split() -> bio_pair_split() Kent Overstreet
2013-08-07 21:54 ` [PATCH 20/22] block: Introduce new bio_split() Kent Overstreet
2013-08-07 21:54 ` [PATCH 21/22] block: Kill bio_pair_split() Kent Overstreet
2013-08-07 21:54 ` [PATCH 22/22] block: Don't save/copy bvec array anymore, share when cloning Kent Overstreet
2013-08-08 15:09 ` [PATCH 0/22] Immutable biovecs, block layer changes Christoph Hellwig
2013-08-08 21:15   ` Kent Overstreet
2013-09-24 11:00     ` Christoph Hellwig
2013-09-24 13:20       ` Mike Snitzer
2013-09-24 14:29         ` Christoph Hellwig
2013-09-24 19:19         ` Kent Overstreet
2013-09-27 18:38           ` Mike Snitzer
2013-09-24 19:16       ` Kent Overstreet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54e7d248ba68ecf7e7ad4a4180145b72@coraid.com \
    --to=ecashin@coraid.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=kmo@daterainc.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.