From patchwork Sun Oct 22 03:40:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13431627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F60AC00A8F for ; Sun, 22 Oct 2023 03:41:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230090AbjJVDki (ORCPT ); Sat, 21 Oct 2023 23:40:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbjJVDkf (ORCPT ); Sat, 21 Oct 2023 23:40:35 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFCB2E1 for ; Sat, 21 Oct 2023 20:40:31 -0700 (PDT) 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 5C3F821906 for ; Sun, 22 Oct 2023 03:40:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1697946029; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r88uHwIFStcO4Dc0+DbEwzxQ+mHs2XQFVfU7ItwCBrU=; b=aEg74XfKQ/YcF5iiF0JVRrc6TsHLQ7uAy/BM+gNqIpHjYXcVeVGKSTWZjQjVpLGgQ2XJum gFQxNoRpe/YGuSh42Z86DXrEmksycAft9cHtiAIU3zYriVIemaWNdXId6NUfrW2uIInBR/ De9uvhtdC9maernASfC0K1L9an++J7E= 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 8948E1348C for ; Sun, 22 Oct 2023 03:40:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4Fl4EayZNGVHZwAAMHmgww (envelope-from ) for ; Sun, 22 Oct 2023 03:40:28 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 1/3] btrfs-progs: dump-tree: output the sequence number for inline references Date: Sun, 22 Oct 2023 14:10:07 +1030 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [-2.10 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; PREVIOUSLY_DELIVERED(0.00)[linux-btrfs@vger.kernel.org]; RCPT_COUNT_ONE(0.00)[1]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; NEURAL_HAM_LONG(-3.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Commit 6cf11f3e3815 ("btrfs-progs: check: check order of inline extent refs") fixes a problem that btrfs check never properly verify the sequence of inline references. It's not obvious because by default kernel handles EXTENT_DATA_REF_KEY using its own hash, resulting some seemingly out-of-order result: item 0 key (13631488 EXTENT_ITEM 4096) itemoff 16143 itemsize 140 refs 4 gen 7 flags DATA extent data backref root FS_TREE objectid 258 offset 0 count 1 extent data backref root FS_TREE objectid 257 offset 0 count 1 extent data backref root FS_TREE objectid 260 offset 0 count 1 extent data backref root FS_TREE objectid 259 offset 0 count 1 By a quick glance, no one can see the above inline backref items are in any order. To make such sequence more obvious, let dump-tree to output a new prefix to indicate the type and the internal sequence number: For above case, the new output would look like this: item 0 key (13631488 EXTENT_ITEM 4096) itemoff 16143 itemsize 140 refs 4 gen 7 flags DATA (178 0xdfb591fbbf5f519) extent data backref root FS_TREE objectid 258 offset 0 count 1 (178 0xdfb591fa80d95ea) extent data backref root FS_TREE objectid 257 offset 0 count 1 (178 0xdfb591f9c0534ff) extent data backref root FS_TREE objectid 260 offset 0 count 1 (178 0xdfb591f49f9f8e7) extent data backref root FS_TREE objectid 259 offset 0 count 1 Although still not that obvious, it should show the inline data backrefs has descending sequence number. For the type part, it's anti-instinctive in ascending order, which is not that easy to produce. Signed-off-by: Qu Wenruo --- kernel-shared/print-tree.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/kernel-shared/print-tree.c b/kernel-shared/print-tree.c index f6e7539eb191..9e3ebddb97b3 100644 --- a/kernel-shared/print-tree.c +++ b/kernel-shared/print-tree.c @@ -487,38 +487,45 @@ void print_extent_item(struct extent_buffer *eb, int slot, int metadata) ptr = (unsigned long)iref; end = (unsigned long)ei + item_size; while (ptr < end) { + u64 seq; + iref = (struct btrfs_extent_inline_ref *)ptr; type = btrfs_extent_inline_ref_type(eb, iref); offset = btrfs_extent_inline_ref_offset(eb, iref); + seq = offset; switch (type) { case BTRFS_TREE_BLOCK_REF_KEY: - printf("\t\ttree block backref root "); + printf("\t\t(%u 0x%llx) tree block backref root ", + type, seq); print_objectid(stdout, offset, 0); printf("\n"); break; case BTRFS_SHARED_BLOCK_REF_KEY: - printf("\t\tshared block backref parent %llu\n", - (unsigned long long)offset); + printf("\t\t(%u 0x%llx) shared block backref parent %llu\n", + type, seq, offset); break; case BTRFS_EXTENT_DATA_REF_KEY: dref = (struct btrfs_extent_data_ref *)(&iref->offset); - printf("\t\textent data backref root "); - print_objectid(stdout, - (unsigned long long)btrfs_extent_data_ref_root(eb, dref), 0); + seq = hash_extent_data_ref( + btrfs_extent_data_ref_root(eb, dref), + btrfs_extent_data_ref_objectid(eb, dref), + btrfs_extent_data_ref_offset(eb, dref)); + printf("\t\t(%u 0x%llx) extent data backref root ", + type, seq); + print_objectid(stdout, btrfs_extent_data_ref_root(eb, dref), 0); printf(" objectid %llu offset %llu count %u\n", - (unsigned long long)btrfs_extent_data_ref_objectid(eb, dref), + btrfs_extent_data_ref_objectid(eb, dref), btrfs_extent_data_ref_offset(eb, dref), btrfs_extent_data_ref_count(eb, dref)); break; case BTRFS_SHARED_DATA_REF_KEY: sref = (struct btrfs_shared_data_ref *)(iref + 1); - printf("\t\tshared data backref parent %llu count %u\n", - (unsigned long long)offset, - btrfs_shared_data_ref_count(eb, sref)); + printf("\t\t(%u 0x%llx) shared data backref parent %llu count %u\n", + type, seq, offset, btrfs_shared_data_ref_count(eb, sref)); break; case BTRFS_EXTENT_OWNER_REF_KEY: - printf("\t\textent owner root %llu\n", - (unsigned long long)offset); + printf("\t\(%u 0x%llx) textent owner root %llu\n", + type, seq, offset); break; default: return; From patchwork Sun Oct 22 03:40:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13431625 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 258BACDB474 for ; Sun, 22 Oct 2023 03:40:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229943AbjJVDkh (ORCPT ); Sat, 21 Oct 2023 23:40:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbjJVDkf (ORCPT ); Sat, 21 Oct 2023 23:40:35 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C838119 for ; Sat, 21 Oct 2023 20:40:32 -0700 (PDT) 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 AB8641FDC5 for ; Sun, 22 Oct 2023 03:40:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1697946030; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OLuM71+LAmTLpVS8XwEQ1AInfmtYktUm2GHJrn4y7Qs=; b=Zpf4ELiO/rqWmY9a9yUSY+iSfJ2eMJu8jzOtaTR4zJB0fQqBsbC5vZSxQg82+NI5+vZlVx b1vIBTiCv1OuFo0KPQIqzxhBqhK3MX6tZhzLwUBj4SW6f+U66eAEUd7Pj4eBqeHr9QftUb LXlQhMWVKd40Z0Vx+MeoZuVHSIp7H5U= 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 D84201348C for ; Sun, 22 Oct 2023 03:40:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6N65JK2ZNGVHZwAAMHmgww (envelope-from ) for ; Sun, 22 Oct 2023 03:40:29 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 2/3] btrfs-progs: check/lowmem: verify the sequence of inline backref items Date: Sun, 22 Oct 2023 14:10:08 +1030 Message-ID: <0af53e129f107cb91b7ce3f6d22e6f83e4457e70.1697945679.git.wqu@suse.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [0.81 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; PREVIOUSLY_DELIVERED(0.00)[linux-btrfs@vger.kernel.org]; RCPT_COUNT_ONE(0.00)[1]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; NEURAL_HAM_LONG(-3.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.09)[64.17%] Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Commit 6cf11f3e3815 ("btrfs-progs: check: check order of inline extent refs") added the ability to detect out-of-order inline extent backref items. Meanwhile there is no such ability in lowmem mode, this patch would introduce such ability to lowmem mode. Signed-off-by: Qu Wenruo --- check/mode-lowmem.c | 31 +++++++++++++++++++++++++++++++ check/mode-lowmem.h | 1 + 2 files changed, 32 insertions(+) diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c index 3b2807cc5de9..19b7b1a72a1f 100644 --- a/check/mode-lowmem.c +++ b/check/mode-lowmem.c @@ -4234,6 +4234,7 @@ static int check_extent_item(struct btrfs_path *path) unsigned long ptr; int slot = path->slots[0]; int type; + int last_type = 0; u32 nodesize = btrfs_super_nodesize(gfs_info->super_copy); u32 item_size = btrfs_item_size(eb, slot); u64 flags; @@ -4245,6 +4246,8 @@ static int check_extent_item(struct btrfs_path *path) u64 owner; u64 owner_offset; u64 super_gen; + u64 seq; + u64 last_seq = U64_MAX; int metadata = 0; /* To handle corrupted values in skinny backref */ u64 level; @@ -4342,6 +4345,32 @@ next: iref = (struct btrfs_extent_inline_ref *)ptr; type = btrfs_extent_inline_ref_type(eb, iref); offset = btrfs_extent_inline_ref_offset(eb, iref); + if (type == BTRFS_EXTENT_DATA_REF_KEY) { + dref = (struct btrfs_extent_data_ref *)(&iref->offset); + seq = hash_extent_data_ref( + btrfs_extent_data_ref_root(eb, dref), + btrfs_extent_data_ref_objectid(eb, dref), + btrfs_extent_data_ref_offset(eb, dref)); + } else { + seq = offset; + } + /* + * The @type should be ascending, while inside the same type, the + * @seq should be descending. + */ + if (type < last_type) + tmp_err |= BACKREF_OUT_OF_ORDER; + else if (type > last_type) + last_seq = U64_MAX; + + if (seq > last_seq) + tmp_err |= BACKREF_OUT_OF_ORDER; + + if (tmp_err & BACKREF_OUT_OF_ORDER) + error( +"inline extent backref (type %u seq 0x%llx) of extent [%llu %u %llu] is out of order", + type, seq, key.objectid, key.type, key.offset); + switch (type) { case BTRFS_TREE_BLOCK_REF_KEY: root_objectid = offset; @@ -4420,6 +4449,8 @@ next: err |= tmp_err; ptr_offset += btrfs_extent_inline_ref_size(type); + last_type = type; + last_seq = seq; goto next; out: diff --git a/check/mode-lowmem.h b/check/mode-lowmem.h index c3cf0878147f..3f84280a89f7 100644 --- a/check/mode-lowmem.h +++ b/check/mode-lowmem.h @@ -64,6 +64,7 @@ #define UNKNOWN_TYPE (1 << 6) /* Unknown type */ #define ACCOUNTING_MISMATCH (1 << 7) /* Used space accounting error */ #define CHUNK_TYPE_MISMATCH (1 << 8) +#define BACKREF_OUT_OF_ORDER (1 << 9) int check_fs_roots_lowmem(void); int check_chunks_and_extents_lowmem(void); From patchwork Sun Oct 22 03:40:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13431628 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F29A6C001DF for ; Sun, 22 Oct 2023 03:41:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230104AbjJVDkj (ORCPT ); Sat, 21 Oct 2023 23:40:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbjJVDkg (ORCPT ); Sat, 21 Oct 2023 23:40:36 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1AC611B for ; Sat, 21 Oct 2023 20:40:33 -0700 (PDT) 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 06A891FDC7 for ; Sun, 22 Oct 2023 03:40:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1697946032; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hvLZzufsD0C5mynKDJKHpBlZd5XqixKKPKIy8kc6FO4=; b=Ol70R42tz4QycsYDWjeyHe17T0LhLvaDD230RVa8IO8rfUg9dRakfMamNLYvqMisua17M1 fznvdLknMgODjcg1D0Pwd5JlOiy1nnDPP+SLgWZdhxs80NeRWg+7ldReEh6lLTZ6vhFwcT oOlc6kk+BZi9XhgkR34NdZUwwQDlkaA= 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 345191348C for ; Sun, 22 Oct 2023 03:40:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8KBZOK6ZNGVHZwAAMHmgww (envelope-from ) for ; Sun, 22 Oct 2023 03:40:30 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 3/3] btrfs-progs: fsck-tests: add test image of out-of-order inline backref items Date: Sun, 22 Oct 2023 14:10:09 +1030 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [-2.10 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[linux-btrfs@vger.kernel.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-3.00)[-1.000]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DBL_PROHIBIT(0.00)[0.0.0.9:email,0.0.0.2:email]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Issue #622 reported a case where ntfs2btrfs can generate out-of-order inline backref items, which can lead to kernel transaction abort, but not detected by btrfs-check. This patch would add such image, whose extent tree looks like this for the only data extent: item 0 key (13631488 EXTENT_ITEM 4096) itemoff 16172 itemsize 111 refs 3 gen 7 flags DATA (178 0xdfb591fa80d95ea) extent data backref root FS_TREE objectid 257 offset 0 count 1 (178 0xdfb591fbbf5f519) extent data backref root FS_TREE objectid 258 offset 0 count 1 (178 0xdfb591f49f9f8e7) extent data backref root FS_TREE objectid 259 offset 0 count 1 While the original good base image has the following backrefs for the same data extent: item 0 key (13631488 EXTENT_ITEM 4096) itemoff 16172 itemsize 111 refs 3 gen 7 flags DATA (178 0xdfb591fbbf5f519) extent data backref root FS_TREE objectid 258 offset 0 count 1 (178 0xdfb591fa80d95ea) extent data backref root FS_TREE objectid 257 offset 0 count 1 (178 0xdfb591f49f9f8e7) extent data backref root FS_TREE objectid 259 offset 0 count 1 Notice the sequence (the 2nd number in the round brackets) should be descending. (Meanwhie type should be ascending, but it's way harder to create) For now we don't have a way to fix it, but at least we should detect it. Signed-off-by: Qu Wenruo --- .../btrfs_image.xz | Bin 0 -> 2264 bytes .../061-out-of-order-inline-backref/test.sh | 19 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/fsck-tests/061-out-of-order-inline-backref/btrfs_image.xz create mode 100755 tests/fsck-tests/061-out-of-order-inline-backref/test.sh diff --git a/tests/fsck-tests/061-out-of-order-inline-backref/btrfs_image.xz b/tests/fsck-tests/061-out-of-order-inline-backref/btrfs_image.xz new file mode 100644 index 0000000000000000000000000000000000000000..65c10617bc250edce2affb3ed91c359041119345 GIT binary patch literal 2264 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 literal 0 HcmV?d00001 diff --git a/tests/fsck-tests/061-out-of-order-inline-backref/test.sh b/tests/fsck-tests/061-out-of-order-inline-backref/test.sh new file mode 100755 index 000000000000..f80d58f416f0 --- /dev/null +++ b/tests/fsck-tests/061-out-of-order-inline-backref/test.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Verify that check can detect out-of-order inline backref items. +# +# There is a report that one ntfs2btrfs generated some out-of-order inline +# backref items, while btrfs-check failed to detect it at all. +# +# Make sure btrfs check can at least detect such error. + +source "$TEST_TOP/common" + +check_prereq btrfs + +check_image() { + run_mustfail "out-of-order inline backref items not detected" \ + "$TOP/btrfs" check "$1" +} + +check_all_images