Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp538166imm; Fri, 13 Jul 2018 01:50:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfSwEokhg4Zir8Q5xxSvtc8p6ajclRLRsfaOR7G3SMISb15ciTjY+KVxV7Kqkj9KnI3mFdx X-Received: by 2002:a17:902:5a3:: with SMTP id f32-v6mr5437357plf.109.1531471842437; Fri, 13 Jul 2018 01:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531471842; cv=none; d=google.com; s=arc-20160816; b=0qwPkWPKzPil/fZgmVPf6k2Zy8H0KBYFF8AW0US7V2RfC+lvGpQ9oSlKpquroTBiwl 8C/TVR60kGa1er00i7qCBSrSstqNmIxoX2jQyutwlLXApO3OD+23RDdfCq8ruIdxXiHE Uofmyeoj20roXSxQh+mffp/Cgxqog+oQvX15jTvOxsk67sQQpNlTDDhhwfSbYlc8f7Zb 1s9KjWU76ZPu8tEuN7mhFmLSzo1WrvpWqhCtLqFbvtiSziiKabmVlOMA58Zm/kXeJZVd 0/ZOAeDlJig9wx8TahjaKW/iRK0WHv9TRC6ED9V75Xq6FS0kSG+YkLDjyJNrw5fYiFnG +2eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=R/o6TouuzMj4hAi/E4zlw4tY9U6hfVq7zhgS150k4CM=; b=1FFxi8IuL4S9Eh4R1+qnPl+DwGMpICiVKwePjSwUXYN+g8S4Xj6lZW5OH9KLrOVQTC KD6MxpIlv+0P/TGUzXnCYXLlIIjb5cgI5BzeE6YxNxBDFrgc/NWM4AgM3aZpJndBetG+ T0mrKiC9nC79TkMLcUeLGOG3aqyih+ySMwxLD8Azo/PDvIWm5OlPkfhXDmCpocitfeLb RU+yXCAmtFhthN36hRw2OVYP6CVmD6kq/qJOVpklS1a4i3uf9F+mkYOMVcjH7sLT5smd 7P4FnrqI42sJLbzwdCcrCt9yJ7V7gysZo4eKDx/rzFJuHdqKbupd/dz1MhHPJ8ndwx9Z Tthw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=foilrSbQ; 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 65-v6si12394277pfe.49.2018.07.13.01.50.27; Fri, 13 Jul 2018 01:50:42 -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; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=foilrSbQ; 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 S1729786AbeGMJDK (ORCPT + 99 others); Fri, 13 Jul 2018 05:03:10 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:43243 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725930AbeGMJDJ (ORCPT ); Fri, 13 Jul 2018 05:03:09 -0400 Received: by mail-pl0-f68.google.com with SMTP id o7-v6so1546317plk.10 for ; Fri, 13 Jul 2018 01:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R/o6TouuzMj4hAi/E4zlw4tY9U6hfVq7zhgS150k4CM=; b=foilrSbQSZom81iuiqYfaxUok7w1mneZNBxCI++JvGoHvh5RiUV9SONRYjUbZiwvP4 QkBVuol9LRqgI907dfBs7hJbWr6AsfyuVdIC2JiSS82iR//x0tj8A+B58PZIgBWNfZPt r7hYMbfD0qGSanagYk6n1usZCpyqlsvy1nJmXfSIUrQCPJyLPJktk68SZ5IrQLQWSH6y nYAO63xlHuG5pPJtRxoM1DRb2BwTMv0tf1vT6BpJC36ku6sujaVM+WUosB2V8xxUdnXH mznswZnTvj6vDxQJwMzfWjDKSCHjSDggEW1z9F6htHQBnYOEWCaJd+KXkJJZrMJu2K9s QYtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R/o6TouuzMj4hAi/E4zlw4tY9U6hfVq7zhgS150k4CM=; b=FUXBA6wlAoFk6Y+6MzUrjpxxqqfRoslfbiAYFQ1GFVpzPqMPJd/a5sIIjzcR7rwDZZ 0b5VBpLc2yqVpLr1/yV43d3ihaYV8FSnqntFfE9rPC8U9wnR+heQIpDivwpwqCeJCz5S ZazglM1/3zGs30FjtTFquPdpTkAqG3SDMhkUH4aYRfVNeaw/st4APKYPDRlxTYxq5/FE 0Ng0tz0Mw1s+L1CNVblqQNtq86fgMrSd4Q2qSVxPVf9cdLRhwNfZh8jFFlo75xDYOdEV FqcvM0udA7WZGNULfDRprQZek0a9IWpx8mtAWEf8cbCm4IfoGXpzJ0j8CwXIJxrHmdcB EPkw== X-Gm-Message-State: AOUpUlGPACTVH8t4JcJ8KeduimYOmKxTg0NIeFMxChtzLfNsIta5dO1Y egAG4ttpUA28dx/F2GVd50tBQQ== X-Received: by 2002:a17:902:5a3:: with SMTP id f32-v6mr5433741plf.109.1531471769737; Fri, 13 Jul 2018 01:49:29 -0700 (PDT) Received: from skyninja.hgst.com (rap-us.hgst.com. [199.255.44.250]) by smtp.gmail.com with ESMTPSA id d18-v6sm569357pgo.74.2018.07.13.01.49.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jul 2018 01:49:28 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, bart.vanassche@wdc.com, hans.holmberg@cnexlabs.com, javier@cnexlabs.com, hlitz@ucsc.edu, igor.j.konopko@intel.com, marcin.dziegielewski@intel.com, =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 05/10] lightnvm: pblk: fix read_bitmap for 32bit archs Date: Fri, 13 Jul 2018 10:48:40 +0200 Message-Id: <20180713084845.19511-6-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180713084845.19511-1-mb@lightnvm.io> References: <20180713084845.19511-1-mb@lightnvm.io> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If using pblk on a 32bit architecture, and there is a need to perform a partial read, the partial read bitmap will only have allocated 32 entries, where as 64 are needed. Make sure that the read_bitmap is initialized to 64bits on 32bit architectures as well. Signed-off-by: Matias Bjørling Reviewed-by: Igor Konopko Reviewed-by: Javier González --- drivers/lightnvm/pblk-read.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/lightnvm/pblk-read.c b/drivers/lightnvm/pblk-read.c index 6e93c489ce57..bcfc6ea86e9d 100644 --- a/drivers/lightnvm/pblk-read.c +++ b/drivers/lightnvm/pblk-read.c @@ -401,7 +401,7 @@ int pblk_submit_read(struct pblk *pblk, struct bio *bio) struct pblk_g_ctx *r_ctx; struct nvm_rq *rqd; unsigned int bio_init_idx; - unsigned long read_bitmap; /* Max 64 ppas per request */ + DECLARE_BITMAP(read_bitmap, NVM_MAX_VLBA); int ret = NVM_IO_ERR; /* logic error: lba out-of-bounds. Ignore read request */ @@ -413,7 +413,7 @@ int pblk_submit_read(struct pblk *pblk, struct bio *bio) generic_start_io_acct(q, READ, bio_sectors(bio), &pblk->disk->part0); - bitmap_zero(&read_bitmap, nr_secs); + bitmap_zero(read_bitmap, nr_secs); rqd = pblk_alloc_rqd(pblk, PBLK_READ); @@ -444,19 +444,19 @@ int pblk_submit_read(struct pblk *pblk, struct bio *bio) rqd->ppa_list = rqd->meta_list + pblk_dma_meta_size; rqd->dma_ppa_list = rqd->dma_meta_list + pblk_dma_meta_size; - pblk_read_ppalist_rq(pblk, rqd, bio, blba, &read_bitmap); + pblk_read_ppalist_rq(pblk, rqd, bio, blba, read_bitmap); } else { - pblk_read_rq(pblk, rqd, bio, blba, &read_bitmap); + pblk_read_rq(pblk, rqd, bio, blba, read_bitmap); } - if (bitmap_full(&read_bitmap, nr_secs)) { + if (bitmap_full(read_bitmap, nr_secs)) { atomic_inc(&pblk->inflight_io); __pblk_end_io_read(pblk, rqd, false); return NVM_IO_DONE; } /* All sectors are to be read from the device */ - if (bitmap_empty(&read_bitmap, rqd->nr_ppas)) { + if (bitmap_empty(read_bitmap, rqd->nr_ppas)) { struct bio *int_bio = NULL; /* Clone read bio to deal with read errors internally */ @@ -480,7 +480,7 @@ int pblk_submit_read(struct pblk *pblk, struct bio *bio) /* The read bio request could be partially filled by the write buffer, * but there are some holes that need to be read from the drive. */ - return pblk_partial_read(pblk, rqd, bio, bio_init_idx, &read_bitmap); + return pblk_partial_read(pblk, rqd, bio, bio_init_idx, read_bitmap); fail_rqd_free: pblk_free_rqd(pblk, rqd, PBLK_READ); -- 2.11.0