f2fs: don't need to invalidate wrong node page
authorJaegeuk Kim <jaegeuk@kernel.org>
Sat, 4 Mar 2017 21:56:10 +0000 (13:56 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 21 Mar 2017 20:52:16 +0000 (16:52 -0400)
If f2fs_new_inode() is failed, the bad inode will invalidate 0'th node page
during f2fs_evict_inode(), which doesn't need to do.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/inode.c

index 24bb8213d974b710b43f286b1089ccff7946a50e..ef8610bf950f2796577752501df278e1d0ba8717 100644 (file)
@@ -411,7 +411,10 @@ no_delete:
        stat_dec_inline_dir(inode);
        stat_dec_inline_inode(inode);
 
-       invalidate_mapping_pages(NODE_MAPPING(sbi), inode->i_ino, inode->i_ino);
+       /* ino == 0, if f2fs_new_inode() was failed t*/
+       if (inode->i_ino)
+               invalidate_mapping_pages(NODE_MAPPING(sbi), inode->i_ino,
+                                                       inode->i_ino);
        if (xnid)
                invalidate_mapping_pages(NODE_MAPPING(sbi), xnid, xnid);
        if (inode->i_nlink) {