From patchwork Mon Sep 13 13:17:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 12489125 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 F16EDC43219 for ; Mon, 13 Sep 2021 13:18:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DD5DA6121F for ; Mon, 13 Sep 2021 13:18:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239715AbhIMNTw (ORCPT ); Mon, 13 Sep 2021 09:19:52 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:39380 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238759AbhIMNSr (ORCPT ); Mon, 13 Sep 2021 09:18:47 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 39DFD21FEE; Mon, 13 Sep 2021 13:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631539051; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vv/gG8G89P6rFNPsnWEw6K7c21EAxPPukjRDdyBNNxA=; b=jPqaKyMZPZFAtb1N+2qHrQvRB3zl5yurJ1XRIjkkV++mu0S6bBqRmRvGFwd2+yL5TAaJW3 461wzPc3MgtF7//e6uWiYq4uKA4yGtOiihEUn3MwtOk5KVlntfd+A0EmZCLjrXTSBY+8Kz MUN5NOVuLtAgymx2049YYxJJjl17n60= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0BE1813AB4; Mon, 13 Sep 2021 13:17:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id QHiDAGtPP2FNOwAAMHmgww (envelope-from ); Mon, 13 Sep 2021 13:17:31 +0000 From: Nikolay Borisov To: linux-btrfs@vger.kernel.org Cc: Nikolay Borisov Subject: [PATCH 1/8] btrfs-progs: Add btrfs_is_empty_uuid Date: Mon, 13 Sep 2021 16:17:22 +0300 Message-Id: <20210913131729.37897-2-nborisov@suse.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210913131729.37897-1-nborisov@suse.com> References: <20210913131729.37897-1-nborisov@suse.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org This utility function is needed by the RO->RW snapshot detection code. Signed-off-by: Nikolay Borisov --- kernel-shared/ctree.h | 2 ++ kernel-shared/uuid-tree.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h index 3cca60323e3d..f53436a7f38b 100644 --- a/kernel-shared/ctree.h +++ b/kernel-shared/ctree.h @@ -2860,6 +2860,8 @@ int btrfs_lookup_uuid_received_subvol_item(int fd, const u8 *uuid, int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans, u8 *uuid, u8 type, u64 subvol_id_cpu); +int btrfs_is_empty_uuid(u8 *uuid); + static inline int is_fstree(u64 rootid) { if (rootid == BTRFS_FS_TREE_OBJECTID || diff --git a/kernel-shared/uuid-tree.c b/kernel-shared/uuid-tree.c index 21115a4d2d09..51a7b5d9ff5d 100644 --- a/kernel-shared/uuid-tree.c +++ b/kernel-shared/uuid-tree.c @@ -109,3 +109,14 @@ int btrfs_lookup_uuid_received_subvol_item(int fd, const u8 *uuid, BTRFS_UUID_KEY_RECEIVED_SUBVOL, subvol_id); } + +int btrfs_is_empty_uuid(u8 *uuid) +{ + int i; + + for (i = 0; i < BTRFS_UUID_SIZE; i++) { + if (uuid[i]) + return 0; + } + return 1; +} From patchwork Mon Sep 13 13:17:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 12489359 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 212DBC433FE for ; Mon, 13 Sep 2021 13:30:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F30FA6140B for ; Mon, 13 Sep 2021 13:30:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241887AbhIMNbL (ORCPT ); Mon, 13 Sep 2021 09:31:11 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:50736 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238877AbhIMNSs (ORCPT ); Mon, 13 Sep 2021 09:18:48 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 79B431FFDA; Mon, 13 Sep 2021 13:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631539051; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DTfYwhYy3preHzStIUWk1Rr5+JA231Ru2Tn/uw4BtMw=; b=gK8/61fbHdp1hD2upojV6TH7rxbfncgmd8Y8V8x4OHcsW1xawW3Aovzk+WRIS8AH24WEgi 0KJUSUpedmSEcnYiNcdEDt2csarT0QN1hAhAZDfKY/Kzo9jYGN5FrbfJE3TpmeRkm8V9qD 1BKaty3y+e9vyh6m4nMRTrmh4BAQKhY= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 49F7C13AB4; Mon, 13 Sep 2021 13:17:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0LuCD2tPP2FNOwAAMHmgww (envelope-from ); Mon, 13 Sep 2021 13:17:31 +0000 From: Nikolay Borisov To: linux-btrfs@vger.kernel.org Cc: Nikolay Borisov Subject: [PATCH 2/8] btrfs-progs: Remove root argument from btrfs_fixup_low_keys Date: Mon, 13 Sep 2021 16:17:23 +0300 Message-Id: <20210913131729.37897-3-nborisov@suse.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210913131729.37897-1-nborisov@suse.com> References: <20210913131729.37897-1-nborisov@suse.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org It's not used, so just remove it. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo --- check/main.c | 5 ++--- kernel-shared/ctree.c | 24 +++++++++++------------- kernel-shared/ctree.h | 4 ++-- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/check/main.c b/check/main.c index a88518159830..6369bdd90656 100644 --- a/check/main.c +++ b/check/main.c @@ -4197,8 +4197,7 @@ static int swap_values(struct btrfs_root *root, struct btrfs_path *path, struct btrfs_disk_key key; btrfs_node_key(buf, &key, 0); - btrfs_fixup_low_keys(root, path, &key, - btrfs_header_level(buf) + 1); + btrfs_fixup_low_keys(path, &key, btrfs_header_level(buf) + 1); } } else { struct btrfs_item *item1, *item2; @@ -4302,7 +4301,7 @@ static int delete_bogus_item(struct btrfs_root *root, struct btrfs_disk_key disk_key; btrfs_item_key(buf, &disk_key, 0); - btrfs_fixup_low_keys(root, path, &disk_key, 1); + btrfs_fixup_low_keys(path, &disk_key, 1); } btrfs_mark_buffer_dirty(buf); return 0; diff --git a/kernel-shared/ctree.c b/kernel-shared/ctree.c index 518718de04dd..02eb975338e5 100644 --- a/kernel-shared/ctree.c +++ b/kernel-shared/ctree.c @@ -1437,8 +1437,8 @@ int btrfs_search_slot_for_read(struct btrfs_root *root, * fixing up pointers when a given leaf/node is not in slot 0 of the * higher levels */ -void btrfs_fixup_low_keys(struct btrfs_root *root, struct btrfs_path *path, - struct btrfs_disk_key *key, int level) +void btrfs_fixup_low_keys( struct btrfs_path *path, struct btrfs_disk_key *key, + int level) { int i; struct extent_buffer *t; @@ -1485,7 +1485,7 @@ int btrfs_set_item_key_safe(struct btrfs_root *root, struct btrfs_path *path, btrfs_set_item_key(eb, &disk_key, slot); btrfs_mark_buffer_dirty(eb); if (slot == 0) - btrfs_fixup_low_keys(root, path, &disk_key, 1); + btrfs_fixup_low_keys(path, &disk_key, 1); return 0; } @@ -1508,7 +1508,7 @@ void btrfs_set_item_key_unsafe(struct btrfs_root *root, btrfs_set_item_key(eb, &disk_key, slot); btrfs_mark_buffer_dirty(eb); if (slot == 0) - btrfs_fixup_low_keys(root, path, &disk_key, 1); + btrfs_fixup_low_keys(path, &disk_key, 1); } /* @@ -2184,7 +2184,7 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root btrfs_mark_buffer_dirty(right); btrfs_item_key(right, &disk_key, 0); - btrfs_fixup_low_keys(root, path, &disk_key, 1); + btrfs_fixup_low_keys(path, &disk_key, 1); /* then fixup the leaf pointer in the path */ if (path->slots[0] < push_items) { @@ -2415,10 +2415,8 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans, free_extent_buffer(path->nodes[0]); path->nodes[0] = right; path->slots[0] = 0; - if (path->slots[1] == 0) { - btrfs_fixup_low_keys(root, path, - &disk_key, 1); - } + if (path->slots[1] == 0) + btrfs_fixup_low_keys(path, &disk_key, 1); } btrfs_mark_buffer_dirty(right); return ret; @@ -2632,7 +2630,7 @@ int btrfs_truncate_item(struct btrfs_root *root, struct btrfs_path *path, btrfs_set_disk_key_offset(&disk_key, offset + size_diff); btrfs_set_item_key(leaf, &disk_key, slot); if (slot == 0) - btrfs_fixup_low_keys(root, path, &disk_key, 1); + btrfs_fixup_low_keys(path, &disk_key, 1); } item = btrfs_item_nr(slot); @@ -2809,7 +2807,7 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans, ret = 0; if (slot == 0) { btrfs_cpu_key_to_disk(&disk_key, cpu_key); - btrfs_fixup_low_keys(root, path, &disk_key, 1); + btrfs_fixup_low_keys(path, &disk_key, 1); } if (btrfs_leaf_free_space(leaf) < 0) { @@ -2882,7 +2880,7 @@ int btrfs_del_ptr(struct btrfs_root *root, struct btrfs_path *path, struct btrfs_disk_key disk_key; btrfs_node_key(parent, &disk_key, 0); - btrfs_fixup_low_keys(root, path, &disk_key, level + 1); + btrfs_fixup_low_keys(path, &disk_key, level + 1); } btrfs_mark_buffer_dirty(parent); return ret; @@ -2982,7 +2980,7 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_disk_key disk_key; btrfs_item_key(leaf, &disk_key, 0); - btrfs_fixup_low_keys(root, path, &disk_key, 1); + btrfs_fixup_low_keys(path, &disk_key, 1); } /* delete the leaf if it is mostly empty */ diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h index f53436a7f38b..a17bf50e29b4 100644 --- a/kernel-shared/ctree.h +++ b/kernel-shared/ctree.h @@ -2747,8 +2747,8 @@ static inline int btrfs_next_item(struct btrfs_root *root, int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path); int btrfs_leaf_free_space(struct extent_buffer *leaf); -void btrfs_fixup_low_keys(struct btrfs_root *root, struct btrfs_path *path, - struct btrfs_disk_key *key, int level); +void btrfs_fixup_low_keys(struct btrfs_path *path, struct btrfs_disk_key *key, + int level); int btrfs_set_item_key_safe(struct btrfs_root *root, struct btrfs_path *path, struct btrfs_key *new_key); void btrfs_set_item_key_unsafe(struct btrfs_root *root, From patchwork Mon Sep 13 13:17:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 12489363 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 724B4C433EF for ; Mon, 13 Sep 2021 13:30:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D6F76135E for ; Mon, 13 Sep 2021 13:30:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242199AbhIMNbP (ORCPT ); Mon, 13 Sep 2021 09:31:15 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:50744 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238899AbhIMNSs (ORCPT ); Mon, 13 Sep 2021 09:18:48 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BAEC31FFDF; Mon, 13 Sep 2021 13:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631539051; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6Z8sdsSx61uc8UqwpiRZKcEMHPq2smxsJMsCiQfDkxI=; b=kaPvwAhHCVAukKz85Cju3Fx+KH3Aw8mThVTfdOyNn1OT4WhTElHdoKtgDOw6jUePaIpD/Z Gki+6NSBVeJj9nMr6bp7okgo2T/VihcivV7e4LU5v/WoP0cSfMuAmOh/4cTpbCvAyvywAJ N92A6fK+n9pH3mFotQFfjEvSarXkhzk= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 89D4013AB4; Mon, 13 Sep 2021 13:17:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gOs4H2tPP2FNOwAAMHmgww (envelope-from ); Mon, 13 Sep 2021 13:17:31 +0000 From: Nikolay Borisov To: linux-btrfs@vger.kernel.org Cc: Nikolay Borisov Subject: [PATCH 3/8] btrfs-progs: Remove fs_info argument from leaf_data_end Date: Mon, 13 Sep 2021 16:17:24 +0300 Message-Id: <20210913131729.37897-4-nborisov@suse.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210913131729.37897-1-nborisov@suse.com> References: <20210913131729.37897-1-nborisov@suse.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The function already takes an extent_buffer which has a reference to the owning filesystem's fs_info. This also brings the function in line with the kernel's signature. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo --- kernel-shared/ctree.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/kernel-shared/ctree.c b/kernel-shared/ctree.c index 02eb975338e5..77766c2a7931 100644 --- a/kernel-shared/ctree.c +++ b/kernel-shared/ctree.c @@ -557,12 +557,11 @@ static int btrfs_comp_keys(struct btrfs_disk_key *disk, * this returns the address of the start of the last item, * which is the stop of the leaf data stack */ -static inline unsigned int leaf_data_end(const struct btrfs_fs_info *fs_info, - const struct extent_buffer *leaf) +static inline unsigned int leaf_data_end(const struct extent_buffer *leaf) { u32 nr = btrfs_header_nritems(leaf); if (nr == 0) - return BTRFS_LEAF_DATA_SIZE(fs_info); + return BTRFS_LEAF_DATA_SIZE(leaf->fs_info); return btrfs_item_offset_nr(leaf, nr - 1); } @@ -1980,10 +1979,10 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root right_nritems = btrfs_header_nritems(right); push_space = btrfs_item_end_nr(left, left_nritems - push_items); - push_space -= leaf_data_end(fs_info, left); + push_space -= leaf_data_end(left); /* make room in the right data area */ - data_end = leaf_data_end(fs_info, right); + data_end = leaf_data_end(right); memmove_extent_buffer(right, btrfs_leaf_data(right) + data_end - push_space, btrfs_leaf_data(right) + data_end, @@ -1992,8 +1991,7 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root /* copy from the left data area */ copy_extent_buffer(right, left, btrfs_leaf_data(right) + BTRFS_LEAF_DATA_SIZE(root->fs_info) - push_space, - btrfs_leaf_data(left) + leaf_data_end(fs_info, left), - push_space); + btrfs_leaf_data(left) + leaf_data_end(left), push_space); memmove_extent_buffer(right, btrfs_item_nr_offset(push_items), btrfs_item_nr_offset(0), @@ -2130,7 +2128,7 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root btrfs_item_offset_nr(right, push_items -1); copy_extent_buffer(left, right, btrfs_leaf_data(left) + - leaf_data_end(fs_info, left) - push_space, + leaf_data_end(left) - push_space, btrfs_leaf_data(right) + btrfs_item_offset_nr(right, push_items - 1), push_space); @@ -2157,13 +2155,12 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root if (push_items < right_nritems) { push_space = btrfs_item_offset_nr(right, push_items - 1) - - leaf_data_end(fs_info, right); + leaf_data_end(right); memmove_extent_buffer(right, btrfs_leaf_data(right) + BTRFS_LEAF_DATA_SIZE(root->fs_info) - push_space, btrfs_leaf_data(right) + - leaf_data_end(fs_info, right), - push_space); + leaf_data_end(right), push_space); memmove_extent_buffer(right, btrfs_item_nr_offset(0), btrfs_item_nr_offset(push_items), @@ -2222,8 +2219,7 @@ static noinline int copy_for_split(struct btrfs_trans_handle *trans, nritems = nritems - mid; btrfs_set_header_nritems(right, nritems); - data_copy_size = btrfs_item_end_nr(l, mid) - - leaf_data_end(root->fs_info, l); + data_copy_size = btrfs_item_end_nr(l, mid) - leaf_data_end(l); copy_extent_buffer(right, l, btrfs_item_nr_offset(0), btrfs_item_nr_offset(mid), @@ -2231,9 +2227,8 @@ static noinline int copy_for_split(struct btrfs_trans_handle *trans, copy_extent_buffer(right, l, btrfs_leaf_data(right) + - BTRFS_LEAF_DATA_SIZE(root->fs_info) - - data_copy_size, btrfs_leaf_data(l) + - leaf_data_end(root->fs_info, l), data_copy_size); + BTRFS_LEAF_DATA_SIZE(root->fs_info) - data_copy_size, + btrfs_leaf_data(l) + leaf_data_end(l), data_copy_size); rt_data_off = BTRFS_LEAF_DATA_SIZE(root->fs_info) - btrfs_item_end_nr(l, mid); @@ -2572,7 +2567,7 @@ int btrfs_truncate_item(struct btrfs_root *root, struct btrfs_path *path, return 0; nritems = btrfs_header_nritems(leaf); - data_end = leaf_data_end(root->fs_info, leaf); + data_end = leaf_data_end(leaf); old_data_start = btrfs_item_offset_nr(leaf, slot); @@ -2661,7 +2656,7 @@ int btrfs_extend_item(struct btrfs_root *root, struct btrfs_path *path, leaf = path->nodes[0]; nritems = btrfs_header_nritems(leaf); - data_end = leaf_data_end(root->fs_info, leaf); + data_end = leaf_data_end(leaf); if (btrfs_leaf_free_space(leaf) < data_size) { btrfs_print_leaf(leaf, BTRFS_PRINT_TREE_DEFAULT); @@ -2747,7 +2742,7 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans, leaf = path->nodes[0]; nritems = btrfs_header_nritems(leaf); - data_end = leaf_data_end(root->fs_info, leaf); + data_end = leaf_data_end(leaf); if (btrfs_leaf_free_space(leaf) < total_size) { btrfs_print_leaf(leaf, BTRFS_PRINT_TREE_DEFAULT); @@ -2940,7 +2935,7 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, nritems = btrfs_header_nritems(leaf); if (slot + nr != nritems) { - int data_end = leaf_data_end(root->fs_info, leaf); + int data_end = leaf_data_end(leaf); memmove_extent_buffer(leaf, btrfs_leaf_data(leaf) + data_end + dsize, From patchwork Mon Sep 13 13:17:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 12489127 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 980DFC433F5 for ; Mon, 13 Sep 2021 13:18:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81020610A8 for ; Mon, 13 Sep 2021 13:18:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240114AbhIMNTz (ORCPT ); Mon, 13 Sep 2021 09:19:55 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:39388 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239005AbhIMNSs (ORCPT ); Mon, 13 Sep 2021 09:18:48 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0632A21FEA; Mon, 13 Sep 2021 13:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631539052; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2ELKfB0wS2JMFkwwip3HTY+dG+iHdYfDky85+wbq8+I=; b=pYRQoSvxSX56pCLLex24SswZqFzQPS13nAEMsCCTEnE6plQcFpXg35b2TNAaryo/Cwlbt0 mOUDlOB+iDgEammp6BIO+xR//mI6sOcPqcZ0OayyPmVO2p9Xl9JqGv6ehnCjWfSq4i/+yI YgmH1mhHNzlaYJaDT06LeQnK18dIO9g= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C9B9213AB4; Mon, 13 Sep 2021 13:17:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gHysLmtPP2FNOwAAMHmgww (envelope-from ); Mon, 13 Sep 2021 13:17:31 +0000 From: Nikolay Borisov To: linux-btrfs@vger.kernel.org Cc: Nikolay Borisov Subject: [PATCH 4/8] btrfs-progs: Remove root argument from btrfs_truncate_item Date: Mon, 13 Sep 2021 16:17:25 +0300 Message-Id: <20210913131729.37897-5-nborisov@suse.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210913131729.37897-1-nborisov@suse.com> References: <20210913131729.37897-1-nborisov@suse.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org This function lies in the kernel-shared directory and is supposed to be close to 1:1 copy with its kernel counterpart, yet it takes one extra argument - root. But this is now unused to simply remove it. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo --- kernel-shared/ctree.c | 3 +-- kernel-shared/ctree.h | 3 +-- kernel-shared/dir-item.c | 2 +- kernel-shared/extent-tree.c | 2 +- kernel-shared/file-item.c | 4 ++-- kernel-shared/inode-item.c | 4 ++-- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/kernel-shared/ctree.c b/kernel-shared/ctree.c index 77766c2a7931..78f94c6cd42f 100644 --- a/kernel-shared/ctree.c +++ b/kernel-shared/ctree.c @@ -2545,8 +2545,7 @@ int btrfs_split_item(struct btrfs_trans_handle *trans, return ret; } -int btrfs_truncate_item(struct btrfs_root *root, struct btrfs_path *path, - u32 new_size, int from_end) +int btrfs_truncate_item(struct btrfs_path *path, u32 new_size, int from_end) { int ret = 0; int slot; diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h index a17bf50e29b4..91a85796a678 100644 --- a/kernel-shared/ctree.h +++ b/kernel-shared/ctree.h @@ -2670,8 +2670,7 @@ int btrfs_create_root(struct btrfs_trans_handle *trans, struct btrfs_fs_info *fs_info, u64 objectid); int btrfs_extend_item(struct btrfs_root *root, struct btrfs_path *path, u32 data_size); -int btrfs_truncate_item(struct btrfs_root *root, struct btrfs_path *path, - u32 new_size, int from_end); +int btrfs_truncate_item(struct btrfs_path *path, u32 new_size, int from_end); int btrfs_split_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, diff --git a/kernel-shared/dir-item.c b/kernel-shared/dir-item.c index 7dc606c132b5..590b79a929d3 100644 --- a/kernel-shared/dir-item.c +++ b/kernel-shared/dir-item.c @@ -284,7 +284,7 @@ int btrfs_delete_one_dir_name(struct btrfs_trans_handle *trans, start = btrfs_item_ptr_offset(leaf, path->slots[0]); memmove_extent_buffer(leaf, ptr, ptr + sub_item_len, item_len - (ptr + sub_item_len - start)); - btrfs_truncate_item(root, path, item_len - sub_item_len, 1); + btrfs_truncate_item(path, item_len - sub_item_len, 1); } return ret; } diff --git a/kernel-shared/extent-tree.c b/kernel-shared/extent-tree.c index 056a9256b9a4..a8e0c1e60e2e 100644 --- a/kernel-shared/extent-tree.c +++ b/kernel-shared/extent-tree.c @@ -1166,7 +1166,7 @@ static int update_inline_extent_backref(struct btrfs_trans_handle *trans, memmove_extent_buffer(leaf, ptr, ptr + size, end - ptr - size); item_size -= size; - ret = btrfs_truncate_item(root, path, item_size, 1); + ret = btrfs_truncate_item(path, item_size, 1); BUG_ON(ret); } btrfs_mark_buffer_dirty(leaf); diff --git a/kernel-shared/file-item.c b/kernel-shared/file-item.c index 7e16b747e36c..c910e27e5a5d 100644 --- a/kernel-shared/file-item.c +++ b/kernel-shared/file-item.c @@ -362,7 +362,7 @@ static noinline int truncate_one_csum(struct btrfs_root *root, */ u32 new_size = (bytenr - key->offset) / blocksize; new_size *= csum_size; - ret = btrfs_truncate_item(root, path, new_size, 1); + ret = btrfs_truncate_item(path, new_size, 1); BUG_ON(ret); } else if (key->offset >= bytenr && csum_end > end_byte && end_byte > key->offset) { @@ -375,7 +375,7 @@ static noinline int truncate_one_csum(struct btrfs_root *root, u32 new_size = (csum_end - end_byte) / blocksize; new_size *= csum_size; - ret = btrfs_truncate_item(root, path, new_size, 0); + ret = btrfs_truncate_item(path, new_size, 0); BUG_ON(ret); key->offset = end_byte; diff --git a/kernel-shared/inode-item.c b/kernel-shared/inode-item.c index 4e009746de0e..67173eb141d8 100644 --- a/kernel-shared/inode-item.c +++ b/kernel-shared/inode-item.c @@ -311,7 +311,7 @@ int btrfs_del_inode_extref(struct btrfs_trans_handle *trans, memmove_extent_buffer(leaf, ptr, ptr + del_len, item_size - (ptr + del_len - item_start)); - btrfs_truncate_item(root, path, item_size - del_len, 1); + btrfs_truncate_item(path, item_size - del_len, 1); out: btrfs_free_path(path); @@ -432,7 +432,7 @@ int btrfs_del_inode_ref(struct btrfs_trans_handle *trans, item_start = btrfs_item_ptr_offset(leaf, path->slots[0]); memmove_extent_buffer(leaf, ptr, ptr + sub_item_len, item_size - (ptr + sub_item_len - item_start)); - btrfs_truncate_item(root, path, item_size - sub_item_len, 1); + btrfs_truncate_item(path, item_size - sub_item_len, 1); btrfs_mark_buffer_dirty(path->nodes[0]); out: btrfs_free_path(path); From patchwork Mon Sep 13 13:17:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 12489361 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 B70E9C4332F for ; Mon, 13 Sep 2021 13:30:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9924D61409 for ; Mon, 13 Sep 2021 13:30:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241920AbhIMNbN (ORCPT ); Mon, 13 Sep 2021 09:31:13 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:50752 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238976AbhIMNSs (ORCPT ); Mon, 13 Sep 2021 09:18:48 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 4D7271FFE0; Mon, 13 Sep 2021 13:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631539052; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iBhQfNstU4BmU2perA7RNHxjovVx3JqoBj1xNXS7C60=; b=WeAwZ3AyPsNAjp38iejMembPL7XybGWg5C6V3zTK0oQu/Xhh8/wif5cDoGh0Fwol9xVR0w m4GHvvR1gOm1K5+4MQMoZOtWlcmD4hrZScPufErR9h/SscjAVcM6UoCJfUKB5dzEOuw28V BfPJgYnPfdsExkoPSC5IlJKNqjc+Wm8= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 161DB13AB4; Mon, 13 Sep 2021 13:17:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GETiAmxPP2FNOwAAMHmgww (envelope-from ); Mon, 13 Sep 2021 13:17:32 +0000 From: Nikolay Borisov To: linux-btrfs@vger.kernel.org Cc: Nikolay Borisov Subject: [PATCH 5/8] btrfs-progs: Add btrfs_uuid_tree_remove Date: Mon, 13 Sep 2021 16:17:26 +0300 Message-Id: <20210913131729.37897-6-nborisov@suse.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210913131729.37897-1-nborisov@suse.com> References: <20210913131729.37897-1-nborisov@suse.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org It will be used to clear received data on RW snapshots that were received. Signed-off-by: Nikolay Borisov --- kernel-shared/ctree.h | 3 ++ kernel-shared/uuid-tree.c | 82 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h index 91a85796a678..158281a9fd67 100644 --- a/kernel-shared/ctree.h +++ b/kernel-shared/ctree.h @@ -2860,6 +2860,9 @@ int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans, u8 *uuid, u8 type, u64 subvol_id_cpu); int btrfs_is_empty_uuid(u8 *uuid); +int btrfs_uuid_tree_remove(struct btrfs_trans_handle *trans, u8 *uuid, u8 type, + u64 subid); + static inline int is_fstree(u64 rootid) { diff --git a/kernel-shared/uuid-tree.c b/kernel-shared/uuid-tree.c index 51a7b5d9ff5d..0f0fbf667dda 100644 --- a/kernel-shared/uuid-tree.c +++ b/kernel-shared/uuid-tree.c @@ -120,3 +120,85 @@ int btrfs_is_empty_uuid(u8 *uuid) } return 1; } + +int btrfs_uuid_tree_remove(struct btrfs_trans_handle *trans, u8 *uuid, u8 type, + u64 subid) +{ + struct btrfs_fs_info *fs_info = trans->fs_info; + struct btrfs_root *uuid_root = fs_info->uuid_root; + int ret; + struct btrfs_path *path = NULL; + struct btrfs_key key; + struct extent_buffer *eb; + int slot; + unsigned long offset; + u32 item_size; + unsigned long move_dst; + unsigned long move_src; + unsigned long move_len; + + if (!uuid_root) { + ret = -EINVAL; + goto out; + } + + btrfs_uuid_to_key(uuid, &key); + key.type = type; + + path = btrfs_alloc_path(); + if (!path) { + ret = -ENOMEM; + goto out; + } + + ret = btrfs_search_slot(trans, uuid_root, &key, path, -1, 1); + if (ret < 0) { + warning("error %d while searching for uuid item!", ret); + goto out; + } + if (ret > 0) { + ret = -ENOENT; + goto out; + } + + + eb = path->nodes[0]; + slot = path->slots[0]; + offset = btrfs_item_ptr_offset(eb, slot); + item_size = btrfs_item_size_nr(eb, slot); + if (!IS_ALIGNED(item_size, sizeof(u64))) { + warning("uuid item with illegal size %lu!", (unsigned long)item_size); + ret = -ENOENT; + goto out; + } + while (item_size) { + __le64 read_subid; + + read_extent_buffer(eb, &read_subid, offset, sizeof(read_subid)); + if (le64_to_cpu(read_subid) == subid) + break; + offset += sizeof(read_subid); + item_size -= sizeof(read_subid); + } + + if (!item_size) { + ret = -ENOENT; + goto out; + } + + item_size = btrfs_item_size_nr(eb, slot); + if (item_size == sizeof(subid)) { + ret = btrfs_del_item(trans, uuid_root, path); + goto out; + } + + move_dst = offset; + move_src = offset + sizeof(subid); + move_len = item_size - (move_src - btrfs_item_ptr_offset(eb, slot)); + memmove_extent_buffer(eb, move_dst, move_src, move_len); + btrfs_truncate_item(path, item_size - sizeof(subid), 1); + +out: + btrfs_free_path(path); + return ret; +} From patchwork Mon Sep 13 13:17:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 12489365 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 3BBBDC433EF for ; Mon, 13 Sep 2021 13:30:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1CE626140F for ; Mon, 13 Sep 2021 13:30:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241630AbhIMNbT (ORCPT ); Mon, 13 Sep 2021 09:31:19 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:50760 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239037AbhIMNSt (ORCPT ); Mon, 13 Sep 2021 09:18:49 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9B0191FFE2; Mon, 13 Sep 2021 13:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631539052; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PGAKlYKQBSIV2Be40Q0/BEpWk7UWZDqtpcX5VnZGoaM=; b=qOxv1pMFVmlifBluKBYzMrEPu8zUizUUFGBwH5b/QwvMhqab4IMTO/9IKzgoQyuvyAr6n8 Y/7xgDaRQTBXRoOguWjEd+OulliAOfAC+AFMVGPgIkL6pJdrU1D8qIUK7EZCiDg7vUCeBb nLh+XyUTxUrmJKINaGnsU5ptV6kMPqQ= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5EE4913AB4; Mon, 13 Sep 2021 13:17:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0P8vFGxPP2FNOwAAMHmgww (envelope-from ); Mon, 13 Sep 2021 13:17:32 +0000 From: Nikolay Borisov To: linux-btrfs@vger.kernel.org Cc: Nikolay Borisov Subject: [PATCH 6/8] btrfs-progs: check/original: Implement removing received data for RW subvols Date: Mon, 13 Sep 2021 16:17:27 +0300 Message-Id: <20210913131729.37897-7-nborisov@suse.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210913131729.37897-1-nborisov@suse.com> References: <20210913131729.37897-1-nborisov@suse.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Making a received subvolume RO should preclude doing an incremental send of said subvolume since it can't be guaranteed that nothing changed in the structure and this in turn has correctness implications for send. There is a pending kernel change that implements this behavior and ensures that in the future RO volumes which are switched to RW can't be used for incremental send. However, old kernels won't have that patch backported. To ensure there is a supported way for users to put their subvolumes in sane state let's implement the same functionality in progs. Signed-off-by: Nikolay Borisov --- check/main.c | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/check/main.c b/check/main.c index 6369bdd90656..7a2296d00234 100644 --- a/check/main.c +++ b/check/main.c @@ -3544,6 +3544,7 @@ static int check_fs_root(struct btrfs_root *root, int ret = 0; int err = 0; bool generation_err = false; + bool rw_received_err = false; int wret; int level; u64 super_generation; @@ -3658,6 +3659,46 @@ static int check_fs_root(struct btrfs_root *root, sizeof(found_key))); } + if (!((btrfs_root_flags(root_item) & BTRFS_ROOT_SUBVOL_RDONLY) || + btrfs_is_empty_uuid(root_item->received_uuid))) { + error("Subvolume id: %llu is RW and has a received uuid", + root->root_key.objectid); + rw_received_err = true; + if (repair) { + struct btrfs_trans_handle *trans = btrfs_start_transaction(root, 2); + if (IS_ERR(trans)) + return PTR_ERR(trans); + + ret = btrfs_uuid_tree_remove(trans, root_item->received_uuid, + BTRFS_UUID_KEY_RECEIVED_SUBVOL, root->root_key.objectid); + + if (ret && ret != -ENOENT) { + btrfs_abort_transaction(trans, ret); + return ret; + } + + memset(root_item->received_uuid, 0, BTRFS_UUID_SIZE); + btrfs_set_root_stransid(root_item, 0); + btrfs_set_root_rtransid(root_item, 0); + btrfs_set_stack_timespec_sec(&root_item->stime, 0); + btrfs_set_stack_timespec_nsec(&root_item->stime, 0); + btrfs_set_stack_timespec_sec(&root_item->rtime, 0); + btrfs_set_stack_timespec_nsec(&root_item->rtime, 0); + + ret = btrfs_update_root(trans, gfs_info->tree_root, &root->root_key, + root_item); + if (ret < 0) { + btrfs_abort_transaction(trans, ret); + return ret; + } + + btrfs_commit_transaction(trans, gfs_info->tree_root); + rw_received_err = false; + printf("Cleared received information for subvol: %llu\n", + root->root_key.objectid); + } + } + while (1) { ctx.item_count++; wret = walk_down_tree(root, &path, wc, &level, &nrefs); @@ -3722,7 +3763,7 @@ static int check_fs_root(struct btrfs_root *root, free_corrupt_blocks_tree(&corrupt_blocks); gfs_info->corrupt_blocks = NULL; - if (!ret && generation_err) + if (!ret && (generation_err || rw_received_err)) ret = -1; return ret; } From patchwork Mon Sep 13 13:17:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 12489367 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 36AACC433EF for ; Mon, 13 Sep 2021 13:30:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BD5B61407 for ; Mon, 13 Sep 2021 13:30:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241932AbhIMNbU (ORCPT ); Mon, 13 Sep 2021 09:31:20 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:50768 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239065AbhIMNSt (ORCPT ); Mon, 13 Sep 2021 09:18:49 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D14E01FFE3; Mon, 13 Sep 2021 13:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631539052; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jsAJKteqlLKMOkdoCFuno6umiSEi4NJBq5klDXSkVNY=; b=noENZTHNBY+KdZHBOUNLMswb455mnqQrfa29YL4eLaEagQBVYYfErqh45ksV8+s+G+hrNw AVO4DYMGX3q0vryQRS4o9mUFkx0AszdQJ+BADveBgweFz1dHahjp/1PM/j6iW79MzAy/iZ VojJId7td6yjHoij4+eAEfgEpSRlkcM= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9F99013F12; Mon, 13 Sep 2021 13:17:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iGJ9JGxPP2FNOwAAMHmgww (envelope-from ); Mon, 13 Sep 2021 13:17:32 +0000 From: Nikolay Borisov To: linux-btrfs@vger.kernel.org Cc: Nikolay Borisov Subject: [PATCH 7/8] btrfs-progs: check/lowmem: Implement received info clearing for RW volumes Date: Mon, 13 Sep 2021 16:17:28 +0300 Message-Id: <20210913131729.37897-8-nborisov@suse.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210913131729.37897-1-nborisov@suse.com> References: <20210913131729.37897-1-nborisov@suse.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org This is the counterpart to the original mode's implementation but for lowmem. I've put the code under the if (!check_all) branch because otherwise the check is run multiple times - from check_chunks_and_extents_lowmem and from actual fs_root check. By having it under the !check_all condition in check_btrfs_root it ensures that the check is performed only when checking the fs roots themselves. Signed-off-by: Nikolay Borisov --- check/mode-lowmem.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c index 323e66bc4cb1..70cf164752ff 100644 --- a/check/mode-lowmem.c +++ b/check/mode-lowmem.c @@ -5197,6 +5197,44 @@ static int check_btrfs_root(struct btrfs_root *root, int check_all) ret = check_fs_first_inode(root); if (ret < 0) return FATAL_ERROR; + + if (!((btrfs_root_flags(root_item) & BTRFS_ROOT_SUBVOL_RDONLY) || + btrfs_is_empty_uuid(root_item->received_uuid))) { + printf("Subvolume id: %llu is RW and has a received uuid\n", + root->root_key.objectid); + if (repair) { + struct btrfs_trans_handle *trans = btrfs_start_transaction(root, 2); + if (IS_ERR(trans)) + return PTR_ERR(trans); + + ret = btrfs_uuid_tree_remove(trans, root_item->received_uuid, + BTRFS_UUID_KEY_RECEIVED_SUBVOL, root->root_key.objectid); + + if (ret && ret != -ENOENT) { + btrfs_abort_transaction(trans, ret); + return ret; + } + + memset(root_item->received_uuid, 0, BTRFS_UUID_SIZE); + btrfs_set_root_stransid(root_item, 0); + btrfs_set_root_rtransid(root_item, 0); + btrfs_set_stack_timespec_sec(&root_item->stime, 0); + btrfs_set_stack_timespec_nsec(&root_item->stime, 0); + btrfs_set_stack_timespec_sec(&root_item->rtime, 0); + btrfs_set_stack_timespec_nsec(&root_item->rtime, 0); + + ret = btrfs_update_root(trans, gfs_info->tree_root, &root->root_key, + root_item); + if (ret < 0) { + btrfs_abort_transaction(trans, ret); + return ret; + } + + btrfs_commit_transaction(trans, gfs_info->tree_root); + printf("Cleared received information for subvol: %llu\n", + root->root_key.objectid); + } + } } From patchwork Mon Sep 13 13:17:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 12489357 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=-15.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT 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 A3D3CC433EF for ; Mon, 13 Sep 2021 13:28:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7735C6127A for ; Mon, 13 Sep 2021 13:28:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240964AbhIMN3K (ORCPT ); Mon, 13 Sep 2021 09:29:10 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:52504 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241819AbhIMNZy (ORCPT ); Mon, 13 Sep 2021 09:25:54 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 219FC1FFE5; Mon, 13 Sep 2021 13:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631539053; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b+VwFAfQ3A5NTSkINeI4VC8/ouKfcn/yMObCi1eOqFw=; b=VZUMc/OWl0KB8siVQbo7ZlhhqGWJHxHtmN12KwS2buL8HGWLF4uvzc1Sv2OXPQp8izpzMP ekGvi05tD+dIM6O1+ABfz7rG4qv1Tf4vmsRTrb/tsZV7FX4fIKVn+gbOxjwkFQo7BJCNem gQxkybhz0HS5RAdxK8chnkq6tjZim2M= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E0CAF13AB4; Mon, 13 Sep 2021 13:17:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0KxiNGxPP2FNOwAAMHmgww (envelope-from ); Mon, 13 Sep 2021 13:17:32 +0000 From: Nikolay Borisov To: linux-btrfs@vger.kernel.org Cc: Nikolay Borisov Subject: [PATCH 8/8] btrfs-progs: tests: Add test for received information removal Date: Mon, 13 Sep 2021 16:17:29 +0300 Message-Id: <20210913131729.37897-9-nborisov@suse.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210913131729.37897-1-nborisov@suse.com> References: <20210913131729.37897-1-nborisov@suse.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The image contains a subvolume which as been received i.e has relevant received fields populated and subsequently has been switched to RW mode. Signed-off-by: Nikolay Borisov --- .../050-subvol-recv-clear/test.raw.xz | Bin 0 -> 493524 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/fsck-tests/050-subvol-recv-clear/test.raw.xz GIT binary patch literal 493524 zcmeIbc{tbG{{L+j8I!3Z5fK?vBtuBalp*sNX)>3g5;7$jQb^_@vq%|A6p;uel~9=q z$rO<}_u1cb-}i6d*S*j6-5+PSt87bZL*=US=0*EA2a%`TNrXDQ8DN zaQeOwd9-6Ev09;5eQ>abNE&UscgFh=9!A}6BeqAb!M*M?C6V4V$0|Eds@j;Qv`3tn zQ5b%-dv1ME6+6-OL#;JeKfFpxJ!EhAGP2!{Hr_8Hina0sY1BB`1^LJ4!<7d*<{LSu zkM8$aoxWm&YxpZR`jq1iZezc} zl;mciJM;Y?9_ih8Rg+=kNmZvwhOa%;>DD%K=LVgp)lUwwMep2cKOgc$meFn{N$_4? z{oVrR`Adfd6(q*Q*JkEtRb8QGs$fu|J$-e}r-3!yPJz!admakPoysTOyIo(mN;j&g zccaMOwHxM=DXJVRL+#gG3SOQN7>WDO>Cw{frGX>hW7{E@{B(8nUJrTecW+lVO~e@WD}rmMqt57Dx_I6^;Ajc&JU4rt z<{sAb#KYY|d$MVmKHU%&UfMn`(91+z+$+lOOqcde`N9So$>_GY9gU*)XC%1$`vwAX zFLny9GhO^D_LX;DvA}GLe4?HfgUCT4zbc>me*3N+klkvhGo>#+ky#xTxJU9}fHyI< zq%yTkgT&o<=NQpL^v>(#Jzm^vO4nnQ*Ss5espW7-LPyww)ryvg1xlgf8=RS2IKl9tWHj} zlv$ZSt(;?c;3m4rx1m7pB}10LL3Za;Hifxo>yyLVdC%Te>=UI@*>FPhetnZd*v_}B z%uc?jKjv}Nav?4v?A*CBndfij0`zxWy0_({R%6I?(v({EP9BD-;D)43p*N~KUhvb2 zGK~i5Z>LWg-?sJBu-3eo)c~(`ai8TvKUeOtfNX0)ItQ&8hqZ4Ql#fSV+@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