From patchwork Wed Apr 29 15:07:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinz Mauelshagen X-Patchwork-Id: 11517773 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1AFFA92A for ; Wed, 29 Apr 2020 15:07:30 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CD3F021973 for ; Wed, 29 Apr 2020 15:07:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hlCnCMun" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD3F021973 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588172848; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=5dFfQLSuxBQqAbqxvLBvc6VewjCjGvTj7bNMTnWGA4Y=; b=hlCnCMunbFdzJQGYaTvgOv1whHauddPwzW8wk+INFXta7GYR6TV5UA9QWOjt0+rdjRKpgN 1XqUaKZBcTG/WRctPqXuCQ5KfU6BCRLHwAnFHD4F8yBokh0O3aM5uBMryeK8wvKzn7FLwk /jCEtF5KU7coyParVp4NKKMWp0qjGf8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-26-oO_NtkgJOP6m678y1YrOiQ-1; Wed, 29 Apr 2020 11:07:23 -0400 X-MC-Unique: oO_NtkgJOP6m678y1YrOiQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E330F107ACCD; Wed, 29 Apr 2020 15:07:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ACC655D9C9; Wed, 29 Apr 2020 15:07:18 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3B26F4CAA0; Wed, 29 Apr 2020 15:07:18 +0000 (UTC) Received: from smtp.corp.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 03TF7G0A014266 for ; Wed, 29 Apr 2020 11:07:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id D04D4605CB; Wed, 29 Apr 2020 15:07:16 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from o.ww.redhat.com (unknown [10.40.193.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 640A7605F7; Wed, 29 Apr 2020 15:07:10 +0000 (UTC) From: heinzm@redhat.com To: dm-devel@redhat.com, snitzer@redhat.com Date: Wed, 29 Apr 2020 17:07:09 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH] dm ebs: fix bio->bi_status assignment X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk 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-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com From: Heinz Mauelshagen Assign blk_status_t to bi_status properly in __ebs_process_bios() on error (flaw found by static checker). Reported-by: Dan Carpenter Signed-off-by: Heinz Mauelshagen --- drivers/md/dm-ebs-target.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-ebs-target.c b/drivers/md/dm-ebs-target.c index 97703c31771f..c9c66d6b1e56 100644 --- a/drivers/md/dm-ebs-target.c +++ b/drivers/md/dm-ebs-target.c @@ -210,7 +210,8 @@ static void __ebs_process_bios(struct work_struct *ws) r = __ebs_discard_bio(ec, bio); } - bio->bi_status = r; + if (r < 0) + bio->bi_status = BLK_STS_IOERR; } /*