All of lore.kernel.org
 help / color / mirror / Atom feed
From: <zhangaihua1@huawei.com>
To: <linux-fsdevel@vger.kernel.org>
Cc: zhangaihua <zhangaihua1@huawei.com>
Subject: [PATCH] remove warn when bdi is unregisterd in __mark_inode_dirty().
Date: Mon, 29 Feb 2016 15:03:54 +0800	[thread overview]
Message-ID: <1456729434-15737-1-git-send-email-zhangaihua1@huawei.com> (raw)

From: zhangaihua <zhangaihua1@huawei.com>

When a disk is ejected, we try to do the operation 'ls', it will fails
because device is gone.

Currently we do a WARN() which does not seem to be the right thing.
Convert it to a ratelimited kernel warning.

[ 221.582369] bdi-block not registered
[ 221.625209] ------------[ cut here ]------------
[ 221.680512] WARNING: at fs/fs-writeback.c:2065
[ 221.733632] Modules linked in:
[ 221.770088]
[ 221.787798] CPU: 10 PID: 1454 Comm: ls Not tainted 4.4.0+ #6
[ 221.855604] Hardware name: Hisilicon PhosphorHi1382 EVB (DT)
[ 221.923309] task: ffffffc0d4c74800 ti: ffffffc0d47bc000 task.ti:
ffffffc0d47bc000
[ 222.012896] PC is at __mark_inode_dirty+0x2b0/0x3d0
[ 222.071327] LR is at __mark_inode_dirty+0x2b0/0x3d0
[ 222.129657] pc : [<ffffffc000278490>] lr : [<ffffffc000278490>]
pstate: 80000145
[ 222.218191] sp : ffffffc0d47bfd80
[ 222.257772] x29: ffffffc0d47bfd80 x28: ffffffc0d47bc000
[ 222.321310] x27: ffffffc000ccd000 x26: 000000000000003d
[ 222.384847] x25: 000000000000011d x24: ffffffc00e5d0140
[ 222.448385] x23: 0000000000000000 x22: 0000000000000000
[ 222.511923] x21: ffffffc00e5d00b8 x20: ffffffc00dfc81e0
[ 222.575459] x19: 0000000000000001 x18: 0000000000000000
[ 222.638997] x17: 00000000004b59f0 x16: ffffffc00025a640
[ 222.702535] x15: ffffffffffffffff x14: 0ffffffffffffffe
[ 222.766073] x13: 0000000000000028 x12: 0101010101010101
[ 222.829611] x11: ffffffc0d47bfac0 x10: ffffffc0d47bfac0
[ 222.893149] x9 : ffffffd000000000 x8 : 6b206e6f74207265
[ 222.956685] x7 : 00000000000001f8 x6 : ffffffc0014d7377
[ 223.020223] x5 : 0000000000000005 x4 : 0000000000000000
[ 223.083761] x3 : ffffffc0014d6dda x2 : 0000000000000018
[ 223.147299] x1 : 0000000000000001 x0 : 0000000000000018
[ 223.210836]
[ 223.228543] ---[ end trace 17b671a783f074ad ]---
[ 223.283749] Call trace:
[ 223.312915] [<ffffffc000278490>] __mark_inode_dirty+0x2b0/0x3d0
[ 223.383745] [<ffffffc000262570>] generic_update_time+0x90/0xd0
[ 223.453635] [<ffffffc000264220>] touch_atime+0xa0/0xc0
[ 223.515092] [<ffffffc00025a1b0>] iterate_dir+0x100/0x140
[ 223.578731] [<ffffffc00025a6cc>] SyS_getdents64+0x8c/0x120
[ 223.644355] [<ffffffc000084cb0>] el0_svc_naked+0x24/0x28

Signed-off-by: zhangaihua1@huawei.com
---
 fs/fs-writeback.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 6915c95..2cb5bca 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -2058,9 +2058,10 @@ void __mark_inode_dirty(struct inode *inode, int flags)
 
 			wb = locked_inode_to_wb_and_lock_list(inode);
 
-			WARN(bdi_cap_writeback_dirty(wb->bdi) &&
-			     !test_bit(WB_registered, &wb->state),
-			     "bdi-%s not registered\n", wb->bdi->name);
+			if (bdi_cap_writeback_dirty(wb->bdi) &&
+				!test_bit(WB_registered, &wb->state))
+				pr_warn_ratelimited("bdi-%s not registered\n",
+							wb->bdi->name);
 
 			inode->dirtied_when = jiffies;
 			if (dirtytime)
-- 
1.9.3


             reply	other threads:[~2016-02-29  7:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29  7:03 zhangaihua1 [this message]
2016-03-01 21:34 ` [PATCH] remove warn when bdi is unregisterd in __mark_inode_dirty() Dave Chinner
2016-03-15  4:08   ` Zhang AiHua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456729434-15737-1-git-send-email-zhangaihua1@huawei.com \
    --to=zhangaihua1@huawei.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.