Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1140556imm; Wed, 1 Aug 2018 10:51:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdo/5+CBeldJRZg19bovoZgI22rWtAIqgXHcLInKwe4flBWEiVKn+PLRI+tkpZTx83lsM5A X-Received: by 2002:a63:6949:: with SMTP id e70-v6mr26242138pgc.119.1533145903432; Wed, 01 Aug 2018 10:51:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533145903; cv=none; d=google.com; s=arc-20160816; b=K8NNt7Vuj8VzY/VN93aBPDX47r9eNW+OWfh00GM0sH3EM8ET/m5zpyr6qWZpLHJCFU T6dgZR6j5X7SoVuDIwmQ1yKMBX+i6/fFD23xcymaFNCR7HOf5u4ssVJdLN/VykQhYojH xt/5TOEr+l8+KheUcILpxDFS+UJ4DQpSeqq08fJSMBdWW+2SY5yf2ZhDbh2hiunF9vBi G0wLxRTsvdHUUVHOrIamDxjnMPn+5ubEcHqtqe0TdpgzyOjS464LbthyvtVflsSeiwiS +toDqI59VN9yJSvXPRXb42MyI6ZCBHzmzS7Yn8tayXV1hlP2I0lpCXwdbXHEkY+rT43P hdQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=CRUP6h7dGQKIgcEvAvtP8z1kx2Z5WQB+6ZxtLLR+Dfo=; b=CjfcHEgHPGGQpYTzd01VuDeiHz0N2AH3RshzRLr87qJe+S6zCjMSW4s0AnJdgUP5uX NP6H01cJf3iy65J2SezQbvojzeVs6FEDL7J07qKmOyCmda4Kf7ABSaSlIV+Nrsg4xQaj Cxf8VtPeEzkYdPF9m/LZIHu7/2Zj4lknoTAzK8XAx8KIvZYf3cmIQhmdPdKLQMEISZ+H IC1cxTMOHEUd+Hz5FFiIT8KLa3OwiV3X/bsWu5E5OgjBfBx8dIlSW3m7Nsl7e9dU+nt3 xKNBbMhZCBRoFUIGlxAabSC3PeQrFTwYGMrwxq4HtGz0PooDnsNOOky95w2nYqRfASIF 6i/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j4-v6si14877145pll.101.2018.08.01.10.51.27; Wed, 01 Aug 2018 10:51:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406251AbeHATJZ (ORCPT + 99 others); Wed, 1 Aug 2018 15:09:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50770 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405177AbeHATJY (ORCPT ); Wed, 1 Aug 2018 15:09:24 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CF14ED27; Wed, 1 Aug 2018 17:22:42 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Greg Edwards , Jens Axboe Subject: [PATCH 4.14 217/246] block: reset bi_iter.bi_done after splitting bio Date: Wed, 1 Aug 2018 18:52:07 +0200 Message-Id: <20180801165022.105121223@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Greg Edwards commit 5151842b9d8732d4cbfa8400b40bff894f501b2f upstream. After the bio has been updated to represent the remaining sectors, reset bi_done so bio_rewind_iter() does not rewind further than it should. This resolves a bio_integrity_process() failure on reads where the original request was split. Fixes: 63573e359d05 ("bio-integrity: Restore original iterator on verify stage") Signed-off-by: Greg Edwards Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/bio.c | 1 + 1 file changed, 1 insertion(+) --- a/block/bio.c +++ b/block/bio.c @@ -1889,6 +1889,7 @@ struct bio *bio_split(struct bio *bio, i bio_integrity_trim(split); bio_advance(bio, split->bi_iter.bi_size); + bio->bi_iter.bi_done = 0; if (bio_flagged(bio, BIO_TRACE_COMPLETION)) bio_set_flag(split, BIO_TRACE_COMPLETION);