From 82ec6dbd4d132cb8d8ef51f33dae30775afebfb3 Mon Sep 17 00:00:00 2001 From: Nikolay Borisov Date: Fri, 10 Jan 2020 14:23:33 +0200 Subject: [PATCH] btrfs-progs: tests: Extend metadata uuid testcase This adds cooked images to exercise the case when a filesystem with metadata uuid incompat flag is switched back to having fsid/metadata uuid being equal. Signed-off-by: Nikolay Borisov Signed-off-by: David Sterba --- .../misc-tests/034-metadata-uuid/disk7.raw.xz | Bin 0 -> 314456 bytes .../misc-tests/034-metadata-uuid/disk8.raw.xz | Bin 0 -> 313708 bytes tests/misc-tests/034-metadata-uuid/test.sh | 25 ++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 tests/misc-tests/034-metadata-uuid/disk7.raw.xz create mode 100644 tests/misc-tests/034-metadata-uuid/disk8.raw.xz diff --git a/tests/misc-tests/034-metadata-uuid/disk7.raw.xz b/tests/misc-tests/034-metadata-uuid/disk7.raw.xz new file mode 100644 index 0000000000000000000000000000000000000000..131d49718de95e9c0212082298e9b5e539c8deea GIT binary patch literal 314456 zcmeI*`Crd@zsK=!s1V9kw4n@5DOzkrlp&>(K{BN%ZCtczQ6gneB&nt($`Z<2Cdrh_ zRMs>kkx`UosD>9?wf!yU2?X69 z-}=F@i(s(O0D(XtQDk|wy?tmm^Z5dSdux09{`7Vuy=nbC$1R+7W{1k-{ToG_etS4* zZLvoF_z6O$DXTAqgqUgU?|momVAa+kea-J%$>jTlRQfiajtuOzB&Xcl*wJQRyIWaJ zd@u76qI(1HrD*F!U}ID6CR_@2jgq_@;MuZ%LCqicGt;O5*% zV?39}i3A;9^>o4j!;AK->yJA{KCl>k{8FB)s)dxkl&0$Zfwc-US;K@9%VZwh*p(yv zi%GfWskS`Dw1|5T2bnnauKcBP$o!(UCr6B568OtwxjrKc14c)NUf$f`th-70)>)^g zPH~YQ0afekb}3#RVUh9ka9f4Ex~_-QRBK&LhGpn?T~qpF`tCa2Vi7%$vLzK=5-v

@2ZPeS__lxW@;4Hy6gK>ogW`c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$C=BWMJTpb<2J zM$iZvK_h4cji3=UvV}&_2pT~nXatR*5j28E&6BWMJTpb<2JM$iZvK_h4cji3=UN`Xeu2pT~nXatR*5j28E&U>o&Ky_-f=BClUn2n35;u1{axMN>i`bTURV=->ak3j|YY T%e|zebv3&R{{63;)x3WJZwDWx literal 0 HcmV?d00001 diff --git a/tests/misc-tests/034-metadata-uuid/disk8.raw.xz b/tests/misc-tests/034-metadata-uuid/disk8.raw.xz new file mode 100644 index 0000000000000000000000000000000000000000..993c836eeba1d0139e083d9a334041b93c172afa GIT binary patch literal 313708 zcmeI*c~sB&9>?)t{fcZA$(q!peWbdCQivO(OocYuMo}cC1-GOu6{Qp-p=4_$N|v%E zWNDHZ!&tJXG?Hav(xN-}&N=s-xpU0zXZq>>@$~ncW6sfj_0 zNLAiEY#}L7l~5801oCALms?t7g!Z!p0>9>#mYsPm6U-(m28?vK$xqa(+_}2r``QZS z$m>JS8;_Ehd~jLunl)BKc6PfRzUN7-T6epLj(yGtt$7?$e{@55SD(WBfsOg%qo z{CZ#CtNpYkwaiaYGi{7$kNs_CDUq((d)|4%+uE_jyt(*HKseKvUO!jQ=_IT4X)#J~? ze2xrV_vTQ3=5{r6L1xp|+nFN@ZC&TuE-gzpDhOAP3rJT}h^>`d#mXLmALUZOMq!4Z>JMW^&!Gv&-Cdr1UsJ8AvKIpNaY z*?Fp`^ffXLSsQ!r%kVF|vOPHcLu96K*h-mwL0SzPjUGup-q&AGdHmbKPT5(d#ixga z1v>V1&ry}IFSw#QCCpC4XuZ$6$MYs!o}cu(*k0PC_sGkUR%Z=#+(x_9rQ7?;MtN9z zeTeX~QF@fGwmmpos_x{BT`LoH6s^Cgbgb5&VJBz%TG%42tuZ-RSoCnIb#7Y4#Ocv? zQ(x!_j{B)dPa4$W`W4IPovoJ58TL!L@!jTbv1K_i3#(LP1`C@!BzL~~>6@GB5%N-7 z{;_I&!#m$`I)Zwwi9;-_2S{24d4D%dEjI4-lC>M`hijY0J85h=DY>;W;mFo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yTQtWS`@JjD;~4 z##k5=|Lf!68+?Or@cmam2hzIq$aac|>5+m_F!9E1I*bmZ!&n$&VeG#?aMrp+!+Ds9 zw@(U2!Nfan=rB5r4*Oi+pX30M14IrGIY8t9kq_E0h+OeGwT;!6=w`-A{+nVRRUe*?7#xV>W{Y;`_;u-~Y(QC!ON)5JbdLMZqYT zcxO8uMu*X1JeTCTK>@Gau)lY&t&@y;7Mj1Hs2I1l4IjPo$g!#=iY#gt@9G9{Uk zOi89BQ<5pE8(6B`22c2i6~qc+1+juyL98HF5G#lk2GYB8YW+U<-GCfM4kL$=!^mNu z`_9Wkorrf{3P!=iJF4g~I*blu$CVvdc3k=P&c_a=n37CMrX*96Dan*%N-`ze=+O=SUAXX47h!w;NVg<3HeKtbKVdOA!7&(j_Mh+u~k;BMg=SUAXX47h!w<&_Bkgehmpg`VdOA!7&(j_Mh+u~ zk;C|^z@Kj^u;VIXW~N{iOuWdT!{{(NjJ0#t&RIKW?fhemWlAz7nUYLNrX*96Dan*< zqr+Ze1+juyL98HF5G#lk#0p|X`#eJ?hmpg`VdOA!7&(j_Mh+u~k;C}*jzd9paF%1m zQ)g+J_ZRQ%Z)&t{qw9iKXGDzK6pVt2*C%us9Y%-oHXCoV@irT8vwcj!Oi89BQ<5pk zlw?XWC7F_(hqcc+F*%GJMh+u~k;BMgksw#3-i~ibwc}q6ji3=U zf=18?8bKpy1dX5(G=fIZNF5qMBWMJTpb<2JM$iZvK_h4cji3=UdIgQ35j28E&Q;e&XK_h4cji3=Uf=18?8bKpy1dX7P7BqrJ&0TK6>Gynhq literal 0 HcmV?d00001 diff --git a/tests/misc-tests/034-metadata-uuid/test.sh b/tests/misc-tests/034-metadata-uuid/test.sh index 6ac55b1c..fecec3d3 100755 --- a/tests/misc-tests/034-metadata-uuid/test.sh +++ b/tests/misc-tests/034-metadata-uuid/test.sh @@ -155,11 +155,27 @@ check_completed() { [ $? -eq 0 ] || _fail "metadata_uuid not set on $2" } +check_flag_cleared() { + # Ensure METADATA_UUID is not set + run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-super \ + "$1" | grep -q METADATA_UUID + [ $? -eq 1 ] || _fail "metadata_uuid not set on $1" + + run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-super \ + "$2" | grep -q METADATA_UUID + [ $? -eq 1 ] || _fail "metadata_uuid not set on $2" +} + check_multi_fsid_change() { check_inprogress_flag "$1" "$2" check_completed "$1" "$2" } +check_multi_fsid_unchanged() { + check_inprogress_flag "$1" "$2" + check_flag_cleared "$1" "$2" +} + failure_recovery() { local image1 local image2 @@ -227,3 +243,12 @@ failure_recovery "./disk4.raw.xz" "./disk3.raw.xz" check_completed failure_recovery "./disk5.raw.xz" "./disk6.raw.xz" check_multi_fsid_change reload_btrfs failure_recovery "./disk6.raw.xz" "./disk5.raw.xz" check_multi_fsid_change + +# disk7 contains an image which has undergone a successful fsid change once to +# a different value and once back to the original one, disk8 is part of the +# same filesystem but in this case it has missed the second transaction commit +# during the process change. So disk 7 looks as if it never underwent fsid change +# and disk 8 has FSID_CHANGING_FLAG and METADATA_UUID but is stale. +failure_recovery "./disk7.raw.xz" "./disk8.raw.xz" check_multi_fsid_unchanged +reload_btrfs +failure_recovery "./disk8.raw.xz" "./disk7.raw.xz" check_multi_fsid_unchanged