Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp646220imu; Fri, 11 Jan 2019 06:44:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN4J9B2ntD94/3AnUd6vZQREiYJsdSZML56GLwyNSVil6IvnMS+w8Lfao3iL9gb+CF3uMoLF X-Received: by 2002:a62:a510:: with SMTP id v16mr14739422pfm.18.1547217876440; Fri, 11 Jan 2019 06:44:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547217876; cv=none; d=google.com; s=arc-20160816; b=yLq77PcOOwrxVroJLCSWa6l9CXoo7n7QoP/aNbZ2C4eZ3DktyiDiAGTZdhrLRDb+Zz p94xuCvQa4XGHqEcefVqNh4D4LoO/IssZsUjnm7iKrklqeFSiRqVQw+DFzQBD7xLlmtR DrmvNstBsH0j4HTOjd6enCxe4VCAOFYCaqhFEqla3lb6v2MBk8eDbMDI8rkZZnJ6dahx OIbGdooAV3kszqUl5pc9RuWhzQoqYYYbAk6+11Fu/mCmBIQdk4UsK4HHzKEiLJjbrRCk LxPpdw8OcmN8v5viZEOLQXjfYBo6WM1FJrYmQ0k8Xhs/LlRut+UmDccv/Jc5HoKJPOUB J/Tw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rEfL0fChOTKMDVqY9faX9YTt6MAmBituq87knvim7qk=; b=CFDnxX9o0DdIjVjEU8UMfnDJuUKQW0Acyg7zmmnZVi/j9ZfVghiar0ZYyMGj3MQOqs 8OL3inLNHErk++1fGVlli8t1D+s+37HGk42Y56Ou6A75iqmJOc2Q0HL7TvoAEEqU58V2 0baiPGG3F+qSAu9kwjxYc9jHTWnBEg7+qN6ABIkLReu2UZJscGaGfMKJ86j2V74/l3pB otBZK2zaz+owQHJQLPj6/V7y7RtJxYOs8Q2YpMfqk1X89pQZWxifTSZr4/Jt0nE9tRsf vt1P6fH2TJDHKXAeKSNKHVnfhhU4qDJsmSeVxKHQRsxkOWsaVk0lZB0nN3NdePHys1pU LeGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MKBPA0en; 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 bb4si16929520plb.322.2019.01.11.06.44.21; Fri, 11 Jan 2019 06:44:36 -0800 (PST) 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=@kernel.org header.s=default header.b=MKBPA0en; 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 S2404204AbfAKOmj (ORCPT + 99 others); Fri, 11 Jan 2019 09:42:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:35350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404166AbfAKOme (ORCPT ); Fri, 11 Jan 2019 09:42:34 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D7FB2063F; Fri, 11 Jan 2019 14:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547217753; bh=zAUjmbnakdEAOukMuAN6RDNYv+t9bSVX6jLwyYqrXWw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MKBPA0enNvM1xfy7MRpe1EaSCee5QMFapLbWKSZprnsEX10qyYKkkfGbLWgSifKBO ibc8MpE9rYzroQEHGS9Qg2L3+HnpfV/eWVqU24QQzJvVUEb58XpwHloxGEFcxG3h2k hBjJ/TIXqkxNXjuy8Ls/Aer6l4N8z1c/rSlDXH5g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jens Axboe , Jaegeuk Kim , Mike Snitzer Subject: [PATCH 4.20 28/65] dm: do not allow readahead to limit IO size Date: Fri, 11 Jan 2019 15:15:14 +0100 Message-Id: <20190111131100.218159212@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131055.331350141@linuxfoundation.org> References: <20190111131055.331350141@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jaegeuk Kim commit c6d6e9b0f6b4201c77f2cea3964dd122697e3543 upstream. Update DM to set the bdi's io_pages. This fixes reads to be capped at the device's max request size (even if user's read IO exceeds the established readahead setting). Fixes: 9491ae4a ("mm: don't cap request size based on read-ahead setting") Cc: stable@vger.kernel.org Reviewed-by: Jens Axboe Signed-off-by: Jaegeuk Kim Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-table.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -1927,6 +1927,9 @@ void dm_table_set_restrictions(struct dm */ if (blk_queue_is_zoned(q)) blk_revalidate_disk_zones(t->md->disk); + + /* Allow reads to exceed readahead limits */ + q->backing_dev_info->io_pages = limits->max_sectors >> (PAGE_SHIFT - 9); } unsigned int dm_table_get_num_targets(struct dm_table *t)