Skip to content

Commit 4ca8e03

Browse files
josefbacikkdave
authored andcommitted
btrfs: check for BTRFS_FS_ERROR in pending ordered assert
If we do fast tree logging we increment a counter on the current transaction for every ordered extent we need to wait for. This means we expect the transaction to still be there when we clear pending on the ordered extent. However if we happen to abort the transaction and clean it up, there could be no running transaction, and thus we'll trip the "ASSERT(trans)" check. This is obviously incorrect, and the code properly deals with the case that the transaction doesn't exist. Fix this ASSERT() to only fire if there's no trans and we don't have BTRFS_FS_ERROR() set on the file system. CC: [email protected] # 4.14+ Reviewed-by: Filipe Manana <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent e110f89 commit 4ca8e03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/ordered-data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ void btrfs_remove_ordered_extent(struct btrfs_inode *btrfs_inode,
639639
refcount_inc(&trans->use_count);
640640
spin_unlock(&fs_info->trans_lock);
641641

642-
ASSERT(trans);
642+
ASSERT(trans || BTRFS_FS_ERROR(fs_info));
643643
if (trans) {
644644
if (atomic_dec_and_test(&trans->pending_ordered))
645645
wake_up(&trans->pending_wait);

0 commit comments

Comments
 (0)