Skip to content

Commit 20cbe46

Browse files
fdmananakdave
authored andcommitted
btrfs: use btrfs_crit at btrfs_mark_buffer_dirty()
There's no need to use WARN() at btrfs_mark_buffer_dirty() to print an error message, as we have the fs_info pointer we can use btrfs_crit() which prints device information and makes the message have a more uniform format. As we are already aborting the transaction we already have a stack trace printed as well. So replace the use of WARN() with btrfs_crit(). Also slightly reword the message to use 'logical' instead of 'block' as it's what is used in other error/warning messages. Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 50564b6 commit 20cbe46

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/btrfs/disk-io.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4404,9 +4404,10 @@ void btrfs_mark_buffer_dirty(struct btrfs_trans_handle *trans,
44044404
ASSERT(trans->transid == fs_info->generation);
44054405
btrfs_assert_tree_write_locked(buf);
44064406
if (transid != fs_info->generation) {
4407-
WARN(1, KERN_CRIT "btrfs transid mismatch buffer %llu, found %llu running %llu\n",
4408-
buf->start, transid, fs_info->generation);
44094407
btrfs_abort_transaction(trans, -EUCLEAN);
4408+
btrfs_crit(fs_info,
4409+
"dirty buffer transid mismatch, logical %llu found transid %llu running transid %llu",
4410+
buf->start, transid, fs_info->generation);
44104411
}
44114412
set_extent_buffer_dirty(buf);
44124413
}

0 commit comments

Comments
 (0)