From patchwork Sun Aug 5 10:39:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lu Fengqi X-Patchwork-Id: 10556097 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 7C0DB1708 for ; Sun, 5 Aug 2018 10:40:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70D5029941 for ; Sun, 5 Aug 2018 10:40:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6588929946; Sun, 5 Aug 2018 10:40:20 +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 0425B29941 for ; Sun, 5 Aug 2018 10:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726264AbeHEMoZ (ORCPT ); Sun, 5 Aug 2018 08:44:25 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:63684 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726159AbeHEMoZ (ORCPT ); Sun, 5 Aug 2018 08:44:25 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="43083796" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 05 Aug 2018 18:40:12 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 7BA244B41EE4 for ; Sun, 5 Aug 2018 18:40:08 +0800 (CST) Received: from fnst.localdomain (10.167.226.155) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.399.0; Sun, 5 Aug 2018 18:40:11 +0800 From: Lu Fengqi To: Subject: [RFC PATCH 0/4] undelete subvolume online version Date: Sun, 5 Aug 2018 18:39:57 +0800 Message-ID: <20180805104001.5488-1-lufq.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Originating-IP: [10.167.226.155] X-yoursite-MailScanner-ID: 7BA244B41EE4.ADBA9 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: lufq.fnst@cn.fujitsu.com 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 This patchset will add the BTRFS_IOC_SUBVOL_UNDELETE ioctl for online btrfs subvolume undelete. And btrfs subvolume undelete subcommand was added to btrfs-progs. So user can use the following command to recover all the subolume that is left on the device. The recovered subvolume will be link to dir named to . # btrfs subvolume undelete [-p ] btrfs online undelete version: https://github.com/littleroad/linux.git undelete btrfs-progs online undelete version: https://github.com/littleroad/btrfs-progs.git online_undelete Issue: #82 Lu Fengqi (4): btrfs: factor out btrfs_link_subvol from create_subvol btrfs: don't BUG_ON() in btrfs_link_subvol() btrfs: undelete: introduce btrfs_undelete_subvolume btrfs: undelete: Add the btrfs_ioctl_undelete fs/btrfs/ioctl.c | 270 +++++++++++++++++++++++++++++++++---- include/uapi/linux/btrfs.h | 9 ++ 2 files changed, 255 insertions(+), 24 deletions(-)