From patchwork Mon Apr 8 13:31:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 10889551 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 71C111805 for ; Mon, 8 Apr 2019 13:31:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A31D28817 for ; Mon, 8 Apr 2019 13:31:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5649428814; Mon, 8 Apr 2019 13:31:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 064762881A for ; Mon, 8 Apr 2019 13:31:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726585AbfDHNbv (ORCPT ); Mon, 8 Apr 2019 09:31:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:52922 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726415AbfDHNbu (ORCPT ); Mon, 8 Apr 2019 09:31:50 -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 B8045AE54 for ; Mon, 8 Apr 2019 13:31:49 +0000 (UTC) From: Johannes Thumshirn To: David Sterba Cc: Linux BTRFS Mailinglist , Johannes Thumshirn Subject: [PATCH 0/2] btrfs-progs: provide command to dump checksums Date: Mon, 8 Apr 2019 15:31:44 +0200 Message-Id: <20190408133146.21355-1-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Provide a command to dump checksums from 'btrfs inspect-internal'. This command does a lookup for the given file's extents via FIEMAP (which is handy as it already skips holes) and walks the checksum tree printing all checksums of an extent. It is tested against different layouts of files with and without holes, but further testing done by others is highly appreciated. It is also available on github @ https://github.com/morbidrsa/btrfs-progs/tree/inspect-csums Changes since RFC: * Complete re-write using ioctl()s (FIEMAP and BTRFS_TREE_SEARCH_V2) to gather the extent and checksum informtion, as per David's (private) comment. * Re-named btrfs_lookup_csum() as per Qu's comment. Johannes Thumshirn (2): btrfs-progs: add 'btrfs inspect-internal csum-dump' command btrfs-progs: completion: wire-up dump-csum Makefile | 3 +- btrfs-completion | 4 +- cmds-inspect-dump-csum.c | 231 +++++++++++++++++++++++++++++++++++++++++++++++ cmds-inspect.c | 2 + commands.h | 2 + 5 files changed, 239 insertions(+), 3 deletions(-) create mode 100644 cmds-inspect-dump-csum.c