hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8JUUC?from=project-issue
--------------------------------
Inode reference count leakage exists in dump_dirtypages_sb() function. Executing iput(inode) in advance to avoid this problem.
Fixes: aeb96447becc ("fs/dirty_pages: dump the number of dirty pages for each inode") Signed-off-by: Zizhi Wo wozizhi@huawei.com --- fs/dirty_pages.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/fs/dirty_pages.c b/fs/dirty_pages.c index 0eb818b599ba..b0cf442c5730 100644 --- a/fs/dirty_pages.c +++ b/fs/dirty_pages.c @@ -159,6 +159,7 @@ static void dump_dirtypages_sb(struct super_block *sb, struct seq_file *m) if (m->size <= m->count) { seq_set_overflow(m); strncpy(m->buf+m->count-12, "terminated\n\0", 12); + iput(inode); goto done; } seq_printf(m, "FSType: %s, Dev ID: %u(%u:%u) ino %lu, dirty pages %lu, path %s\n",