Commit 2b39796
btrfs: abort transaction on failure to add link to inode
If we fail to update the inode or delete the orphan item, we must abort
the transaction to prevent persisting an inconsistent state. For example
if we fail to update the inode item, we have the inconsistency of having
a persisted inode item with a link count of N but we have N + 1 inode ref
items and N + 1 directory entries pointing to our inode in case the
transaction gets committed.
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 74857fd commit 2b39796
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6852 | 6852 | | |
6853 | 6853 | | |
6854 | 6854 | | |
6855 | | - | |
| 6855 | + | |
| 6856 | + | |
6856 | 6857 | | |
| 6858 | + | |
6857 | 6859 | | |
6858 | 6860 | | |
6859 | 6861 | | |
6860 | 6862 | | |
6861 | 6863 | | |
6862 | 6864 | | |
6863 | | - | |
| 6865 | + | |
| 6866 | + | |
6864 | 6867 | | |
| 6868 | + | |
6865 | 6869 | | |
6866 | 6870 | | |
6867 | 6871 | | |
| |||
0 commit comments