diff mbox

Btrfs-progs: make free space cache less noisy

Message ID 1412172669-1975-1-git-send-email-jbacik@fb.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Josef Bacik Oct. 1, 2014, 2:11 p.m. UTC
Fsck only cares if the cache is really broken, so don't be noisy if the
generations don't match or other such errors.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
---
 free-space-cache.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

Comments

David Sterba Oct. 6, 2014, 4:42 p.m. UTC | #1
On Wed, Oct 01, 2014 at 10:11:09AM -0400, Josef Bacik wrote:
> Fsck only cares if the cache is really broken, so don't be noisy if the
> generations don't match or other such errors.  Thanks,

Let's put the messages under a --verbose option if they're just noise.
I'll send a followup patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Sterba Oct. 6, 2014, 5:08 p.m. UTC | #2
On Mon, Oct 06, 2014 at 06:42:51PM +0200, David Sterba wrote:
> On Wed, Oct 01, 2014 at 10:11:09AM -0400, Josef Bacik wrote:
> > Fsck only cares if the cache is really broken, so don't be noisy if the
> > generations don't match or other such errors.  Thanks,
> 
> Let's put the messages under a --verbose option if they're just noise.
> I'll send a followup patch.

The printf's are inside free-spache-cache.c so it would need to keep
some global state that is read in cmds-check.c and set from random other
files. This could be cleanly done by prefixing the printf messages the
same way the kernel printk works and then print only the messages below
the user-specified level. Also, using printk in sources that are (not
yet but will be) shared with kernel is IMHO a good practice.

As this is going to be a broader change, I'd like to think about it more
and for now will keep the patch out, I hope we can live with the noisy
messages.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/free-space-cache.c b/free-space-cache.c
index 2440dd8..43c0894 100644
--- a/free-space-cache.c
+++ b/free-space-cache.c
@@ -174,9 +174,6 @@  static int io_ctl_check_generation(struct io_ctl *io_ctl, u64 generation)
 
 	gen = io_ctl->cur;
 	if (le64_to_cpu(*gen) != generation) {
-		printk("btrfs: space cache generation "
-		       "(%Lu) does not match inode (%Lu)\n", *gen,
-		       generation);
 		io_ctl_unmap_page(io_ctl);
 		return -EIO;
 	}
@@ -318,11 +315,6 @@  static int __load_free_space_cache(struct btrfs_root *root,
 	}
 
 	if (btrfs_inode_generation(leaf, inode_item) != generation) {
-		printf("free space inode generation (%llu) did not match "
-		       "free space cache generation (%llu)\n",
-		       (unsigned long long)btrfs_inode_generation(leaf,
-								  inode_item),
-		       (unsigned long long)generation);
 		btrfs_release_path(path);
 		return 0;
 	}
@@ -434,13 +426,9 @@  int load_free_space_cache(struct btrfs_fs_info *fs_info,
 				      block_group->key.objectid);
 	btrfs_free_path(path);
 
-	if (ret < 0) {
+	if (ret < 0)
 		ret = 0;
 
-		printf("failed to load free space cache for block group %llu\n",
-			block_group->key.objectid);
-	}
-
 	return ret;
 }