From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF1B2C433B4 for ; Mon, 19 Apr 2021 16:50:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9858C61166 for ; Mon, 19 Apr 2021 16:50:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232598AbhDSQvP (ORCPT ); Mon, 19 Apr 2021 12:51:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:33116 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231674AbhDSQvO (ORCPT ); Mon, 19 Apr 2021 12:51:14 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 10B3BB30F; Mon, 19 Apr 2021 16:50:41 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 45999DA732; Mon, 19 Apr 2021 18:48:22 +0200 (CEST) Date: Mon, 19 Apr 2021 18:48:22 +0200 From: David Sterba To: Damien Le Moal Cc: "hch@infradead.org" , "dsterba@suse.cz" , "dm-devel@redhat.com" , Mike Snitzer , "linux-block@vger.kernel.org" , Jens Axboe , "linux-nvme@lists.infradead.org" , Christoph Hellwig , "linux-scsi@vger.kernel.org" , "Martin K . Petersen" , "linux-fsdevel@vger.kernel.org" , "linux-btrfs@vger.kernel.org" , David Sterba , Josef Bacik , Johannes Thumshirn , Shinichiro Kawasaki , Naohiro Aota Subject: Re: [PATCH 3/4] btrfs: zoned: fail mount if the device does not support zone append Message-ID: <20210419164822.GN7604@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Damien Le Moal , "hch@infradead.org" , "dm-devel@redhat.com" , Mike Snitzer , "linux-block@vger.kernel.org" , Jens Axboe , "linux-nvme@lists.infradead.org" , Christoph Hellwig , "linux-scsi@vger.kernel.org" , "Martin K . Petersen" , "linux-fsdevel@vger.kernel.org" , "linux-btrfs@vger.kernel.org" , David Sterba , Josef Bacik , Johannes Thumshirn , Shinichiro Kawasaki , Naohiro Aota References: <20210416030528.757513-1-damien.lemoal@wdc.com> <20210416030528.757513-4-damien.lemoal@wdc.com> <20210416161720.GA7604@twin.jikos.cz> <20210419092855.GA3223318@infradead.org> <20210419093921.GA3226573@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Mon, Apr 19, 2021 at 09:46:36AM +0000, Damien Le Moal wrote: > On 2021/04/19 18:41, hch@infradead.org wrote: > > On Mon, Apr 19, 2021 at 09:35:37AM +0000, Damien Le Moal wrote: > >> This is only to avoid someone from running zoned-btrfs on top of dm-crypt. > >> Without this patch, mount will be OK and file data writes will also actually be > >> OK. But all reads will miserably fail... I would rather have this patch in than > >> deal with the "bug reports" about btrfs failing to read files. No ? > >> > >> Note that like you, I dislike having to add such code. But it was my oversight > >> when I worked on getting dm-crypt to work on zoned drives. Zone append was > >> overlooked at that time... My bad, really. > > > > dm-crypt needs to stop pretending it supports zoned devices if it > > doesn't. Note that dm-crypt could fairly trivially support zone append > > by doing the same kind of emulation that the sd driver does. > > I am not so sure about the "trivial" but yes, it is feasible. Let me think about > something then. Whatever we do, performance with ZNS will no be great, for > sure... But for SMR HDDs, we likely will not notice any difference in performance. So this needs to be fixed outside of btrfs. The fix in btrfs would make sense in case we can't sync the dm-crypt and btrfs in a released kernel. Having a mount check sounds like a better option to me than to fail reads, we can revert it in a release once everything woks as expected.