Skip to content

Commit 2e3fcb1

Browse files
Ashish Samantkdave
authored andcommitted
btrfs: Print Warning only if ENOSPC_DEBUG is enabled
Dont print warning for ENOSPC error unless ENOSPC_DEBUG is enabled. Use btrfs_debug if it is enabled. Signed-off-by: Ashish Samant <ashish.samant@oracle.com> [ preserve the WARN_ON ] Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 07c9a8e commit 2e3fcb1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

fs/btrfs/delayed-inode.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,9 +650,14 @@ static int btrfs_delayed_inode_reserve_metadata(
650650
goto out;
651651

652652
ret = btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes);
653-
if (!WARN_ON(ret))
653+
if (!ret)
654654
goto out;
655655

656+
if (btrfs_test_opt(root, ENOSPC_DEBUG)) {
657+
btrfs_debug(root->fs_info,
658+
"block rsv migrate returned %d", ret);
659+
WARN_ON(1);
660+
}
656661
/*
657662
* Ok this is a problem, let's just steal from the global rsv
658663
* since this really shouldn't happen that often.

0 commit comments

Comments
 (0)