Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp292046pxj; Fri, 14 May 2021 03:40:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCzqWcTT5oYvS5bVD45x4oPXMGO1lFGaQV+KsubNsdZ1gjiHYgr3BDJ3bjGPBKh3zIdhwW X-Received: by 2002:a17:907:a071:: with SMTP id ia17mr5329365ejc.17.1620988823558; Fri, 14 May 2021 03:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620988823; cv=none; d=google.com; s=arc-20160816; b=J++b/+uLIZUftpyr2F5hgz9pnY37097s6i8xTrp0jdRtZA7pugcTgqwp68tYPIkJfk GR19znJFB/9x7zU1yOnNwFLDQ+6UoQ0xdZ2MucBaNBo8hv8UTBUO239Kuh+7DXGxBX86 g0ByOAo/p9UdfALREG8cvcYWnVPx8+5SYBUUmFcXZUqf9AYPrzxJL0CNChZcIZYWjMFs sAEtgeUXFVT8LaVkh42Uh+uFdKQ+F2vQQY3jqE2OXHjlg+FW8i4ciFjUOdaw40h4eqOm 9er0qTDr9rv+7XX8L9YOD2LfLP8PZO1Xc7UCihw1qvWeQlBX9nu3zDR+/eNGJ+2LmuYa 18kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=05Af3bVZXrGJRy2+GfagSd6JI7OZwal3JL9/7JcdoT8=; b=qSgE/v/FY6hVGBDLPkxEuoR5XpldhFuuRKgWeRqqKrI2aSxSRe3LKa+LMfA4DndjcZ Erx5UaRv5mRbsc56c2FwSTwx5scvd1JAtUcb310spg6/jFsCaEVSIHR9nRVnRn3sgyF5 x724WnwX/9QCqH1cAS9EtH7dUWdw7tn+0QFBfIg7CN6gcf101qERUoUcLz8gdI9a16oK GbZwDz8wM32qRCALr53oAqBnempUK5ek66oE6RqfJDBCfBYDoszyiqY/5ExBstdfDhNd 3WdxkWN4EnblqNeSmYa5Bjga9qEKoVJKxBeSK0mGZtiR8d9elM1YLhwUjWRvIL+K5FEu Zmrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZkdaEcxc; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c18si5854459ejs.425.2021.05.14.03.40.00; Fri, 14 May 2021 03:40:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZkdaEcxc; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231180AbhENJpF (ORCPT + 99 others); Fri, 14 May 2021 05:45:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51087 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230236AbhENJpF (ORCPT ); Fri, 14 May 2021 05:45:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620985433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=05Af3bVZXrGJRy2+GfagSd6JI7OZwal3JL9/7JcdoT8=; b=ZkdaEcxcldo0XiLP+unIZ62NBCaLEv6wBqZ1GjXYiHrW67WGpKIiTXqxajOOcw1Y7H6+oI tLzPq58Lzpnnwcbs8gJW636TYgHaOKr+rgvWBsTk4EckMMEm13fe8buvsxfOZfqQqM9IFs e7k/PpR5ZxxS8rdKRuUE43ofWL+dyYs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-218-WqmhRHU7PHCcJPYyjHCMaA-1; Fri, 14 May 2021 05:43:52 -0400 X-MC-Unique: WqmhRHU7PHCcJPYyjHCMaA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 203D61007480; Fri, 14 May 2021 09:43:50 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A507F1971B; Fri, 14 May 2021 09:43:39 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id 14E9hd7S022799; Fri, 14 May 2021 05:43:39 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 14E9haED022795; Fri, 14 May 2021 05:43:36 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Fri, 14 May 2021 05:43:36 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Bart Van Assche cc: Milan Broz , "Theodore Ts'o" , Changheun Lee , alex_y_xu@yahoo.ca, axboe@kernel.dk, bgoncalv@redhat.com, dm-crypt@saout.de, hch@lst.de, jaegeuk@kernel.org, linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, ming.lei@redhat.com, yi.zhang@redhat.com, dm-devel@redhat.com Subject: Re: regression: data corruption with ext4 on LUKS on nvme with torvalds master In-Reply-To: Message-ID: References: <0e7b0b6e-e78c-f22d-af8d-d7bdcb597bea@gmail.com> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, 13 May 2021, Bart Van Assche wrote: > On 5/13/21 12:22 PM, Mikulas Patocka wrote: > > We already had problems with too large bios in dm-crypt and we fixed it by > > adding this piece of code: > > > > /* > > * Check if bio is too large, split as needed. > > */ > > if (unlikely(bio->bi_iter.bi_size > (BIO_MAX_VECS << PAGE_SHIFT)) && > > (bio_data_dir(bio) == WRITE || cc->on_disk_tag_size)) > > dm_accept_partial_bio(bio, ((BIO_MAX_VECS << PAGE_SHIFT) >> SECTOR_SHIFT)); > > > > It will ask the device mapper to split the bio if it is too large. So, > > crypt_alloc_buffer can't receive a bio that is larger than BIO_MAX_VECS << > > PAGE_SHIFT. > > Hi Mikulas, > > Are you perhaps referring to commit 4e870e948fba ("dm crypt: fix error > with too large bios")? Did that commit go upstream before multi-page > bvec support? Yes. It's from 2016. > Can larger bios be supported in case of two or more > contiguous pages now that multi-page bvec support is upstream? No - we need to allocate a buffer for the written data. The buffer size is limited to PAGE_SIZE * BIO_MAX_VECS. > Thanks, > > Bart. Mikulas