On Wed, Feb 21, 2024 at 10:09:59PM +0530, Anand Jain wrote: > On 2/20/24 23:42, David Sterba wrote: > > On Tue, Feb 20, 2024 at 02:08:00PM +0000, Filipe Manana wrote: > >> On Wed, Feb 14, 2024 at 7:17 AM David Sterba <dsterba@xxxxxxx> wrote: > >>> On Tue, Feb 13, 2024 at 09:13:56AM +0800, Anand Jain wrote: > >>> https://btrfs.readthedocs.io/en/latest/dev/Developer-s-FAQ.html#ordering > >> > >> So this introduces a regression. > >> > >> $ ./check btrfs/14[6-9] btrfs/15[8-9] > > > > Thanks, with this I can reproduce it and have some ideas what could go > > wrong. > > Thanks indeed. I tested the following, it fixes the fsid problems and has passed full fstests run. The temp-fsid test coverage needs to be done still. @@ -1388,6 +1388,10 @@ struct btrfs_device *btrfs_scan_one_device(const char *path, blk_mode_t flags, if (ret) btrfs_warn(NULL, "lookup bdev failed for path %s: %d", path, ret); + if (devt) { + printk(KERN_ERR "free stale devt (for path %s)\n", path); + btrfs_free_stale_devices(devt, NULL); + }