• Filipe Manana's avatar
    btrfs: remove outdated logic from overwrite_item() and add assertion · 3eb42344
    Filipe Manana authored
    As of commit 193df624 ("btrfs: search for last logged dir index if
    it's not cached in the inode"), the overwrite_item() function is always
    called for a root that is from a fs/subvolume tree. In other words, now
    it's only used during log replay to modify a fs/subvolume tree. Therefore
    we can remove the logic that checks if we are dealing with a log tree at
    overwrite_item().
    
    So remove that logic, replacing it with an assertion and document that if
    we ever need to support a log root there, we will need to clone the leaf
    from the fs/subvolume tree and then release it before modifying the log
    tree, which is needed to avoid a potential deadlock, similar to the one
    recently fixed by a patch with the subject:
    
      "btrfs: do not modify log tree while holding a leaf from fs tree locked"
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    3eb42344
tree-log.c 210 KB