Commit dc058f5
btrfs: send: check for dead send root under critical section
We're checking if the send root is dead without the protection of the
root's root_item_lock spinlock, which is what protects the root's flags.
The inverse, setting the dead flag on a root, is done under the protection
of that lock, at btrfs_delete_subvolume(). Also checking and updating the
root's send_in_progress counter is supposed to be done in the same
critical section as checking for or setting the root dead flag, so that
these operations are done atomically as a single step (which is correctly
done by btrfs_delete_subvolume()).
So fix this by checking if the send root is dead in the same critical
section that updates the send_in_progress counter, which is protected by
the root's root_item_lock spinlock.
Signed-off-by: Filipe Manana <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>1 parent 722d343 commit dc058f5
1 file changed
+8
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8125 | 8125 | | |
8126 | 8126 | | |
8127 | 8127 | | |
| 8128 | + | |
| 8129 | + | |
| 8130 | + | |
| 8131 | + | |
| 8132 | + | |
| 8133 | + | |
| 8134 | + | |
| 8135 | + | |
8128 | 8136 | | |
8129 | 8137 | | |
8130 | 8138 | | |
| |||
8207 | 8215 | | |
8208 | 8216 | | |
8209 | 8217 | | |
8210 | | - | |
8211 | | - | |
8212 | | - | |
8213 | | - | |
8214 | | - | |
8215 | | - | |
8216 | | - | |
8217 | | - | |
8218 | | - | |
8219 | 8218 | | |
8220 | 8219 | | |
8221 | 8220 | | |
| |||
0 commit comments