[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1395791307-23727-5-git-send-email-gwendal@chromium.org>
Date: Tue, 25 Mar 2014 16:48:26 -0700
From: Gwendal Grignou <gwendal@...omium.org>
To: axboe@...nel.dk, ulf.hansson@...aro.org
Cc: linux-mtd@...ts.infradead.org, linux-mmc@...r.kernel.org,
linux-kernel@...r.kernel.org,
Gwendal Grignou <gwendal@...omium.org>
Subject: [PATCH 4/4] Limit max_discard_sectors to UINT_MAX>>9
max_discard_sectors can not be larger than UINT_MAX>>9,
otherwise, there is a risk that discard requests would be merged
into a request larger than 4GB.
Signed-off-by: Gwendal Grignou <gwendal@...omium.org>
---
drivers/mtd/mtd_blkdevs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 5073cbc..e74090c 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -416,7 +416,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
if (tr->discard) {
queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, new->rq);
- new->rq->limits.max_discard_sectors = UINT_MAX;
+ new->rq->limits.max_discard_sectors = UINT_MAX >> 9;
}
gd->queue = new->rq;
--
1.9.1.423.g4596e3a
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists