Commit e87e953
btrfs: fix inode leak on failure to add link to inode
If we fail to update the inode or delete the orphan item we leak the inode
since we update its refcount with the ihold() call to account for the
d_instantiate() call which never happens in case we fail those steps. Fix
this by setting 'drop_inode' to true in case we fail those steps.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent 2b39796 commit e87e953
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6854 | 6854 | | |
6855 | 6855 | | |
6856 | 6856 | | |
| 6857 | + | |
6857 | 6858 | | |
6858 | 6859 | | |
6859 | 6860 | | |
| |||
6864 | 6865 | | |
6865 | 6866 | | |
6866 | 6867 | | |
| 6868 | + | |
6867 | 6869 | | |
6868 | 6870 | | |
6869 | 6871 | | |
| |||
0 commit comments