]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: fix fsync_inode list addition logic and avoid invalid access to memory
authorNamjae Jeon <namjae.jeon@samsung.com>
Sat, 22 Dec 2012 03:10:12 +0000 (12:10 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Fri, 28 Dec 2012 02:27:36 +0000 (11:27 +0900)
commit8c8cbfc1dbad39c41f77ccba7a195f5198fe4712
treedb675ff9033743c4d98f62422e04c9103fea777f
parenta101147795fb2ff90c70362129ca1eefe7eaa65f
f2fs: fix fsync_inode list addition logic and avoid invalid access to memory

In function find_fsync_dnodes() - the fsync inodes gets added to the list, but
in one path suppose f2fs_iget results in error, in such case - error gets added
to the fsync inode list.
In next call to recover_data()->get_fsync_inode()
entry = list_entry(this, struct fsync_inode_entry, list);
                if (entry->inode->i_ino == ino)
This can result in "invalid access to memory" when it encounters 'error' as
entry in the fsync inode list.
So, add the fsync inode entry to the list only in case of no errors.
And, free the object at that point itself in case of issue.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/recovery.c