alistair23-linux/fs/f2fs
Jaegeuk Kim 398b1ac5a5 f2fs: fix handling errors got by f2fs_write_inode
Ruslan reported that f2fs hangs with an infinite loop in f2fs_sync_file():

	while (sync_node_pages(sbi, inode->i_ino, &wbc) == 0)
		f2fs_write_inode(inode, NULL);

The reason was revealed that the cold flag is not set even thought this inode is
a normal file. Therefore, sync_node_pages() skips to write node blocks since it
only writes cold node blocks.

The cold flag is stored to the node_footer in node block, and whenever a new
node page is allocated, it is set according to its file type, file or directory.

But, after sudden-power-off, when recovering the inode page, f2fs doesn't recover
its cold flag.

So, let's assign the cold flag in more right places.

One more thing:
If f2fs_write_inode() returns an error due to whatever situations, there would
be no dirty node pages so that sync_node_pages() returns zero.
(i.e., zero means nothing was written.)

Reported-by: Ruslan N. Marchenko <me@ruff.mobi>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2012-12-26 10:39:52 +09:00
..
acl.c f2fs: resolve build failures 2012-12-11 13:43:43 +09:00
acl.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
checkpoint.c f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
data.c f2fs: cleanup the f2fs_bio_alloc routine 2012-12-11 13:43:45 +09:00
debug.c f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
dir.c f2fs: fix handling errors got by f2fs_write_inode 2012-12-26 10:39:52 +09:00
f2fs.h f2fs: fix tracking parent inode number 2012-12-11 13:43:45 +09:00
file.c f2fs: fix handling errors got by f2fs_write_inode 2012-12-26 10:39:52 +09:00
gc.c f2fs: remove unneeded initialization 2012-12-11 13:43:44 +09:00
gc.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
hash.c f2fs: fix up f2fs_get_parent issue to retrieve correct parent inode number 2012-12-26 10:39:52 +09:00
inode.c f2fs: fix handling errors got by f2fs_write_inode 2012-12-26 10:39:52 +09:00
Kconfig f2fs: resolve build failures 2012-12-11 13:43:43 +09:00
Makefile f2fs: update Kconfig and Makefile 2012-12-11 13:43:42 +09:00
namei.c f2fs: make use of GFP_F2FS_ZERO for setting gfp_mask 2012-12-11 13:43:44 +09:00
node.c f2fs: fix handling errors got by f2fs_write_inode 2012-12-26 10:39:52 +09:00
node.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
recovery.c f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
segment.c f2fs: remove set_page_dirty for atomic f2fs_end_io_write 2012-12-26 10:39:51 +09:00
segment.h f2fs: cleanup the f2fs_bio_alloc routine 2012-12-11 13:43:45 +09:00
super.c f2fs: fix wrong calculation on f_files in statfs 2012-12-26 10:39:51 +09:00
xattr.c f2fs: resolve build failures 2012-12-11 13:43:43 +09:00
xattr.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00