Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2468747yba; Mon, 15 Apr 2019 12:16:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGXgQN7d9umvY0fHFSz7flMhx3Qdo+GYpI8qTy0CYUcMhqxOZW1709Jwf2Y4CEMB+fR2MD X-Received: by 2002:a65:4489:: with SMTP id l9mr70458951pgq.1.1555355804860; Mon, 15 Apr 2019 12:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555355804; cv=none; d=google.com; s=arc-20160816; b=nH4pXFkcJlGe2asnisQRPtG07YipwgFcZXpMi6lptoIdzgcZCOanG3Z6tpMR6HWZS+ K4WvBiqdK7U1/KFyay35F4rztLB5GM0uHIiYsIJ7SuHokbCy2xi8E4BVtzXQDdfFm5rQ o5Z1RzzkcQT6nwBvYl7PuNhmOAHD0yQzwdhUM6SRwOzcojlOCDuyGEzFBbbiew7rtgyU Wcl4upL+ACl4xdWKj3qpg1+0vp7k92r+LMJga+W6pRHIkA6BIsUC7a0S1uws7pFfCZnk VDWcUJYfY8dAhL3e+9E1KgRrQj2o8OyfPy+SiVL3lbOliCnQwEvJctgLMGnBnqJ8svK0 hHoA== 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=6HVcPh8k31VzGMdMHFQrAJmnt9iyO3Ej6WisM9hXOSE=; b=yluJx5VHO8PvqmbK12b6govNgazsG0aKv17RpytDC6XaVcfV6Oy4OZXYWtAmHJa+A7 gMo3cmllD9NgbFxDdEbcakugSzCJqtkvsxS2FNIy/LTNTUZ469NaFOFQ4t41NaxpoBfy ZhDbj52OCyj6S0YWOpDrEesX/0LJWgeGfAg6QG2UE6sDDYqDlNiApoJvG/6XP/PL5Nm4 tBoJzQp0b49rt01mlTeZiCOhcvnwwfx4jvMULpzuMRzhonmMt3doraZoAfzKZH35Ne90 5Rz9TVfhihrOBuIBroiPtltXaqgFbaizq6qcN6u1+mc5GNw3ubqwjnabCSp+wy+BJhyW 4v3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ByaIu3i4; 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 c25si17368510pfr.94.2019.04.15.12.16.28; Mon, 15 Apr 2019 12:16:44 -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=@kernel.org header.s=default header.b=ByaIu3i4; 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 S1731465AbfDOTPO (ORCPT + 99 others); Mon, 15 Apr 2019 15:15:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:52538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731724AbfDOTOT (ORCPT ); Mon, 15 Apr 2019 15:14:19 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 41C82218FC; Mon, 15 Apr 2019 19:14:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555355658; bh=BcNvGjFBZ+Y8wDYg0lU0haPKSLlVNuMeOWSxsvhXEW8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ByaIu3i4uMwsP5ADSQ/Sdgxqzus+zSbfsZWkBFCZS8hqx2nu00XMRmin3sDe3rGh+ W9yOXsvbfLM6Dw2HTmKOwpJY2z2ofaU1P3N111e8eA2eQDox+kOV9ccr/8Ag96gCLE nsaU9+v+7qbonXAkXkN9fQHCZBig6X/wEiFuxsuk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mikulas Patocka , Ming Lei , Mike Snitzer Subject: [PATCH 5.0 111/117] dm: revert 8f50e358153d ("dm: limit the max bio size as BIO_MAX_PAGES * PAGE_SIZE") Date: Mon, 15 Apr 2019 21:01:21 +0200 Message-Id: <20190415183750.396263755@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183744.887851196@linuxfoundation.org> References: <20190415183744.887851196@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Mikulas Patocka commit 75ae193626de3238ca5fb895868ec91c94e63b1b upstream. The limit was already incorporated to dm-crypt with commit 4e870e948fba ("dm crypt: fix error with too large bios"), so we don't need to apply it globally to all targets. The quantity BIO_MAX_PAGES * PAGE_SIZE is wrong anyway because the variable ti->max_io_len it is supposed to be in the units of 512-byte sectors not in bytes. Reduction of the limit to 1048576 sectors could even cause data corruption in rare cases - suppose that we have a dm-striped device with stripe size 768MiB. The target will call dm_set_target_max_io_len with the value 1572864. The buggy code would reduce it to 1048576. Now, the dm-core will errorneously split the bios on 1048576-sector boundary insetad of 1572864-sector boundary and pass these stripe-crossing bios to the striped target. Cc: stable@vger.kernel.org # v4.16+ Fixes: 8f50e358153d ("dm: limit the max bio size as BIO_MAX_PAGES * PAGE_SIZE") Signed-off-by: Mikulas Patocka Acked-by: Ming Lei Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1060,15 +1060,7 @@ int dm_set_target_max_io_len(struct dm_t return -EINVAL; } - /* - * BIO based queue uses its own splitting. When multipage bvecs - * is switched on, size of the incoming bio may be too big to - * be handled in some targets, such as crypt. - * - * When these targets are ready for the big bio, we can remove - * the limit. - */ - ti->max_io_len = min_t(uint32_t, len, BIO_MAX_PAGES * PAGE_SIZE); + ti->max_io_len = (uint32_t) len; return 0; }