-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2019/3/22 4:48 下午, Dennis Schridde wrote: > On Freitag, 22. März 2019 09:41:15 CET Dennis Schridde wrote: >> On Freitag, 22. März 2019 09:23:29 CET Coly Li wrote: >>> On 2019/3/22 4:18 下午, Dennis Schridde wrote: >>>> On Freitag, 22. März 2019 08:04:20 CET Coly Li wrote: >>>>> On 2019/3/22 2:14 下午, Coly Li wrote: >>>>>> On 2019/3/21 10:16 下午, Coly Li wrote: >>>>>>> Now I am able to understand your patch. Yes this patch >>>>>>> may fix one of the condition that jset get lost. >>>>>>> >>>>>>> We should have this fix in v5.1, I will handle the >>>>>>> format issue. And if you don't mind I may re-compose a >>>>>>> commit log to explain what exactly is fixed. >>>>>> >>>>>> When I review the patch, I feel there is one point I >>>>>> still do not understand, could you please give me more >>>>>> hint ? >>>>>> >>>>>> From your commit log, "so when we doing replay, journals >>>>>> from last_seq_wrote to last_seq_now are missing.", can >>>>>> you show me the code to explain how such condition >>>>>> happens ? >>>>> >>>>> Aha, I realize this is for discard enabled condition. Hmm, >>>>> but discard is disabled by default. >>>>> >>>>> Hi Dennis, >>>>> >>>>> Is discard enabled in your environment ? Or it is just >>>>> disabled by default. >>>> >>>> How do I figure that out? (I currently only have access to >>>> /etc, my previous 4.18 or 4.19 kernel build config and >>>> whatever metadata bcache tools can provide me with.) >>> >>> Hi Dennis, >>> >>> The sysfs interface is /sys/fs/bcache/<cacheset >>> UUID>/cache0/discard >>> >>> By default it should be 0 (disabled). >> >> I used a Fedora 29 live system with Linux 4.18.16-300.fc29. >> /sys/fs/bcache is empty except for "regiter" and >> "register_quiet". Probably because the bcache kernel module >> unregisters the cache set after encountering the I/O errors? > > bcache-super-show was helpful: > > $ sudo bcache-super-show /dev/nvme0n1 sb.magic ok > sb.first_sector 8 [match] sb.csum HEX1 > [match] sb.version 3 [cache device] > > dev.label (empty) dev.uuid UUID1 > dev.sectors_per_block 8 dev.sectors_per_bucket 4096 > dev.cache.first_sector 4096 dev.cache.cache_sectors 488390656 > dev.cache.total_sectors 488394752 dev.cache.ordered yes > dev.cache.discard yes dev.cache.pos 0 > dev.cache.replacement 0 [lru] > > cset.uuid UUID0 $ sudo bcache-super-show /dev/sda3 > sb.magic ok sb.first_sector 8 [match] > sb.csum HEX2 [match] sb.version 1 > [backing device] > > dev.label (empty) dev.uuid UUID2 > dev.sectors_per_block 8 dev.sectors_per_bucket 4096 > dev.data.first_sector 16 dev.data.cache_mode 1 [writeback] > dev.data.cache_state 2 [dirty] > > cset.uuid UUID0 > The discard is enabled, so Junhui's patch is helpful. But Junhui's patch assumes discard is enabled, there should be a extra check whether discard is enabled in his patch before I submitted it to Jens and linux-stable. Thanks. - -- Coly Li -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE6j5FL/T5SGCN6PrQxzkHk2t9+PwFAlyUq6oACgkQxzkHk2t9 +PwNKxAAiWJEH+JN8dn5k8eIVcjcLyAsucqchpWXOV9gzqk21cEPQW7RLDVnIPeJ ZFHrSXcMMEqE1SfTeKNajFvvnNRAwHzLSFAMtgfVZUIGvUmqLLy0WFLMTnwRaLzY /RdcYk7MKyxph1kJycgfpwDmzUB/PGPgUtDaHvgNVZS4QV2LSFTvjip7rfSf75QN DHnxbjc47QVO897FVharYGGCQVwPC4u8lh+GE7H2r+ojOl1fXz3lEVRe/qFZLeta TM6/39TjQwGzUrs6i2JPvqyeFvKN6eJcrwSkxG7OfjaoAvrvjH4Id/Ci/3TVj5I7 NaVnfZv0TQ6DDlIxGpSK7xX/6HQ/luL4MwMK9H196nUXUgO3OC28PzVnHd57hoEJ t7EsJ7UD/gq6m0Fgn6GUe5YEFicp72S/31eSIoRcmjVjJD081SldlvvyfLIAkuKP omxIA6nlIhu6iXiXVm+lW3YudMsV2eSQj2CI8wvZvWeFzxxfRzx14mJkPF+zs5Lj KNyGL+rNSdHq7Jc7RQH8A3soB+lEUKHh4DcOuD/q6AcuBrMcf0XI4HYPbEYDrSUj mHAI9D252ozPnpD1x25ao+N26eOBj5s5C62XxO+V/RZG9rQ6gLfK/HIy5BE3T4KS IZEc/S5oIrtX9TRvn83+b4q5QyVslo5IfQVhOwhILdIwY+E5c+o= =ZSBt -----END PGP SIGNATURE-----