On Tue, Aug 14, 2018 at 12:46:00PM +0200, David Sterba wrote: > On Tue, Aug 14, 2018 at 10:47:09AM +0800, Liu Bo wrote: > > The btrfs_release_path() is just useless as path is only used in error > > handling. > > Where is it duplicated? And I don't think it's useless, while the > changelog does not explain why and it's not obvious from the context. If > the path is locked, then releasing it right after it's not needed makes > sense. There are several potentially heavyweight operations between the > release and final free.
I see, the diff context is a little bit misleading, the logic in btrfs_unlink_subvol() is like, { ... btrfs_delete_one_dir_name(path); btrfs_release_path(path); ret = btrfs_del_root_ref(); <<<< path is not used here. if (ret < 0) { btrfs_search_dir_index_item(path); btrfs_release_path(path); } btrfs_release_path(path); <<<< path has been released anyway. ... } thanks, -liubo