• J
    btrfs: set update the uuid generation as soon as possible · 75ec1db8
    Josef Bacik 提交于
    In my EIO stress testing I noticed I was getting forced to rescan the
    uuid tree pretty often, which was weird.  This is because my error
    injection stuff would sometimes inject an error after log replay but
    before we loaded the UUID tree.  If log replay committed the transaction
    it wouldn't have updated the uuid tree generation, but the tree was
    valid and didn't change, so there's no reason to not update the
    generation here.
    
    Fix this by setting the BTRFS_FS_UPDATE_UUID_TREE_GEN bit immediately
    after reading all the fs roots if the uuid tree generation matches the
    fs generation.  Then any transaction commits that happen during mount
    won't screw up our uuid tree state, forcing us to do needless uuid
    rescans.
    
    Fixes: 70f80175 ("Btrfs: check UUID tree during mount if required")
    CC: stable@vger.kernel.org # 4.19+
    Signed-off-by: NJosef Bacik <josef@toxicpanda.com>
    Reviewed-by: NDavid Sterba <dsterba@suse.com>
    Signed-off-by: NDavid Sterba <dsterba@suse.com>
    75ec1db8
disk-io.c 127.9 KB