提交 dd5f6279 编写于 作者: Z zhangyi (F) 提交者: Jan Kara

quota: fix potential infinite loop

In dquot_writeback_dquots(), we write back dquot from dirty dquots
list. There is a potential infinite loop if ->write_dquot() failure
and forget remove dquot from the list. This patch clear dirty bit
anyway to avoid it.
Signed-off-by: Nzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: NJan Kara <jack@suse.cz>
上级 cb917757
......@@ -644,8 +644,15 @@ int dquot_writeback_dquots(struct super_block *sb, int type)
spin_unlock(&dq_list_lock);
dqstats_inc(DQST_LOOKUPS);
err = sb->dq_op->write_dquot(dquot);
if (!ret && err)
if (err) {
/*
* Clear dirty bit anyway to avoid infinite
* loop here.
*/
clear_dquot_dirty(dquot);
if (!ret)
ret = err;
}
dqput(dquot);
spin_lock(&dq_list_lock);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册