linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Btrfs: remove unwanted kernel log output
@ 2012-07-17 15:02 Stefan Behrens
  2012-07-17 15:02 ` [PATCH 1/2] Btrfs: remove unwanted printk() for btrfs device I/O stats Stefan Behrens
  2012-07-17 15:02 ` [PATCH 2/2] Btrfs: suppress printk() if all device I/O stats are zero Stefan Behrens
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Behrens @ 2012-07-17 15:02 UTC (permalink / raw)
  To: linux-btrfs

People complained about unwanted kernel log output at mount time,
related to btrfs device I/O statistics. With these two commits, the
two messages are removed or filtered, respectively.

Stefan Behrens (2):
  Btrfs: remove unwanted printk() for btrfs device I/O stats
  Btrfs: suppress printk() if all device I/O stats are zero

 fs/btrfs/volumes.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

-- 
1.7.11.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] Btrfs: remove unwanted printk() for btrfs device I/O stats
  2012-07-17 15:02 [PATCH 0/2] Btrfs: remove unwanted kernel log output Stefan Behrens
@ 2012-07-17 15:02 ` Stefan Behrens
  2012-07-17 15:02 ` [PATCH 2/2] Btrfs: suppress printk() if all device I/O stats are zero Stefan Behrens
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Behrens @ 2012-07-17 15:02 UTC (permalink / raw)
  To: linux-btrfs

People complained about the annoying kernel log message
"btrfs: no dev_stats entry found ... (OK on first mount after mkfs)"
everytime a filesystem is mounted for the first time after running
mkfs. Since the distribution of the btrfs-progs is not synchronized
to the kernel version, mkfs like it is now will be used also in the
future. Then this message is not useful to find errors, it is just
annoying. This commit removes the printk().

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
---
 fs/btrfs/volumes.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index ecaad40..6f04dae 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -4736,9 +4736,6 @@ int btrfs_init_dev_stats(struct btrfs_fs_info *fs_info)
 		key.offset = device->devid;
 		ret = btrfs_search_slot(NULL, dev_root, &key, path, 0, 0);
 		if (ret) {
-			printk_in_rcu(KERN_WARNING "btrfs: no dev_stats entry found for device %s (devid %llu) (OK on first mount after mkfs)\n",
-				      rcu_str_deref(device->name),
-				      (unsigned long long)device->devid);
 			__btrfs_reset_dev_stats(device);
 			device->dev_stats_valid = 1;
 			btrfs_release_path(path);
-- 
1.7.11.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] Btrfs: suppress printk() if all device I/O stats are zero
  2012-07-17 15:02 [PATCH 0/2] Btrfs: remove unwanted kernel log output Stefan Behrens
  2012-07-17 15:02 ` [PATCH 1/2] Btrfs: remove unwanted printk() for btrfs device I/O stats Stefan Behrens
@ 2012-07-17 15:02 ` Stefan Behrens
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Behrens @ 2012-07-17 15:02 UTC (permalink / raw)
  To: linux-btrfs

Code is added to suppress the I/O stats printing at mount time if all
statistic values are zero.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
---
 fs/btrfs/volumes.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 6f04dae..d11606c 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -4877,6 +4877,14 @@ void btrfs_dev_stat_print_on_error(struct btrfs_device *dev)
 
 static void btrfs_dev_stat_print_on_load(struct btrfs_device *dev)
 {
+	int i;
+
+	for (i = 0; i < BTRFS_DEV_STAT_VALUES_MAX; i++)
+		if (btrfs_dev_stat_read(dev, i) != 0)
+			break;
+	if (i == BTRFS_DEV_STAT_VALUES_MAX)
+		return; /* all values == 0, suppress message */
+
 	printk_in_rcu(KERN_INFO "btrfs: bdev %s errs: wr %u, rd %u, flush %u, corrupt %u, gen %u\n",
 	       rcu_str_deref(dev->name),
 	       btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_WRITE_ERRS),
-- 
1.7.11.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-17 15:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-17 15:02 [PATCH 0/2] Btrfs: remove unwanted kernel log output Stefan Behrens
2012-07-17 15:02 ` [PATCH 1/2] Btrfs: remove unwanted printk() for btrfs device I/O stats Stefan Behrens
2012-07-17 15:02 ` [PATCH 2/2] Btrfs: suppress printk() if all device I/O stats are zero Stefan Behrens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).