Commit c466e33
btrfs: propagate last_unlink_trans earlier when doing a rmdir
In case the removed directory had a snapshot that was deleted, we are
propagating its inode's last_unlink_trans to the parent directory after
we removed the entry from the parent directory. This leaves a small race
window where someone can log the parent directory after we removed the
entry and before we updated last_unlink_trans, and as a result if we ever
try to replay such a log tree, we will fail since we will attempt to
remove a snapshot during log replay, which is currently not possible and
results in the log replay (and mount) to fail. This is the type of failure
described in commit 1ec9a1a ("Btrfs: fix unreplayable log after
snapshot delete + parent dir fsync").
So fix this by propagating the last_unlink_trans to the parent directory
before we remove the entry from it.
Fixes: 44f714d ("Btrfs: improve performance on fsync against new inode after rename/unlink")
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 bf5bcf9 commit c466e33
1 file changed
Lines changed: 18 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4710 | 4710 | | |
4711 | 4711 | | |
4712 | 4712 | | |
4713 | | - | |
4714 | 4713 | | |
4715 | 4714 | | |
4716 | 4715 | | |
| |||
4736 | 4735 | | |
4737 | 4736 | | |
4738 | 4737 | | |
| 4738 | + | |
| 4739 | + | |
| 4740 | + | |
| 4741 | + | |
| 4742 | + | |
| 4743 | + | |
| 4744 | + | |
| 4745 | + | |
| 4746 | + | |
| 4747 | + | |
| 4748 | + | |
| 4749 | + | |
| 4750 | + | |
| 4751 | + | |
| 4752 | + | |
| 4753 | + | |
| 4754 | + | |
4739 | 4755 | | |
4740 | 4756 | | |
4741 | 4757 | | |
| |||
4745 | 4761 | | |
4746 | 4762 | | |
4747 | 4763 | | |
4748 | | - | |
4749 | | - | |
4750 | 4764 | | |
4751 | 4765 | | |
4752 | 4766 | | |
4753 | | - | |
| 4767 | + | |
4754 | 4768 | | |
4755 | | - | |
4756 | | - | |
4757 | | - | |
4758 | | - | |
4759 | | - | |
4760 | | - | |
4761 | | - | |
4762 | | - | |
4763 | | - | |
4764 | | - | |
4765 | | - | |
4766 | | - | |
4767 | | - | |
4768 | | - | |
4769 | 4769 | | |
4770 | 4770 | | |
4771 | 4771 | | |
| |||
0 commit comments