Message ID | 20181011070952.13248-6-damien.lemoal@wdc.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Mike Snitzer |
Headers | show
Return-Path: <dm-devel-bounces@redhat.com> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D2DD15E2 for <patchwork-dm-devel@patchwork.kernel.org>; Thu, 11 Oct 2018 07:11:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1251F2AE79 for <patchwork-dm-devel@patchwork.kernel.org>; Thu, 11 Oct 2018 07:11:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 069F42AEFF; Thu, 11 Oct 2018 07:11:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A74192AE79 for <patchwork-dm-devel@patchwork.kernel.org>; Thu, 11 Oct 2018 07:11:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9CF4A3002610; Thu, 11 Oct 2018 07:11:09 +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 63754764DC; Thu, 11 Oct 2018 07:11:09 +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 1639A4CA94; Thu, 11 Oct 2018 07:11:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w9B7B7NW010633 for <dm-devel@listman.util.phx.redhat.com>; Thu, 11 Oct 2018 03:11:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id B498F629C1; Thu, 11 Oct 2018 07:11:07 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 917D818398; Thu, 11 Oct 2018 07:11:01 +0000 (UTC) Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C2B0030BD9FF; Thu, 11 Oct 2018 07:10:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1539241862; x=1570777862; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=TO9/d2tST9vnaD05TIZjJa0QPE0wX3n1RaGQVyoHWb4=; b=na2IUzQYGBJwPURlaaLAkrdFdlVcqrmD9+HSefcuwms6hSoeyVe2VcOU hlTt7e1VaRoYqEMIFGPXlv15pE8xdhYW+u9mAWdGQJANpY0HjPDHDmm65 3XsT8KLNsaxd7JCkPTMxrgrxMGQVztz5/ryGUOqulxWoFaUSy7xKbvE6/ 25uyO4K0Fj/gmQtN0H6udVLlmh7mE962Lra9g1ZhHLBNR9nBXccp+tA44 sckDna41iElAFb3u8lRFI7XnKPfPg/JKCUZIVbpaTQhHccUBuQV+MFCJu GHIhDjsA47176ndGqyQwSoUHLAofSvNP8vN9svKk4PhWOuOLG8Da84zLk g==; X-IronPort-AV: E=Sophos;i="5.54,367,1534780800"; d="scan'208";a="189389109" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 11 Oct 2018 15:10:12 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 10 Oct 2018 23:55:26 -0700 Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by uls-op-cesaip02.wdc.com with ESMTP; 11 Oct 2018 00:10:01 -0700 From: Damien Le Moal <damien.lemoal@wdc.com> To: linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>, linux-scsi@vger.kernel.org, "Martin K . Petersen" <martin.petersen@oracle.com>, dm-devel@redhat.com, Mike Snitzer <snitzer@redhat.com> Date: Thu, 11 Oct 2018 16:09:46 +0900 Message-Id: <20181011070952.13248-6-damien.lemoal@wdc.com> In-Reply-To: <20181011070952.13248-1-damien.lemoal@wdc.com> References: <20181011070952.13248-1-damien.lemoal@wdc.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 214 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 11 Oct 2018 07:10:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 11 Oct 2018 07:10:53 +0000 (UTC) for IP:'68.232.143.124' DOMAIN:'esa2.hgst.iphmx.com' HELO:'esa2.hgst.iphmx.com' FROM:'damien.lemoal@wdc.com' RCPT:'' X-RedHat-Spam-Score: -0.8 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW) 68.232.143.124 esa2.hgst.iphmx.com 68.232.143.124 esa2.hgst.iphmx.com <prvs=81565c836=damien.lemoal@wdc.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: dm-devel@redhat.com Cc: Christoph Hellwig <hch@lst.de>, Matias Bjorling <matias.bjorling@wdc.com> Subject: [dm-devel] [PATCH v2 05/11] block: Limit allocation of zone descriptors for report zones X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development <dm-devel.redhat.com> List-Unsubscribe: <https://www.redhat.com/mailman/options/dm-devel>, <mailto:dm-devel-request@redhat.com?subject=unsubscribe> List-Archive: <https://www.redhat.com/archives/dm-devel> List-Post: <mailto:dm-devel@redhat.com> List-Help: <mailto:dm-devel-request@redhat.com?subject=help> List-Subscribe: <https://www.redhat.com/mailman/listinfo/dm-devel>, <mailto:dm-devel-request@redhat.com?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 11 Oct 2018 07:11:10 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Zoned block device support improvements
|
expand
|
diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 32e377f755d8..bb4ed69f917f 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -355,8 +355,7 @@ int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode, if (!rep.nr_zones) return -EINVAL; - if (rep.nr_zones > INT_MAX / sizeof(struct blk_zone)) - return -ERANGE; + rep.nr_zones = min(blkdev_nr_zones(bdev), rep.nr_zones); zones = kvmalloc_array(rep.nr_zones, sizeof(struct blk_zone), GFP_KERNEL | __GFP_ZERO);