From: Ronny Hegewald Date: Thu, 15 Oct 2015 18:50:46 +0000 (+0000) Subject: rbd: require stable pages if message data CRCs are enabled X-Git-Tag: v4.1.12-92~201^2~85 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=314e333edaccb1d35831844bf54f49695dfeb445;p=users%2Fjedix%2Flinux-maple.git rbd: require stable pages if message data CRCs are enabled Orabug: 22623812 commit bae818ee1577c27356093901a0ea48f672eda514 upstream. rbd requires stable pages, as it performs a crc of the page data before they are send to the OSDs. But since kernel 3.9 (patch 1d1d1a767206fbe5d4c69493b7e6d2a8d08cc0a0 "mm: only enforce stable page writes if the backing device requires it") it is not assumed anymore that block devices require stable pages. This patch sets the necessary flag to get stable pages back for rbd. In a ceph installation that provides multiple ext4 formatted rbd devices "bad crc" messages appeared regularly (ca 1 message every 1-2 minutes on every OSD that provided the data for the rbd) in the OSD-logs before this patch. After this patch this messages are pretty much gone (only ca 1-2 / month / OSD). Signed-off-by: Ronny Hegewald [idryomov@gmail.com: require stable pages only in crc case, changelog] [idryomov@gmail.com: backport to 3.18-4.2: context] Signed-off-by: Ilya Dryomov Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 3c38392d5697f28d62a2a910c2ec7aa700d0b2ad) Signed-off-by: Dan Duval --- diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index fe8f1e4b4c7c..4b4d9fce7387 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3797,6 +3797,9 @@ static int rbd_init_disk(struct rbd_device *rbd_dev) q->limits.discard_zeroes_data = 1; blk_queue_merge_bvec(q, rbd_merge_bvec); + if (!ceph_test_opt(rbd_dev->rbd_client->client, NOCRC)) + q->backing_dev_info.capabilities |= BDI_CAP_STABLE_WRITES; + disk->queue = q; q->queuedata = rbd_dev;