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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=ham 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 246E7C282CE for ; Tue, 4 Jun 2019 09:30:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F3814204FD for ; Tue, 4 Jun 2019 09:30:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726997AbfFDJaI (ORCPT ); Tue, 4 Jun 2019 05:30:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:35638 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726877AbfFDJaH (ORCPT ); Tue, 4 Jun 2019 05:30:07 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D8C3EAE1B; Tue, 4 Jun 2019 09:30:06 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id BC34DDA85E; Tue, 4 Jun 2019 11:30:58 +0200 (CEST) Date: Tue, 4 Jun 2019 11:30:58 +0200 From: David Sterba To: waxhead Cc: Johannes Thumshirn , David Sterba , Linux BTRFS Mailinglist , Chris Mason , Richard Weinberger , David Gstir , Nikolay Borisov Subject: Re: [PATCH v4 00/13] Add support for other checksums Message-ID: <20190604093058.GW15290@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, waxhead , Johannes Thumshirn , David Sterba , Linux BTRFS Mailinglist , Chris Mason , Richard Weinberger , David Gstir , Nikolay Borisov References: <20190603145859.7176-1-jthumshirn@suse.de> <78fb639b-3f2d-7cb5-77b7-fee7339a0449@dirtcellar.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <78fb639b-3f2d-7cb5-77b7-fee7339a0449@dirtcellar.net> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Mon, Jun 03, 2019 at 09:56:06PM +0200, waxhead wrote: > Johannes Thumshirn wrote: > > This patchset add support for adding new checksum types in BTRFS. > > > > Currently BTRFS only supports CRC32C as data and metadata checksum, which is > > good if you only want to detect errors due to data corruption in hardware. > > > > But CRC32C isn't able cover other use-cases like de-duplication or > > cryptographically save data integrity guarantees. > > > > The following properties made SHA-256 interesting for these use-cases: > > - Still considered cryptographically sound > > - Reasonably well understood by the security industry > > - Result fits into the 32Byte/256Bit we have for the checksum in the on-disk > > format > > - Small enough collision space to make it feasible for data de-duplication > > - Fast enough to calculate and offloadable to crypto hardware via the kernel's > > crypto_shash framework. > > > > The patchset also provides mechanisms for plumbing in different hash > > algorithms relatively easy. > > > > Howdy , being just a regular user I am in fact a bit concerned about > what happens to my delicious (it's butter after all) filesystems if I > happen to move disks between servers. Let's say server A has a > filesystem that support checksum type_1 and type_2 while server B only > supports type_1. > > If the filesystem only has checksum of type_2 stored I would assume that > server B won't be able to read the data. > > Ignoring checksums will kind of make BTRFS pointless, but I think this > is a good reason to consider adding a 'ignore-checksum' mount option - > at least it could make the data readable (RO) in a pinch. That's a good idea. The availability of checksum modules is unpredictable so we should provide some way to access the filesystem. > ....actually since you could always fall back to the original crc32c > then perhaps RO might not even be needed at all ?! The checksum type is per-filesystem, so write support cannot be enabled. Theoretically, switching checksum should be possible with scrub that will switch that on-the fly, but this needs to be tought out due the intermediate state.