Skip to content
Snippets Groups Projects
Commit 444939d3 authored by Jaegeuk Kim's avatar Jaegeuk Kim Committed by Treehugger Robot
Browse files

UPSTREAM: f2fs: avoid trying to get invalid block address


In f2fs_new_inode(), if we fail to get a new inode, we go iput(), followed by
f2fs_evict_inode(). If the inode is not marked as bad, it'll try to call
f2fs_remove_inode_page() which tries to read the inode block given node id.
But, there's no block address allocated yet, which gives a chance to access
a wrong block address, if the block device has some garbage data in NAT table.

We need to make sure NAT table should have zero data for all the unallocated
node ids, but also would be better to take this unnecessary path as well.
Let's mark the faild inode as bad.

Fixes: 0abd675e ("f2fs: support plain user/group quota")
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Change-Id: I37bfd94f0612e1521ae43fe529fd186954f3dece
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit e0293861)
parent 1ebc516c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment