Message ID | 1456729434-15737-1-git-send-email-zhangaihua1@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Mon, Feb 29, 2016 at 03:03:54PM +0800, zhangaihua1@huawei.com wrote: > 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. I don't think this is a good idea - the stack trace is required to determine what code has failed to detect that the device has gone and is trying to continue onwards without handling errors correctly. IMO, iterate_dir() should be fixed to do the right thing when errors have occurred.... Cheers, Dave.
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)