History

Btrfs: skip locking if searching the commit root in csum lookup

It's not enough to just search the commit root, since we could be cow'ing the very block we need to search through, which would mean that its locked and we'll still deadlock. So use path->skip_locking as well. Thanks,

Josef Bacik committed 15 years ago

Commit ddf23b31 parent e0b6d651 file · +3 −1Browse files

Unified · Split

fs/btrfs/file-item.c+3−1
@@ -183,8 +183,10 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root, · 182 unmodified lines
183183 * read from the commit root and sidestep a nasty deadlock
184184 * between reading the free space cache and updating the csum tree.
185185 */
186− if (btrfs_is_free_space_inode(root, inode))
186+ if (btrfs_is_free_space_inode(root, inode)) {
187187 path->search_commit_root = 1;
188+ path->skip_locking = 1;
189+ }
188190
189191 disk_bytenr = (u64)bio->bi_sector << 9;
190192 if (dio)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t