Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp330769pxb; Wed, 11 Nov 2020 05:00:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8nyEYxeDOmzv6xXIntALM5TnRGHvS0xcu6o5v/9ZIGRrU6e39TQF/Qjez1QFj8u9ZC0d2 X-Received: by 2002:a05:6402:3066:: with SMTP id bs6mr4765120edb.79.1605099622928; Wed, 11 Nov 2020 05:00:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605099622; cv=none; d=google.com; s=arc-20160816; b=YHdhgnPedapwRHkLyECy46FepMgY7scFXgZfdSB3z5axHFhMyieq9HgAoWT7mkZzuz UJ/qnQIOlx362qMqKlXzDGgo9gbLHUQnfEnPl0YgfIMERpkE7hY518K6eW1xgwQgoi76 w2hSoE7pdWUb+cZke7buyP3czVPLchSC3OB4r8P7v9kv55UvO9EGVM+Gx0FexY93AIqr qXnNgJU+hKdAjaP7y3Ugew6KT3wVwx0Du12h7/j2tIylCzn2BKM3IdnEnsexsTbKLXnf 6bMj7uWyABwUmU2l1xYLfYrzIY2I1p8l9RizbNoT4LsqTgPELrSqCIyt9ylua5ukWUJB k6Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=yna0rBXA2H68/sU/8V5f7XYoZF8lEVzpFwICy49wNcY=; b=sJNDJgB9pnIlB9RnUKGlHX6qcmcEjbYXhOi6R7CG5dVOZCPKt6izRCPRdsdRGf/Y1A wUpbpvRJohyr0HV0kNVnjNA7d7dwAXQ3008adCc/SOIMkM1z8bvZim4Aqi0I7jREKJTX ROh9TCuwoSHd4w1tBRSt8Lu/EWyOB2E50v0dszoCTWzCdeV20tRBa4J6IppLEi5gyr/p zYZqg5OlfOIVUTgmD5JecJ4KHisC4MAcHP/hWsBXJXTJ16+x644l0SeH2VtoI4YATSKi a5ZkEYOyx8iXS8prfIlPnMq7/8jxV5kIdHTmO0nKgUnY2rhIgCNjb7Uh4wD9IPEg/XLs K/9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@veeam.com header.s=mx4 header.b=X2Xlsmti; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=veeam.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ho36si1344660ejc.640.2020.11.11.04.59.55; Wed, 11 Nov 2020 05:00:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@veeam.com header.s=mx4 header.b=X2Xlsmti; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=veeam.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726588AbgKKMzk (ORCPT + 99 others); Wed, 11 Nov 2020 07:55:40 -0500 Received: from mx4.veeam.com ([104.41.138.86]:58290 "EHLO mx4.veeam.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbgKKMzj (ORCPT ); Wed, 11 Nov 2020 07:55:39 -0500 Received: from mail.veeam.com (prgmbx01.amust.local [172.24.0.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx4.veeam.com (Postfix) with ESMTPS id 1CA0992315; Wed, 11 Nov 2020 15:55:38 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veeam.com; s=mx4; t=1605099338; bh=yna0rBXA2H68/sU/8V5f7XYoZF8lEVzpFwICy49wNcY=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=X2XlsmtiXjZftJZi1T+GYbBOmFE0b0WjTjMU+D6rNRhE9UON0TtRJc9ytQGZXiicP Yws58UjsyDzjg0luuzOjPIxUG13TCC8ZC2Z9XH4dbIQCn+8mIcAyQFYvw2oRbP/rSF Oqp7WkPAcW57lU7kfq6V2Eu/vKKebAUEpeNqVjdE= Received: from prgdevlinuxpatch01.amust.local (172.24.14.5) by prgmbx01.amust.local (172.24.0.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.721.2; Wed, 11 Nov 2020 13:55:36 +0100 From: Sergei Shtepa To: , , , CC: Sergei Shtepa Subject: [PATCH 1/1] Fix bug with RCU locking in dm_blk_report_zones(). Date: Wed, 11 Nov 2020 15:55:46 +0300 Message-ID: <1605099346-3199-2-git-send-email-sergei.shtepa@veeam.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1605099346-3199-1-git-send-email-sergei.shtepa@veeam.com> References: <1605099346-3199-1-git-send-email-sergei.shtepa@veeam.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.24.14.5] X-ClientProxiedBy: prgmbx01.amust.local (172.24.0.171) To prgmbx01.amust.local (172.24.0.171) X-EsetResult: clean, is OK X-EsetId: 37303A29C604D26A617667 X-Veeam-MMEX: True Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The dm_get_live_table() function makes RCU read lock and dm_put_live_table() should call even when dm_table map was not found. Signed-off-by: Sergei Shtepa --- drivers/md/dm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index c18fc2548518..98866e725f25 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -476,8 +476,10 @@ static int dm_blk_report_zones(struct gendisk *disk, sector_t sector, return -EAGAIN; map = dm_get_live_table(md, &srcu_idx); - if (!map) - return -EIO; + if (!map) { + ret = -EIO; + goto out; + } do { struct dm_target *tgt; -- 2.20.1