]> Git Repo - linux.git/commit
f2fs: fix error path in init_inode_metadata
authorChao Yu <[email protected]>
Tue, 24 Jun 2014 02:34:00 +0000 (10:34 +0800)
committerJaegeuk Kim <[email protected]>
Wed, 9 Jul 2014 12:58:50 +0000 (05:58 -0700)
commit90d72459ccb47335a4348947506fd091e63f7cf8
tree1e417ae3338451d1849b4fe424983777e4127f3a
parentd6b7d4b31dfd5a454a71c445b8086bc098237334
f2fs: fix error path in init_inode_metadata

If we fail in this path:
->init_inode_metadata
  ->make_empty_dir
    ->get_new_data_page
      ->grab_cache_page return -ENOMEM

We will bug on in error path of init_inode_metadata when call remove_inode_page
because i_block = 2 (one inode block will be released later & one dentry block).

We should release the dentry block in init_inode_metadata to avoid this BUG_ON,
and avoid leak of dentry block resource, because we never have second chance to
release that block in ->evict_inode as in upper error path we make this inode
'bad'.

Signed-off-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
fs/f2fs/dir.c
This page took 0.05396 seconds and 4 git commands to generate.