diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-08-24 17:40:45 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-08-24 16:35:59 -0700 |
commit | 13ec7297e5331f2754d7629a068c619c41f20e56 (patch) | |
tree | 64c4092d02d04f7705a69e49174a0b1742ca34a1 /mm/mmzone.c | |
parent | b01548919c33767bc457390fa3c41aedc273bfff (diff) | |
download | linux-stable-13ec7297e5331f2754d7629a068c619c41f20e56.tar.gz linux-stable-13ec7297e5331f2754d7629a068c619c41f20e56.tar.bz2 linux-stable-13ec7297e5331f2754d7629a068c619c41f20e56.zip |
f2fs: fix to release inode correctly
In following call stack, if unfortunately we lose all chances to truncate
inode page in remove_inode_page, eventually we will add the nid allocated
previously into free nid cache, this nid is with NID_NEW status and with
NEW_ADDR in its blkaddr pointer:
- f2fs_create
- f2fs_add_link
- __f2fs_add_link
- init_inode_metadata
- new_inode_page
- new_node_page
- set_node_addr(, NEW_ADDR)
- f2fs_init_acl failed
- remove_inode_page failed
- handle_failed_inode
- remove_inode_page failed
- iput
- f2fs_evict_inode
- remove_inode_page failed
- alloc_nid_failed cache a nid with valid blkaddr: NEW_ADDR
This may not only cause resource leak of previous inode, but also may cause
incorrect use of the previous blkaddr which is located in NO.nid node entry
when this nid is reused by others.
This patch tries to add this inode to orphan list if we fail to truncate
inode, so that we can obtain a second chance to release it in orphan
recovery flow.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'mm/mmzone.c')
0 files changed, 0 insertions, 0 deletions