From 7cb441ba56f16f80b2aff89d38a5c9bd041f57b2 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Mon, 2 Sep 2019 12:57:50 +0800 Subject: [PATCH] btrfs-progs: fsck-tests: Add test image for valid half-dropped orphan inode Btrfs check used to report false alerts on half dropped orphan inodes. Add test cases to prevent such problem from happening again. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- .../042-half-dropped-inode/default.raw.xz | Bin 0 -> 58940 bytes .../fsck-tests/042-half-dropped-inode/test.sh | 34 ++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 tests/fsck-tests/042-half-dropped-inode/default.raw.xz create mode 100755 tests/fsck-tests/042-half-dropped-inode/test.sh diff --git a/tests/fsck-tests/042-half-dropped-inode/default.raw.xz b/tests/fsck-tests/042-half-dropped-inode/default.raw.xz new file mode 100644 index 0000000000000000000000000000000000000000..6170fb35f49870685865bce6daa3becc04bc3501 GIT binary patch literal 58940 zcmeFZU&*P-)tW0ng9SGCo4^&KmY`QH~;_u2(#)_zrVyF);a(Hw%@i*fN4Notbigt$f!>c#x$Be~UFO-ohaL!c@Rw z@VGQ5BPJfkzs|N{z3-0R>bZ)+&4eLc0Si^Lh8x-nOvUVNipU9GvYnt*AIsG1`Cp3> zl#pm;IWT!gJSm8EV9Esz*}2F_@U%b}Bg55@eeev7njXD0GM~evgrrr-)30OUYL3rx z#GftSy(?8PfGd)g8Fy^{kmSB77!rXwkbbn~r3@w%p9eb3yNcz&W6V_MNCWp+n;`8th2-dn`@kpHKY^V-+?y_Hn*T z5MZ#pwP4!@-XoOL9=M&|-~DZd*m((zlrm(G$^9x-5dD&Orl#K0@L|D@Fw@J}ZQzysG%sB&~9QK}#s@;fN*Px63Id(z_y`44zL;i}0b0e;{*y#q0x1 zlS%ttt6h$RA0knDdyZ#i04=V&vF*2$5rdhJN35vU|I;y3Pllnb5pr&-D0e7DdMprr zPRa1qnRrK3J;EFiR1$WgJ|)Sb2U9;S{!hRrzNKBzilPs zPQxJOo4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J{@?r7)4#!w{r}u1^q;aV2g>2Y_60X}N;*SCz#Aa%HTZKZ4gm`Aq6iSCG6czCKMR zZMT0GoZzP($dlh24gndHN&`5%G|qtf6{ugYwtkIA<@z-R{cFFD)2pABspD{iKv`2rMK7o`3Qu61d`eRcUKw}nen0AT>a0EGQb-8XOx(sxsb{^8Nj zevkGS=fZyH#tKjnFG-(3z<_{V?Rf(r3_uuwus@nP1%@mBwCoAAMwcWKAYeeiu9kTL zgaHTx5C*6f|Mh?esPr$%20*}ofL$$p0tf>T1|SS*z5z}DXTSIXTBA!cFAy*wU{`xo z0SE&S1|SSjD*(0PFRl9lddW-DClD|oU{`zI00;vR1|STOcK~?@kavEWH_X5kH84f} zckEaK@w04#RJTL1t6 literal 0 HcmV?d00001 diff --git a/tests/fsck-tests/042-half-dropped-inode/test.sh b/tests/fsck-tests/042-half-dropped-inode/test.sh new file mode 100755 index 00000000..1195fa19 --- /dev/null +++ b/tests/fsck-tests/042-half-dropped-inode/test.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# To check if btrfs check can handle half dropped inodes. +# Such inodes are orphan inodes going through file items evicting. +# During that evicting, btrfs won't bother updating the nbytes of the orphan +# inode as they will soon be removed completely. +# +# Btrfs check should be able to recognize such inodes without giving false +# alerts +# +# The way to reproduce the image: +# - Create a lot of regular file extents for one inode +# Using direct IO with small block size is the easiy method +# - Modify kernel to commit transaction more aggresively +# Two locations are needed: +# * btrfs_unlink(): +# To make the ORPHAN item reach disk asap +# * btrfs_evict_inode(): +# Make the btrfs_end_transaction() call after btrfs_trncate_inode_items() +# to commit transaction, so we can catch every file item deletion +# - Setup dm-log-writes +# To catch every transaction commit +# - Delete the inode +# - Sync the fs +# - Replay the log + +source "$TEST_TOP/common" + +check_prereq btrfs + +check_image() { + run_check "$TOP/btrfs" check "$1" +} + +check_all_images