On Mon, Jan 13, 2020 at 07:31:58PM +0800, Qu Wenruo wrote: > On 2020/1/13 下午4:45, Sebastian Döring wrote: > > just a quick question: Will it be possible to convert existing btrfs > > to a different csum hash? It seems viable to re-read all > > data&metadata, verify existing checksums, and then recalculate a new > > one. > > Yes, but consideration the complexity, it's not suitable for kernel i guess. Yeah, not for kernel. > > I'm pretty excited about the inclusion of xxhash and am wondering if I > > have to recreate the whole fs at some point... > > Considering there is the use case, we may consider add such ability to > btrfs-progs. > > Since we already have things like btrfstune -M to change UUID, we may be > able to do that. The UUID change rewrites the same bytes, all the new checksums need more bytes for the data checksum items so this requires COWing all checksum tree leaves. Handling all the intermediate cases (interruption/crash in the middle of the conversion) would be harder than for the UUID change. The overall run time would be longer due to more blocks to rewrite, so there's enough complexity and risk on the way.
