Skip to content

Commit 24533f6

Browse files
morbidrsakdave
authored andcommitted
btrfs: save irq flags when looking up an ordered extent
A following patch will add another caller of btrfs_lookup_ordered_extent(), but from a bio's endio context. btrfs_lookup_ordered_extent() uses spin_lock_irq() which unconditionally disables interrupts. Change this to spin_lock_irqsave() so interrupts aren't disabled and re-enabled unconditionally. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 08f4555 commit 24533f6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/btrfs/ordered-data.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,9 +767,10 @@ struct btrfs_ordered_extent *btrfs_lookup_ordered_extent(struct btrfs_inode *ino
767767
struct btrfs_ordered_inode_tree *tree;
768768
struct rb_node *node;
769769
struct btrfs_ordered_extent *entry = NULL;
770+
unsigned long flags;
770771

771772
tree = &inode->ordered_tree;
772-
spin_lock_irq(&tree->lock);
773+
spin_lock_irqsave(&tree->lock, flags);
773774
node = tree_search(tree, file_offset);
774775
if (!node)
775776
goto out;
@@ -780,7 +781,7 @@ struct btrfs_ordered_extent *btrfs_lookup_ordered_extent(struct btrfs_inode *ino
780781
if (entry)
781782
refcount_inc(&entry->refs);
782783
out:
783-
spin_unlock_irq(&tree->lock);
784+
spin_unlock_irqrestore(&tree->lock, flags);
784785
return entry;
785786
}
786787

0 commit comments

Comments
 (0)