Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2463139yba; Mon, 15 Apr 2019 12:10:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwofvBWBFYnzW/B5CpYLUexXYIKyNqWDivI4M1VSaRM2j32AdQHO0ZWPwnz6b7V76maXYuG X-Received: by 2002:a63:7150:: with SMTP id b16mr69038698pgn.83.1555355416375; Mon, 15 Apr 2019 12:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555355416; cv=none; d=google.com; s=arc-20160816; b=ZVr1c/IQ0H++NjgME6H3Dz84aZkxhZdq2OtQzw8tpY6XdhZe1iNDGjtArM5NCng2WU Mre6xlQlhEPDBaGVUFqYB7wpDtq3B7MrWxkMoD+DTo2UAEDi7VuEjWdVuntKIPQrD5Pk GBx9IZ2aI7IUzijZ08w4TdNK9+Ogf5Nq8ELAsne1uhmsK6pP0yYV4bNsII+P0v9zVQvt jT1wBxsRdLyYXpOLL2jQwN7shdQOPEpDiBDLBeAnS845M6z2Jv8IVjupWD7cnX4mLUPq 4/X4b/XD3pW53ap+IPBqMlyaMKRETkQzH6rnHK1V/umroidjbGxuo/4pEb/cm82JBqYd CS2A== 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=e5hE+78dVO2JPk2NiZJTeKWQq5++Af2lRfuNSsZpdwM=; b=ZHKZQ75BteAdD8ycw6U+lpRX7o6jMnG70sgekD08M5Fj6eJFukZppkCP4BMERAneQe HZvyvaj1poIo+tpSCHNTwU92lE4CwVEWZ1AiCHomgYDYT88bOYEChzVzzgAlf6tFjeVK XImMoQtogYixPvh4hEXYwNEZmG4UlW9tAi1sPsfx10QcoVZ49Mp6dC1VD7SLKKEKTEiS /1W4phELtq3g6FIarD81nnwc3yfW+9ToB/KY9/LlJjxq8FdVFMmQPqmU0muf7W3VOkby yXhUV8N/tPZMaIhTkPOWoAdD+ghfTa9wV8qA88Ew8EQ7Xwe2bYOT2BD1xOfScR+9afjW AlJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tJBXVNmr; 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 m72si51226607pfj.279.2019.04.15.12.10.00; Mon, 15 Apr 2019 12:10:16 -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=tJBXVNmr; 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 S1730540AbfDOTIo (ORCPT + 99 others); Mon, 15 Apr 2019 15:08:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:44228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729986AbfDOTIl (ORCPT ); Mon, 15 Apr 2019 15:08:41 -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 D981B2087C; Mon, 15 Apr 2019 19:08:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555355320; bh=alvu8yXsL40D3/oWrozhqoH3ZUKn3MO5ypKF9biZPuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tJBXVNmrNiQeLQySI254PT9pHm8Iu4zE99u6/9y4dxkAsqu+1Z/Hmogm9gBSeh8Ti 0XVEPy3exzz7LMUzmoJNfMcYwuwOAlWjv5zaw7KNANu9lj0JI7P2t37k3ipb2wEuPJ e+c8xA6G4Wkpj6pWI21X8JrTZ40LOK7/qINkUDlU= 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 4.19 094/101] dm: revert 8f50e358153d ("dm: limit the max bio size as BIO_MAX_PAGES * PAGE_SIZE") Date: Mon, 15 Apr 2019 20:59:32 +0200 Message-Id: <20190415183745.344840516@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183740.341577907@linuxfoundation.org> References: <20190415183740.341577907@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 @@ -1007,15 +1007,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; }