GitHub PushEvent at 2014-10-20 19:09:26
Repository: android_kernel_lge_g3
Actor: invisiblek
Payload: {"shas":[["f3a57c68a9914cfabb30a60e521a4b21de6efa45","69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org","f2fs: Pull in from upstream 3.13 kernel\n\nMerge tag 'for-3.8-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs\n\nPull new F2FS filesystem from Jaegeuk Kim:\n \"Introduce a new file system, Flash-Friendly File System (F2FS), to\n  Linux 3.8.\n\n  Highlights:\n   - Add initial f2fs source codes\n   - Fix an endian conversion bug\n   - Fix build failures on random configs\n   - Fix the power-off-recovery routine\n   - Minor cleanup, coding style, and typos patches\"\n\nFrom the Kconfig help text:\n\n  F2FS is based on Log-structured File System (LFS), which supports\n  versatile \"flash-friendly\" features. The design has been focused on\n  addressing the fundamental issues in LFS, which are snowball effect\n  of wandering tree and high cleaning overhead.\n\n  Since flash-based storages show different characteristics according to\n  the internal geometry or flash memory management schemes aka FTL, F2FS\n  and tools support various parameters not only for configuring on-disk\n  layout, but also for selecting allocation and cleaning algorithms.\n\nand there's an article by Neil Brown about it on lwn.net:\n\n  http://lwn.net/Articles/518988/\n\n* tag 'for-3.8-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (36 commits)\n  f2fs: fix tracking parent inode number\n  f2fs: cleanup the f2fs_bio_alloc routine\n  f2fs: introduce accessor to retrieve number of dentry slots\n  f2fs: remove redundant call to f2fs_put_page in delete entry\n  f2fs: make use of GFP_F2FS_ZERO for setting gfp_mask\n  f2fs: rewrite f2fs_bio_alloc to make it simpler\n  f2fs: fix a typo in f2fs documentation\n  f2fs: remove unused variable\n  f2fs: move error condition for mkdir at proper place\n  f2fs: remove unneeded initialization\n  f2fs: check read only condition before beginning write out\n  f2fs: remove unneeded memset from init_once\n  f2fs: show error in case of invalid mount arguments\n  f2fs: fix the compiler warning for uninitialized use of variable\n  f2fs: resolve build failures\n  f2fs: adjust kernel coding style\n  f2fs: fix endian conversion bugs reported by sparse\n  f2fs: remove unneeded version.h header file from f2fs.h\n  f2fs: update the f2fs document\n  f2fs: update Kconfig and Makefile\n  ...\n\nConflicts:\n\tinclude/uapi/linux/magic.h\n\nMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs\n\nPull f2fs bug fixes from Jaegeuk Kim:\n \"This patch-set includes two major bug fixes:\n   - incorrect IUsed provided by *df -i*, and\n   - lookup failure of parent inodes in corner cases.\n\n  [Other Bug Fixes]\n   - Fix error handling routines\n   - Trigger recovery process correctly\n   - Resolve build failures due to missing header files\n\n  [Etc]\n   - Add a MAINTAINERS entry for f2fs\n   - Fix and clean up variables, functions, and equations\n   - Avoid warnings during compilation\"\n\n* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs:\n  f2fs: unify string length declarations and usage\n  f2fs: clean up unused variables and return values\n  f2fs: clean up the start_bidx_of_node function\n  f2fs: remove unneeded variable from f2fs_sync_fs\n  f2fs: fix fsync_inode list addition logic and avoid invalid access to memory\n  f2fs: remove unneeded initialization of nr_dirty in dirty_seglist_info\n  f2fs: handle error from f2fs_iget_nowait\n  f2fs: fix equation of has_not_enough_free_secs()\n  f2fs: add MAINTAINERS entry\n  f2fs: return a default value for non-void function\n  f2fs: invalidate the node page if allocation is failed\n  f2fs: add missing #include <linux/prefetch.h>\n  f2fs: do f2fs_balance_fs in front of dir operations\n  f2fs: should recover orphan and fsync data\n  f2fs: fix handling errors got by f2fs_write_inode\n  f2fs: fix up f2fs_get_parent issue to retrieve correct parent inode number\n  f2fs: fix wrong calculation on f_files in statfs\n  f2fs: remove set_page_dirty for atomic f2fs_end_io_write\n\nMerge tag 'f2fs-for-3.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs\n\nPull f2fs fixes from Jaegeuk Kim:\n o Support swap file and link generic_file_remap_pages\n o Enhance the bio streaming flow and free section control\n o Major bug fix on recovery routine\n o Minor bug/warning fixes and code cleanups\n\n* tag 'f2fs-for-3.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (22 commits)\n  f2fs: use _safe() version of list_for_each\n  f2fs: add comments of start_bidx_of_node\n  f2fs: avoid issuing small bios due to several dirty node pages\n  f2fs: support swapfile\n  f2fs: add remap_pages as generic_file_remap_pages\n  f2fs: add __init to functions in init_f2fs_fs\n  f2fs: fix the debugfs entry creation path\n  f2fs: add global mutex_lock to protect f2fs_stat_list\n  f2fs: remove the blk_plug usage in f2fs_write_data_pages\n  f2fs: avoid redundant time update for parent directory in f2fs_delete_entry\n  f2fs: remove redundant call to set_blocksize in f2fs_fill_super\n  f2fs: move f2fs_balance_fs to punch_hole\n  f2fs: add f2fs_balance_fs in several interfaces\n  f2fs: revisit the f2fs_gc flow\n  f2fs: check return value during recovery\n  f2fs: avoid null dereference in f2fs_acl_from_disk\n  f2fs: initialize newly allocated dnode structure\n  f2fs: update f2fs partition info about SIT/NAT layout\n  f2fs: update f2fs document to reflect SIT/NAT layout correctly\n  f2fs: remove unneeded INIT_LIST_HEAD at few places\n  ...\n\nMerge tag 'f2fs-for-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs\n\nPull f2fs update from Jaegeuk Kim:\n \"[Major bug fixes]\n   o Store device file information correctly\n   o Fix -EIO handling with respect to power-off-recovery\n   o Allocate blocks with global locks\n   o Fix wrong calculation of the SSR cost\n\n  [Cleanups]\n   o Get rid of fake on-stack dentries\n\n  [Enhancement]\n   o Support (un)freeze_fs\n   o Enhance the f2fs_gc flow\n   o Support 32-bit binary execution on 64-bit kernel\"\n\n* tag 'f2fs-for-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (29 commits)\n  f2fs: avoid build warning\n  f2fs: add compat_ioctl to provide backward compatability\n  f2fs: fix calculation of max. gc cost in the SSR case\n  f2fs: clarify and enhance the f2fs_gc flow\n  f2fs: optimize the return condition for has_not_enough_free_secs\n  f2fs: make an accessor to get sections for particular block type\n  f2fs: mark gc_thread as NULL when thread creation is failed\n  f2fs: name gc task as per the block device\n  f2fs: remove unnecessary gc option check and balance_fs\n  f2fs: remove repeated F2FS_SET_SB_DIRT call\n  f2fs: when check superblock failed, try to check another superblock\n  f2fs: use F2FS_BLKSIZE to judge bloksize and page_cache_size\n  f2fs: add device name in debugfs\n  f2fs: stop repeated checking if cp is needed\n  f2fs: avoid balanc_fs during evict_inode\n  f2fs: remove the use of page_cache_release\n  f2fs: fix typo mistake for data_version description\n  f2fs: reorganize code for ra_node_page\n  f2fs: avoid redundant call to has_not_enough_free_secs in f2fs_gc\n  f2fs: add un/freeze_fs into super_operations\n  ...\n\nMerge tag 'f2fs-for-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs\n\nPull f2fs updates from Jaegeuk Kim:\n \"This patch-set includes the following major enhancement patches.\n   - introduce a new gloabl lock scheme\n   - add tracepoints on several major functions\n   - fix the overall cleaning process focused on victim selection\n   - apply the block plugging to merge IOs as much as possible\n   - enhance management of free nids and its list\n   - enhance the readahead mode for node pages\n   - address several cretical deadlock conditions\n   - reduce lock_page calls\n\n  The other minor bug fixes and enhancements are as follows.\n   - calculation mistakes: overflow\n   - bio types: READ, READA, and READ_SYNC\n   - fix the recovery flow, data races, and null pointer errors\"\n\n* tag 'f2fs-for-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (68 commits)\n  f2fs: cover free_nid management with spin_lock\n  f2fs: optimize scan_nat_page()\n  f2fs: code cleanup for scan_nat_page() and build_free_nids()\n  f2fs: bugfix for alloc_nid_failed()\n  f2fs: recover when journal contains deleted files\n  f2fs: continue to mount after failing recovery\n  f2fs: avoid deadlock during evict after f2fs_gc\n  f2fs: modify the number of issued pages to merge IOs\n  f2fs: remove useless #include <linux/proc_fs.h> as we're now using sysfs as debug entry.\n  f2fs: fix inconsistent using of NM_WOUT_THRESHOLD\n  f2fs: check truncation of mapping after lock_page\n  f2fs: enhance alloc_nid and build_free_nids flows\n  f2fs: add a tracepoint on f2fs_new_inode\n  f2fs: check nid == 0 in add_free_nid\n  f2fs: add REQ_META about metadata requests for submit\n  f2fs: give a chance to merge IOs by IO scheduler\n  f2fs: avoid frequent background GC\n  f2fs: add tracepoints to debug checkpoint request\n  f2fs: add tracepoints for write page operations\n  f2fs: add tracepoints to debug the block allocation\n  ...\n\nMerge tag 'for-f2fs-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs\n\nPull f2fs updates from Jaegeuk Kim:\n \"This patch-set includes the following major enhancement patches:\n   - remount_fs callback function\n   - restore parent inode number to enhance the fsync performance\n   - xattr security labels\n   - reduce the number of redundant lock/unlock data pages\n   - avoid frequent write_inode calls\n\n  The other minor bug fixes are as follows.\n   - endian conversion bugs\n   - various bugs in the roll-forward recovery routine\"\n\n* tag 'for-f2fs-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (56 commits)\n  f2fs: fix to recover i_size from roll-forward\n  f2fs: remove the unused argument \"sbi\" of func destroy_fsync_dnodes()\n  f2fs: remove reusing any prefree segments\n  f2fs: code cleanup and simplify in func {find/add}_gc_inode\n  f2fs: optimize the init_dirty_segmap function\n  f2fs: fix an endian conversion bug detected by sparse\n  f2fs: fix crc endian conversion\n  f2fs: add remount_fs callback support\n  f2fs: recover wrong pino after checkpoint during fsync\n  f2fs: optimize do_write_data_page()\n  f2fs: make locate_dirty_segment() as static\n  f2fs: remove unnecessary parameter \"offset\" from __add_sum_entry()\n  f2fs: avoid freqeunt write_inode calls\n  f2fs: optimise the truncate_data_blocks_range() range\n  f2fs: use the F2FS specific flags in f2fs_ioctl()\n  f2fs: sync dir->i_size with its block allocation\n  f2fs: fix i_blocks translation on various types of files\n  f2fs: set sb->s_fs_info before calling parse_options()\n  f2fs: support xattr security labels\n  f2fs: fix iget/iput of dir during recovery\n  ...\n\nMerge tag 'for-f2fs-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs\n\nPull f2fs updates from Jaegeuk Kim:\n \"This patch-set includes the following major enhancement patches:\n   - support inline xattrs\n   - add sysfs support to control GCs explicitly\n   - add proc entry to show the current segment usage information\n   - improve the GC/SSR performance\n\n  The other bug fixes are as follows:\n   - avoid the overflow on status calculation\n   - fix some error handling routines\n   - fix inconsistent xattr states after power-off-recovery\n   - fix incorrect xattr node offset definition\n   - fix deadlock condition in fsync\n   - fix the fdatasync routine for power-off-recovery\"\n\n* tag 'for-f2fs-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (40 commits)\n  f2fs: optimize gc for better performance\n  f2fs: merge more bios of node block writes\n  f2fs: avoid an overflow during utilization calculation\n  f2fs: trigger GC when there are prefree segments\n  f2fs: use strncasecmp() simplify the string comparison\n  f2fs: fix omitting to update inode page\n  f2fs: support the inline xattrs\n  f2fs: add the truncate_xattr_node function\n  f2fs: introduce __find_xattr for readability\n  f2fs: reserve the xattr space dynamically\n  f2fs: add flags for inline xattrs\n  f2fs: fix error return code in init_f2fs_fs()\n  f2fs: fix wrong BUG_ON condition\n  f2fs: fix memory leak when init f2fs filesystem fail\n  f2fs: fix a compound statement label error\n  f2fs: avoid writing inode redundantly when creating a file\n  f2fs: alloc_page() doesn't return an ERR_PTR\n  f2fs: should cover i_xattr_nid with its xattr node page lock\n  f2fs: check the free space first in new_node_page\n  f2fs: clean up the needless end 'return' of void function\n  ...\n\nMerge tag 'for-f2fs-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs\n\nPull f2fs updates from Jaegeuk Kim:\n \"This patch-set includes the following major enhancement patches.\n   - add a sysfs to control reclaiming free segments\n   - enhance the f2fs global lock procedures\n   - enhance the victim selection flow\n   - wait for selected node blocks during fsync\n   - add some tracepoints\n   - add a config to remove abundant BUG_ONs\n\n  The other bug fixes are as follows.\n   - fix deadlock on acl operations\n   - fix some bugs with respect to orphan inodes\n\n  And, there are a bunch of cleanups\"\n\n* tag 'for-f2fs-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (42 commits)\n  f2fs: issue more large discard command\n  f2fs: fix memory leak after kobject init failed in fill_super\n  f2fs: cleanup waiting routine for writeback pages in cp\n  f2fs: avoid to use a NULL point in destroy_segment_manager\n  f2fs: remove unnecessary TestClearPageError when wait pages writeback\n  f2fs: update f2fs document\n  f2fs: avoid to wait all the node blocks during fsync\n  f2fs: check all ones or zeros bitmap with bitops for better mount performance\n  f2fs: change the method of calculating the number summary blocks\n  f2fs: fix calculating incorrect free size when update xattr in __f2fs_setxattr\n  f2fs: add an option to avoid unnecessary BUG_ONs\n  f2fs: introduce CONFIG_F2FS_CHECK_FS for BUG_ON control\n  f2fs: fix a deadlock during init_acl procedure\n  f2fs: clean up acl flow for better readability\n  f2fs: remove unnecessary segment bitmap updates\n  f2fs: add tracepoint for vm_page_mkwrite\n  f2fs: add tracepoint for set_page_dirty\n  f2fs: remove redundant set_page_dirty from write_compacted_summaries\n  f2fs: add reclaiming control by sysfs\n  f2fs: introduce f2fs_balance_fs_bg for some background jobs\n  ...\n\nChange-Id: Ied5488471d49d64ce6abb4be19237c4e90829ff6","Linus Torvalds",true],["0330d23dbf3169a23b934132c62581bba9d15086","027f0158ac3b417c565c1fb96c84300078c91cf6@gmail.com","F2FS: Backport to 3.4\n\nBased off of patches here:\nnowcomputing/f2fs-backports#1\n\nChange-Id: I2be6d8abf4e3e4c6b9e8d635700930af432fe37a","Evan McClain",true],["f9e6fc410b517f021709e5622d685d673b5f129d","f10da886ecf5f6d400f766170992d382feccd416@samsung.com","f2fs: Update to version in 3.14\n\nf2fs: introduce __find_rev_next(_zero)_bit\n\nWhen f2fs_set_bit is used, in a byte MSB and LSB is reversed,\nin that case we can use __find_rev_next_bit or __find_rev_next_zero_bit.\n\nSigned-off-by: Changman Lee <cm224.lee@samsung.com>\n[Jaegeuk Kim: change the function names]\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: improve searching speed of __next_free_blkoff\n\nTo find a zero bit using the result of OR operation between ckpt_valid_map\nand cur_valid_map is more fast than find a zero bit in each bitmap.\n\nSigned-off-by: Changman Lee <cm224.lee@samsung.com>\n[Jaegeuk Kim: adjust changed function name]\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add a slab cache entry for small discards\n\nThis patch adds a slab cache entry for small discards.\n\nEach entry consists of:\n\nstruct discard_entry {\n\tstruct list_head list;\t/* list head */\n\tblock_t blkaddr;\t/* block address to be discarded */\n\tint len;\t\t/* # of consecutive blocks of the discard */\n};\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add key functions for small discards\n\nThis patch adds key functions to activate the small discard feature.\n\nNote that this procedure is conducted during the checkpoint only.\n\nIn flush_sit_entries(), when a new dirty sit entry is flushed, f2fs calls\nadd_discard_addrs() which searches candidates to be discarded.\nThe candidates should be marked *invalidated* and also previous checkpoint\nrecognizes it as *valid*.\n\nAt the end of a checkpoint procedure, f2fs throws discards based on the\ndiscard entry list.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add a sysfs entry to control max_discards\n\nIf frequent small discards are issued to the device, the performance would\nbe degraded significantly.\nSo, this patch adds a sysfs entry to control the number of discards to be\nissued during a checkpoint procedure.\n\nBy default, f2fs does not issue any small discards, which means max_discards\nis zero.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: introduce f2fs_issue_discard() to clean up\n\nChange log from v1:\n o fix 32bit drops reported by Dan Carpenter\n\nThis patch adds f2fs_issue_discard() to clean up blkdev_issue_discard() flows.\n\nDan carpenter reported:\n\"block_t is a 32 bit type and sector_t is a 64 bit type.  The upper 32\nbits of the sector_t are not used because the shift will wrap.\"\n\nBug-Reported-by: Dan Carpenter <dan.carpenter@oracle.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add a tracepoint for f2fs_issue_discard\n\nThis patch adds a tracepoint for f2fs_issue_discard.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: use f2fs_put_page to release page for uniform style\n\nWe should use f2fs_put_page to release page for uniform style of f2fs code.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: clean up the do_submit_bio flow\n\nThis patch introduces PAGE_TYPE_OF_BIO() and cleans up do_submit_bio() with it.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: use sbi->write_mutex for write bios\n\nThis patch removes an unnecessary semaphore (i.e., sbi->bio_sem).\nThere is no reason to use the semaphore when f2fs submits read and write IOs.\nInstead, let's use a write mutex and cover the sbi->bio[] by the lock.\n\nChange log from v1:\n o split write_mutex suggested by Chao Yu\n\nChao described,\n\"All DATA/NODE/META bio buffers in superblock is protected by\n'sbi->write_mutex', but each bio buffer area is independent, So we\nshould split write_mutex to three for DATA/NODE/META.\"\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: disable the extent cache ops on high fragmented files\n\nThe f2fs manages an extent cache to search a number of consecutive data blocks\nvery quickly.\n\nHowever it conducts unnecessary cache operations if the file is highly\nfragmented with no valid extent cache.\n\nIn such the case, we don't need to handle the extent cache, but just can disable\nthe cache facility.\n\nNevertheless, this patch gives one more chance to enable the extent cache.\n\nFor example,\n1. create a file\n2. write data sequentially which produces a large valid extent cache\n3. update some data, resulting in a fragmented extent\n4. if the fragmented extent is too small, then drop extent cache\n5. close the file\n\n6. open the file again\n7. give another chance to make a new extent cache\n8. write data sequentially again which creates another big extent cache.\n...\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: introduce a bio array for per-page write bios\n\nThe f2fs has three bio types, NODE, DATA, and META, and manages some data\nstructures per each bio types.\n\nThe codes are a little bit messy, thus, this patch introduces a bio array\nwhich groups individual data structures as follows.\n\nstruct f2fs_bio_info {\n\tstruct bio *bio;\t\t/* bios to merge */\n\tsector_t last_block_in_bio;\t/* last block number */\n\tstruct mutex io_mutex;\t\t/* mutex for bio */\n};\n\nstruct f2fs_sb_info {\n\t...\n\tstruct f2fs_bio_info write_io[NR_PAGE_TYPE];\t/* for write bios */\n\t...\n};\n\nThe code changes from this new data structure are trivial.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: convert remove_inode_page to void\n\nSigned-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: convert dev_valid_block_count to void\n\nSigned-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: convert inc/dec_valid_node_count to inc/dec one count\n\nSigned-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: simplify write_orphan_inodes for better readable\n\nSimplify write_orphan_inodes for better readable. Because we hold the\norphan_inode_mutex, so it's safe to use list_for_each_entry instead of\nlist_for_each_safe.\n\nSigned-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: move the list_head initialization into the lock protection region\n\nSigned-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add a new function to support for merging contiguous read\n\nFor better read performance, we add a new function to support for merging\ncontiguous read as the one for write.\n\nv1-->v2:\n o add declarations here as Gu Zheng suggested.\n o use new structure f2fs_bio_info introduced by Jaegeuk Kim.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nAcked-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\n\nf2fs: merge read IOs at ra_nat_pages()\n\nChange log from v1:\n  o add mark_page_accessed() not to reclaim the nat pages.\n\nThis patch changes the policy of submitting read bios at ra_nat_pages.\n\nPreviously, f2fs submits small read bios with block plugging.\nBut, with this patch, f2fs itself merges read bios first and then submits a\nlarge bio, which can reduce the bio handling overheads.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: simplify IS_DATASEG and IS_NODESEG macro\n\nIt is not efficient comparing each segment type to find node or data.\n\nSigned-off-by: Changman Lee <cm224.lee@samsung.com>\n[Jaegeuk Kim: remove unnecessary white spaces]\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: adds a tracepoint for submit_read_page\n\nThis patch adds a tracepoint for submit_read_page.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\n[Jaegeuk Kim: integrate tracepoints of f2fs_submit_read(_write)_page]\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: adds a tracepoint for f2fs_submit_read_bio\n\nThis patch adds a tracepoint for f2fs_submit_read_bio.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\n[Jaegeuk Kim: integrate tracepoints of f2fs_submit_read(_write)_bio]\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: read contiguous sit entry pages by merging for mount performance\n\nPreviously we read sit entries page one by one, this method lost the chance\nof reading contiguous page together. So we read pages as contiguous as\npossible for better mount performance.\n\nchange log:\n o merge judgements/use 'Continue' or 'Break' instead of 'Goto' as Gu Zheng\n   suggested.\n o add mark_page_accessed() before release page to delay VM reclaiming.\n o remove '*order' for simplification of function as Jaegeuk Kim suggested.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\n[Jaegeuk Kim: fix a bug on the block address calculation]\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: avoid lock debugging overhead\n\nIf CONFIG_F2FS_CHECK_FS is unset, we don't need to add any debugging overhead.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add a new function: f2fs_reserve_block()\n\nAdd the function f2fs_reserve_block() to easily reserve new blocks, and\nuse it to clean up more codes.\n\nSigned-off-by: Huajun Li <huajun.li@intel.com>\nSigned-off-by: Haicheng Li <haicheng.li@linux.intel.com>\nSigned-off-by: Weihong Xu <weihong.xu@intel.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add detailed information of bio types in the tracepoints\n\nThis patch inserts information of bio types in more detail.\nSo, we can now see REQ_META and REQ_PRIO too.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: send REQ_META or REQ_PRIO when reading meta area\n\nLet's send REQ_META or REQ_PRIO when reading meta area such as NAT/SIT\netc.\n\nSigned-off-by: Changman Lee <cm224.lee@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add flags and helpers to support inline data\n\nAdd new inode flags F2FS_INLINE_DATA and FI_INLINE_DATA to indicate\nwhether the inode has inline data.\n\nInline data makes use of inode block's data indices region to save small\nfile. Currently there are 923 data indices in an inode block. Since\ninline xattr has made use of the last 50 indices to save its data, there\nare 873 indices left which can be used for inline data. When\nFI_INLINE_DATA is set, the layout of inode block's indices region is\nlike below:\n\n+-----------------+\n|                 | Reserved. reserve_new_block() will make use of\n| i_addr[0]       | i_addr[0] when we need to reserve a new data block\n|                 | to convert inline data into regular one's.\n|-----------------|\n|                 | Used by inline data. A file whose size is less than\n| i_addr[1~872]   | 3488 bytes(~3.4k) and doesn't reserve extra\n|                 | blocks by fallocate() can be saved here.\n|-----------------|\n|                 |\n| i_addr[873~922] | Reserved for inline xattr\n|                 |\n+-----------------+\n\nSigned-off-by: Haicheng Li <haicheng.li@linux.intel.com>\nSigned-off-by: Huajun Li <huajun.li@intel.com>\nSigned-off-by: Weihong Xu <weihong.xu@intel.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add a new mount option: inline_data\n\nAdd a mount option: inline_data. If the mount option is set,\ndata of New created small files can be stored in their inode.\n\nSigned-off-by: Huajun Li <huajun.li@intel.com>\nSigned-off-by: Haicheng Li <haicheng.li@linux.intel.com>\nSigned-off-by: Weihong Xu <weihong.xu@intel.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: remove unnecessary return value\n\nLet's remove the unnecessary return value.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: fix a potential out of range issue\n\nFix a potential out of range issue introduced by commit:\n22fb72225a\nf2fs: simplify write_orphan_inodes for better readable\n\nSigned-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: bug fix on bit overflow from 32bits to 64bits\n\nThis patch fixes some bit overflows by the shift operations.\n\nDan Carpenter reported potential bugs on bit overflows as follows.\n\nfs/f2fs/segment.c:910 submit_write_page()\n\twarn: should 'blk_addr << ((sbi)->log_blocksize - 9)' be a 64 bit type?\nfs/f2fs/checkpoint.c:429 get_valid_checkpoint()\n\twarn: should '1 << ()' be a 64 bit type?\nfs/f2fs/data.c:408 f2fs_readpage()\n\twarn: should 'blk_addr << ((sbi)->log_blocksize - 9)' be a 64 bit type?\nfs/f2fs/data.c:457 submit_read_page()\n\twarn: should 'blk_addr << ((sbi)->log_blocksize - 9)' be a 64 bit type?\nfs/f2fs/data.c:525 get_data_block_ro()\n\twarn: should 'i << blkbits' be a 64 bit type?\n\nBug-Reported-by: Dan Carpenter <dan.carpenter@oracle.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: remove unnecessary condition checks\n\nThis patch removes the unnecessary condition checks on:\n\nfs/f2fs/gc.c:667 do_garbage_collect() warn: 'sum_page' isn't an ERR_PTR\nfs/f2fs/f2fs.h:795 f2fs_put_page() warn: 'page' isn't an ERR_PTR\n\nReported-by: Dan Carpenter <dan.carpenter@oracle.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: remove unneeded code in punch_hole\n\nBecause FALLOC_FL_PUNCH_HOLE flag must be ORed with FALLOC_FL_KEEP_SIZE\nin fallocate, so we could remove the useless 'keep size' branch code which\nwill never be excuted in punch_hole.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Fan Li <fanofcode.li@samsung.com>\n[Jaegeuk Kim: remove an unnecessary parameter togather]\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: avoid to calculate incorrect max orphan number\n\nBecause we will write node summaries when do_checkpoint with umount flag,\nour number of max orphan blocks should minus NR_CURSEG_NODE_TYPE additional.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Shu Tan <shu.tan@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: correct type of wait in struct bio_private\n\nThe void *wait in bio_private is used for waiting completion of checkpoint bio.\nSo we don't need to use its type as void, but declare it as completion type.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\n[Jaegeuk Kim: add description]\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: use true and false for boolean variable\n\nThe inode_page_locked should be a boolean variable.\n\nstruct dnode_of_data {\n\tstruct inode *inode;            /* vfs inode pointer */\n\tstruct page *inode_page;        /* its inode page, NULL is possible */\n\tstruct page *node_page;         /* cached direct node page */\n\tnid_t nid;                      /* node id of the direct node block */\n\tunsigned int ofs_in_node;       /* data offset in the node page */\n==>\tbool inode_page_locked;         /* inode page is locked or not */\n\tblock_t data_blkaddr;           /* block address of the node block */\n};\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\n[Jaegeuk Kim: add description]\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: check return value of f2fs_readpage in find_data_page\n\nWe should return error if we do not get an updated page in find_date_page\nwhen f2fs_readpage failed.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: convert recover_orphan_inodes to void\n\nThe recover_orphan_inodes() returns no error all the time, so we don't need to\ncheck its errors.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\n[Jaegeuk Kim: add description]\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: remove the own bi_private allocation\n\nPreviously f2fs allocates its own bi_private data structure all the time even\nthough we don't use it. But, can we remove this bi_private allocation?\n\nThis patch removes such the additional bi_private allocation.\n\n1. Retrieve f2fs_sb_info from its page->mapping->host->i_sb.\n - This removes the usecases of bi_private in end_io.\n\n2. Use bi_private only when we really need it.\n - The bi_private is used only when the checkpoint procedure is conducted.\n - When conducting the checkpoint, f2fs submits a META_FLUSH bio to wait its bio\ncompletion.\n - Since we have no dependancies to remove bi_private now, let's just use\n bi_private pointer as the completion pointer.\n\nReviewed-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: refactor bio-related operations\n\nThis patch integrates redundant bio operations on read and write IOs.\n\n1. Move bio-related codes to the top of data.c.\n2. Replace f2fs_submit_bio with f2fs_submit_merged_bio, which handles read\n   bios additionally.\n3. Introduce __submit_merged_bio to submit the merged bio.\n4. Change f2fs_readpage to f2fs_submit_page_bio.\n5. Introduce f2fs_submit_page_mbio to integrate previous submit_read_page and\n   submit_write_page.\n\nReviewed-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nReviewed-by: Chao Yu <chao2.yu@samsung.com >\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: readahead contiguous pages for restore_node_summary\n\nIf cp has no CP_UMOUNT_FLAG, we will read all pages in whole node segment\none by one, it makes low performance. So let's merge contiguous pages and\nreadahead for better performance.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\n[Jaegeuk Kim: adjust the new bio operations]\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: remove debufs dir if debugfs_create_file() failed\n\nWhen debugfs_create_file() failed in f2fs_create_root_stats(),\ndebugfs_root should be remove.\n\nSigned-off-by: Younger Liu <liuyiyang@hisense.com>\nCc: Younger Liu <younger.liucn@gmail.com>\nCc: Jaegeuk Kim <jaegeuk.kim@samsung.com>\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: replace the debugfs_root with f2fs_debugfs_root\n\nThis minor change for the naming conventions of debugfs_root\nto avoid any possible conflicts to the other filesystem.\n\nSigned-off-by: Younger Liu <younger.liucn@gmail.com>\nCc: Younger Liu <younger.liucn@gmail.com>\nCc: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n[Jaegeuk Kim: change the patch name]\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: use inner macro GFP_F2FS_ZERO for simplification\n\nUse inner macro GFP_F2FS_ZERO to instead of GFP_NOFS | __GFP_ZERO for\nsimplification of code.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: avoid unneeded page release for correct _count of page\n\nIn find_fsync_dnodes() and recover_data(), our flow is like this:\n\n->f2fs_submit_page_bio()\n\t-> f2fs_put_page()\n\t\t-> page_cache_release()\t---- page->_count declined to zero.\n->__free_pages()\n\t-> put_page_testzero() ---- page->_count will be declined again.\n\nWe will get a segment fault in put_page_testzero when CONFIG_DEBUG_VM\nis on, or return MM with a bad page with wrong _count num.\n\nSo let's just release this page.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add unlikely() macro for compiler optimization\n\nAs we know, some of our branch condition will rarely be true. So we could add\n'unlikely' to let compiler optimize these code, by this way we could drop\nunneeded 'jump' assemble code to improve performance.\n\nchange log:\n o add *unlikely* as many as possible across the whole source files at once\n   suggested by Jaegeuk Kim.\n\nSuggested-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add unlikely() macro for compiler more aggressively\n\nThis patch adds unlikely() macro into the most of codes.\nThe basic rule is to add that when:\n- checking unusual errors,\n- checking page mappings,\n- and the other unlikely conditions.\n\nChange log from v1:\n - Don't add unlikely for the NULL test and error test: advised by Andi Kleen.\n\nCc: Chao Yu <chao2.yu@samsung.com>\nCc: Andi Kleen <andi@firstfloor.org>\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: merge pages with the same sync_mode flag\n\nPreviously f2fs submits most of write requests using WRITE_SYNC, but f2fs_write_data_pages\nsubmits last write requests by sync_mode flags callers pass.\n\nThis causes a performance problem since continuous pages with different sync flags\ncan't be merged in cfq IO scheduler(thanks yu chao for pointing it out), and synchronous\nrequests often take more time.\n\nThis patch makes the following modifies to DATA writebacks:\n\n1. every page will be written back using the sync mode caller pass.\n2. only pages with the same sync mode can be merged in one bio request.\n\nThese changes are restricted to DATA pages.Other types of writebacks are modified\nTo remain synchronous.\n\nIn my test with tiotest, f2fs sequence write performance is improved by about 7%-10% ,\nand this patch has no obvious impact on other performance tests.\n\nSigned-off-by: Fan Li <fanofcode.li@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: refactor bio->rw handling\n\nThis patch introduces f2fs_io_info to mitigate the complex parameter list.\n\nstruct f2fs_io_info {\n\tenum page_type type;\t\t/* contains DATA/NODE/META/META_FLUSH */\n\tint rw;\t\t\t\t/* contains R/RS/W/WS */\n\tint rw_flag;\t\t\t/* contains REQ_META/REQ_PRIO */\n}\n\n1. f2fs_write_data_pages\n - DATA\n - WRITE_SYNC is set when wbc->WB_SYNC_ALL.\n\n2. sync_node_pages\n - NODE\n - WRITE_SYNC all the time\n\n3. sync_meta_pages\n - META\n - WRITE_SYNC all the time\n - REQ_META | REQ_PRIO all the time\n\n ** f2fs_submit_merged_bio() handles META_FLUSH.\n\n4. ra_nat_pages, ra_sit_pages, ra_sum_pages\n - META\n - READ_SYNC\n\nCc: Fan Li <fanofcode.li@samsung.com>\nCc: Changman Lee <cm224.lee@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: fix the location of tracepoint\n\nWe need to get a trace before submit_bio, since its bi_sector is remapped during\nthe submit_bio.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: missing kmem_cache_destroy for discard_entry\n\ninsmod f2fs.ko is failed after insmod and rmmod firstly.\n\n$ sudo insmod fs/f2fs/f2fs.ko\ninsmod: error inserting 'fs/f2fs/f2fs.ko': -1 Cannot allocate memory\n\n-- dmesg --\nkmem_cache_sanity_check (free_nid): Cache name already exists.\n\nSigned-off-by: Changman Lee <cm224.lee@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: introduce sysfs entry to control in-place-update policy\n\nThis patch introduces new sysfs entries for users to control the policy of\nin-place-updates, namely IPU, in f2fs.\n\nSometimes f2fs suffers from performance degradation due to its out-of-place\nupdate policy that produces many additional node block writes.\nIf the storage performance is very dependant on the amount of data writes\ninstead of IO patterns, we'd better drop this out-of-place update policy.\n\nThis patch suggests 5 polcies and their triggering conditions as follows.\n\n[sysfs entry name = ipu_policy]\n\n0: F2FS_IPU_FORCE       all the time,\n1: F2FS_IPU_SSR         if SSR mode is activated,\n2: F2FS_IPU_UTIL        if FS utilization is over threashold,\n3: F2FS_IPU_SSR_UTIL    if SSR mode is activated and FS utilization is over\n                        threashold,\n4: F2FS_IPU_DISABLE    disable IPU. (=default option)\n\n[sysfs entry name = min_ipu_util]\n\nThis parameter controls the threshold to trigger in-place-updates.\nThe number indicates percentage of the filesystem utilization, and used by\nF2FS_IPU_UTIL and F2FS_IPU_SSR_UTIL policies.\n\nFor more details, see need_inplace_update() in segment.h.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: introduce a new direct_IO write path\n\nPreviously, f2fs doesn't support direct IOs with high performance, which throws\nevery write requests via the buffered write path, resulting in highly\nperformance degradation due to memory opeations like copy_from_user.\n\nThis patch introduces a new direct IO path in which every write requests are\nprocessed by generic blockdev_direct_IO() with enhanced get_block function.\n\nThe get_data_block() in f2fs handles:\n1. if original data blocks are allocates, then give them to blockdev.\n2. otherwise,\n  a. preallocate requested block addresses\n  b. do not use extent cache for better performance\n  c. give the block addresses to blockdev\n\nThis policy induces that:\n- new allocated data are sequentially written to the disk\n- updated data are randomly written to the disk.\n- f2fs gives consistency on its file meta, not file data.\n\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: write dirty meta pages collectively\n\nThis patch enhances writing dirty meta pages collectively in background.\nDuring the file data writes, it'd better avoid to write small dirty meta pages\nfrequently.\nSo let's give a chance to collect a number of dirty meta pages for a while.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: move all the bio initialization into __bio_alloc\n\nMove all the bio initialization into __bio_alloc, and some minor cleanups are\nalso added.\n\nv3:\n  Use 'bool' rather than 'int' as Kim suggested.\n\nv2:\n  Use 'is_read' rather than 'rw' as Yu Chao suggested.\n  Remove the needless initialization of bio->bi_private.\n\nSigned-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: remove the rw_flag domain from f2fs_io_info\n\nWhen using the f2fs_io_info in the low level, we still need to merge the\nrw and rw_flag, so use the rw to hold all the io flags directly,\nand remove the rw_flag field.\n\nps.It is based on the previous patch:\nf2fs: move all the bio initialization into __bio_alloc\n\nSigned-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: update several comments\n\nUpdate several comments:\n1. use f2fs_{un}lock_op install of mutex_{un}lock_op.\n2. update comment of get_data_block().\n3. update description of node offset.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: avoid to set wrong pino of inode when rename dir\n\nWhen we rename a dir to new name which is not exist previous,\nwe will set pino of parent inode with ino of child inode in f2fs_set_link.\nIt destroy consistency of pino, it should be fixed.\n\nThanks for previous work of Shu Tan.\n\nSigned-off-by: Shu Tan <shu.tan@samsung.com>\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: check filename length in recover_dentry\n\nIn current flow, we will get Null return value of f2fs_find_entry in\nrecover_dentry when name.len is bigger than F2FS_NAME_LEN, and then we\nstill add this inode into its dir entry.\nTo avoid this situation, we must check filename length before we use it.\n\nAnother point is that we could remove the code of checking filename length\nIn f2fs_find_entry, because f2fs_lookup will be called previously to ensure of\nvalidity of filename length.\n\nV2:\n o add WARN_ON() as Jaegeuk Kim suggested.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: introduce F2FS_INODE macro to get f2fs_inode\n\nThis patch introduces F2FS_INODE that returns struct f2fs_inode * from the inode\npage.\nBy using this macro, we can remove unnecessary casting codes like below.\n\n   struct f2fs_inode *ri = &F2FS_NODE(inode_page)->i;\n-> struct f2fs_inode *ri = F2FS_INODE(inode_page);\n\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: should put the dnode when NEW_ADDR is detected\n\nWhen get_dnode_of_data() in get_data_block() returns a successful dnode, we\nshould put the dnode.\nBut, previously, if its data block address is equal to NEW_ADDR, we didn't do\nthat, resulting in a deadlock condition.\nSo, this patch splits original error conditions with this case, and then calls\nf2fs_put_dnode before finishing the function.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: check the blocksize before calling generic_direct_IO path\n\nThe f2fs supports 4KB block size. If user requests dwrite with under 4KB data,\nit allocates a new 4KB data block.\nHowever, f2fs doesn't add zero data into the untouched data area inside the\nnewly allocated data block.\n\nThis incurs an error during the xfstest #263 test as follow.\n\n263 12s ... [failed, exit status 1] - output mismatch (see 263.out.bad)\n\t--- 263.out\t2013-03-09 03:37:15.043967603 +0900\n\t+++ 263.out.bad\t2013-12-27 04:20:39.230203114 +0900\n\t@@ -1,3 +1,976 @@\n\tQA output created by 263\n\tfsx -N 10000 -o 8192 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z\n\t-fsx -N 10000 -o 128000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z\n\t+fsx -N 10000 -o 8192 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z\n\t+truncating to largest ever: 0x12a00\n\t+truncating to largest ever: 0x75400\n\t+fallocating to largest ever: 0x79cbf\n\t...\n\t(Run 'diff -u 263.out 263.out.bad' to see the entire diff)\n\tRan: 263\n\tFailures: 263\n\tFailed 1 of 1 tests\n\nIt turns out that, when the test tries to write 2KB data with dio, the new dio\npath allocates 4KB data block without filling zero data inside the remained 2KB\narea. Finally, the output file contains a garbage data for that region.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: convert max_orphans to a field of f2fs_sb_info\n\nPreviously, we need to calculate the max orphan num when we try to acquire an\norphan inode, but it's a stable value since the super block was inited. So\nconverting it to a field of f2fs_sb_info and use it directly when needed seems\na better choose.\n\nSigned-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: key functions to handle inline data\n\nFunctions to implement inline data read/write, and move inline data to\nnormal data block when file size exceeds inline data limitation.\n\nSigned-off-by: Huajun Li <huajun.li@intel.com>\nSigned-off-by: Haicheng Li <haicheng.li@linux.intel.com>\nSigned-off-by: Weihong Xu <weihong.xu@intel.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: handle inline data operations\n\nHook inline data read/write, truncate, fallocate, setattr, etc.\n\nFiles need meet following 2 requirement to inline:\n 1) file size is not greater than MAX_INLINE_DATA;\n 2) file doesn't pre-allocate data blocks by fallocate().\n\nFI_INLINE_DATA will not be set while creating a new regular inode because\nmost of the files are bigger than ~3.4K. Set FI_INLINE_DATA only when\ndata is submitted to block layer, ranther than set it while creating a new\ninode, this also avoids converting data from inline to normal data block\nand vice versa.\n\nWhile writting inline data to inode block, the first data block should be\nreleased if the file has a block indexed by i_addr[0].\n\nOn the other hand, when a file operation is appied to a file with inline\ndata, we need to test if this file can remain inline by doing this\noperation, otherwise it should be convert into normal file by reserving\na new data block, copying inline data to this new block and clear\nFI_INLINE_DATA flag. Because reserve a new data block here will make use\nof i_addr[0], if we save inline data in i_addr[0..872], then the first\n4 bytes would be overwriten. This problem can be avoided simply by\nnot using i_addr[0] for inline data.\n\nSigned-off-by: Huajun Li <huajun.li@intel.com>\nSigned-off-by: Haicheng Li <haicheng.li@linux.intel.com>\nSigned-off-by: Weihong Xu <weihong.xu@intel.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: don't need to get f2fs_lock_op for the inline_data test\n\nThis patch locates checking the inline_data prior to calling f2fs_lock_op()\nin truncate_blocks(), since getting the lock is unnecessary.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: convert inline_data for punch_hole\n\nIn the punch_hole(), let's convert inline_data all the time for simplicity and\nto avoid potential deadlock conditions.\nIt is pretty much not a big deal to do this.\n\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: call f2fs_put_page at the error case\n\nIn f2fs_write_begin(), if f2fs_conver_inline_data() returns an error like\n-ENOSPC, f2fs should call f2fs_put_page().\nOtherwise, it is remained as a locked page, resulting in the following bug.\n\n[<ffffffff8114657e>] sleep_on_page+0xe/0x20\n[<ffffffff81146567>] __lock_page+0x67/0x70\n[<ffffffff81157d08>] truncate_inode_pages_range+0x368/0x5d0\n[<ffffffff81157ff5>] truncate_inode_pages+0x15/0x20\n[<ffffffff8115804b>] truncate_pagecache+0x4b/0x70\n[<ffffffff81158082>] truncate_setsize+0x12/0x20\n[<ffffffffa02a1842>] f2fs_setattr+0x72/0x270 [f2fs]\n[<ffffffff811cdae3>] notify_change+0x213/0x400\n[<ffffffff811ab376>] do_truncate+0x66/0xa0\n[<ffffffff811ab541>] vfs_truncate+0x191/0x1b0\n[<ffffffff811ab5bc>] do_sys_truncate+0x5c/0xa0\n[<ffffffff811ab78e>] SyS_truncate+0xe/0x10\n[<ffffffff81756052>] system_call_fastpath+0x16/0x1b\n[<ffffffffffffffff>] 0xffffffffffffffff\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: refactor f2fs_convert_inline_data\n\nChange log from v1:\n o handle NULL pointer of grab_cache_page_write_begin() pointed by Chao Yu.\n\nThis patch refactors f2fs_convert_inline_data to check a couple of conditions\ninternally for deciding whether it needs to convert inline_data or not.\n\nSo, the new f2fs_convert_inline_data initially checks:\n1) f2fs_has_inline_data(), and\n2) the data size to be changed.\n\nIf the inode has inline_data but the size to fill is less than MAX_INLINE_DATA,\nthen we don't need to convert the inline_data with data allocation.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add the number of inline_data files to status info\n\nThis patch adds the number of inline_data files into the status information.\nNote that the number is reset whenever the filesystem is newly mounted.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add inline_data recovery routine\n\nThis patch adds a inline_data recovery routine with the following policy.\n\n[prev.] [next] of inline_data flag\n   o       o  -> recover inline_data\n   o       x  -> remove inline_data, and then recover data blocks\n   x       o  -> remove inline_data, and then recover inline_data\n   x       x  -> recover data blocks\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: handle errors correctly during f2fs_reserve_block\n\nThe get_dnode_of_data nullifies inode and node page when error is occurred.\n\nThere are two cases that passes inode page into get_dnode_of_data().\n\n1. make_empty_dir()\n    -> get_new_data_page()\n      -> f2fs_reserve_block(ipage)\n\t-> get_dnode_of_data()\n\n2. f2fs_convert_inline_data()\n    -> __f2fs_convert_inline_data()\n      -> f2fs_reserve_block(ipage)\n\t-> get_dnode_of_data()\n\nThis patch adds correct error handling codes when get_dnode_of_data() returns\nan error.\n\nAt first, f2fs_reserve_block() calls f2fs_put_dnode() whenever reserve_new_block\nreturns an error.\nSo, the rule of f2fs_reserve_block() is to nullify inode page when there is any\nerror internally.\n\nFinally, two callers of f2fs_reserve_block() should call f2fs_put_dnode()\nappropriately if they got an error since successful f2fs_reserve_block().\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: fix truncate_partial_nodes bug\n\nThe truncate_partial_nodes puts pages incorrectly in the following two cases.\nNote that the value for argc 'depth' can only be 2 or 3.\nPlease see truncate_inode_blocks() and truncate_partial_nodes().\n\n1) An err is occurred in the first 'for' loop\n  When err is occurred with depth = 2, pages[0] is invalid, so this page doesn't\n  need to be put. There is no problem, however, when depth is 3, it doesn't put\n  the pages correctly where pages[0] is valid and pages[1] is invalid.\n  In this case, depth is set to 2 (ref to statemnt depth = i + 1), and then\n  'goto fail'.\n  In label 'fail', for (i = depth - 3; i >= 0; i--) cannot meet the condition\n  because i = -1, so pages[0] cann't be put.\n\n2) An err happened in the second 'for' loop\n  Now we've got pages[0] with depth = 2, or we've got pages[0] and pages[1]\n  with depth = 3. When an err is detected, we need 'goto fail' to put such\n  the pages.\n  When depth is 2, in label 'fail', for (i = depth - 3; i >= 0; i--) cann't\n  meet the condition because i = -1, so pages[0] cann't be put.\n  When depth is 3, in label 'fail', for (i = depth - 3; i >= 0; i--) can\n  only put pages[0], pages[1] also cann't be put.\n\nNote that 'depth' has been changed before first 'goto fail' (ref to statemnt\ndepth = i + 1), so passing this modified 'depth' to the tracepoint,\ntrace_f2fs_truncate_partial_nodes, is also incorrect.\n\nSigned-off-by: Shifei Ge <shifei10.ge@samsung.com>\n[Jaegeuk Kim: modify the description and fix one bug]\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: avoid to left uninitialized data in page when read inline data\n\nChange log from v1:\n o reduce unneeded memset in __f2fs_convert_inline_data\n\n>From 58796be2bd2becbe8d52305210fb2a64e7dd80b6 Mon Sep 17 00:00:00 2001\nFrom: Chao Yu <chao2.yu@samsung.com>\nDate: Mon, 30 Dec 2013 09:21:33 +0800\nSubject: [PATCH] f2fs: avoid to left uninitialized data in page when read\n inline data\n\nWe left uninitialized data in the tail of page when we read an inline data\npage. So let's initialize left part of the page excluding inline data region.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: avoid to read inline data except first page\n\nHere is a case which could read inline page data not from first page.\n\n1. write inline data\n2. lseek to offset 4096\n3. read 4096 bytes from offset 4096\n\t(read_inline_data read inline data page to non-first page,\n\tAnd previously VFS has add this page to page cache)\n4. ftruncate offset 8192\n5. read 4096 bytes from offset 4096\n\t(we meet this updated page with inline data in cache)\n\nSo we should leave this page with inited data and uptodate flag\nfor this case.\n\nChange log from v1:\n o fix a deadlock bug\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: improve write performance under frequent fsync calls\n\nWhen considering a bunch of data writes with very frequent fsync calls, we\nare able to think the following performance regression.\n\nN: Node IO, D: Data IO, IO scheduler: cfq\n\nIssue    pending IOs\n\t D1 D2 D3 D4\n D1         D2 D3 D4 N1\n D2            D3 D4 N1 N2\n N1            D3 D4 N2 D1\n --> N1 can be selected by cfq becase of the same priority of N and D.\n     Then D3 and D4 would be delayed, resuling in performance degradation.\n\nSo, when processing the fsync call, it'd better give higher priority to data IOs\nthan node IOs by assigning WRITE and WRITE_SYNC respectively.\nThis patch improves the random wirte performance with frequent fsync calls by up\nto 10%.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add a sysfs entry to control max_victim_search\n\nPreviously during SSR and GC, the maximum number of retrials to find a victim\nsegment was hard-coded by MAX_VICTIM_SEARCH, 4096 by default.\n\nThis number makes an effect on IO locality, when SSR mode is activated, which\nresults in performance fluctuation on some low-end devices.\n\nIf max_victim_search = 4, the victim will be searched like below.\n(\"D\" represents a dirty segment, and \"*\" indicates a selected victim segment.)\n\n D1 D2 D3 D4 D5 D6 D7 D8 D9\n[   *       ]\n      [   *    ]\n            [         * ]\n\t                [ ....]\n\nThis patch adds a sysfs entry to control the number dynamically through:\n  /sys/fs/f2fs/$dev/max_victim_search\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: remove the needless parameter of f2fs_wait_on_page_writeback\n\n\"boo sync\" parameter is never referenced in f2fs_wait_on_page_writeback.\nWe should remove this parameter.\n\nSigned-off-by: Yuan Zhong <yuan.mark.zhong@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: move grabing orphan pages out of protection region\n\nMove grabing orphan block page out of protection region, and grab all\nthe orphan block pages ahead.\n\nSigned-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\n[Jaegeuk Kim: remove unnecessary code pointed by Chao Yu]\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: move alloc new orphan node out of lock protection region\n\nMove alloc new orphan node out of lock protection region.\n\nSigned-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: use spinlock rather than mutex for better speed\n\nWith the 2 previous changes, all the long time operations are moved out\nof the protection region, so here we can use spinlock rather than mutex\n(orphan_inode_mutex) for lower overhead.\n\nSigned-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add delimiter to seperate name and value in debug phrase\n\nSupport for f2fs-tools/tools/f2stat to monitor\n/sys/kernel/debug/f2fs/status\n\nSigned-off-by: Changman Lee <cm224.lee@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: avoid f2fs_balance_fs call during pageout\n\nThis patch should resolve the following bug.\n\n=========================================================\n[ INFO: possible irq lock inversion dependency detected ]\n3.13.0-rc5.f2fs+ #6 Not tainted\n---------------------------------------------------------\nkswapd0/41 just changed the state of lock:\n (&sbi->gc_mutex){+.+.-.}, at: [<ffffffffa030503e>] f2fs_balance_fs+0xae/0xd0 [f2fs]\nbut this lock took another, RECLAIM_FS-READ-unsafe lock in the past:\n (&sbi->cp_rwsem){++++.?}\n\nand interrupts could create inverse lock ordering between them.\n\nother info that might help us debug this:\nChain exists of:\n  &sbi->gc_mutex --> &sbi->cp_mutex --> &sbi->cp_rwsem\n\n Possible interrupt unsafe locking scenario:\n\n       CPU0                    CPU1\n       ----                    ----\n  lock(&sbi->cp_rwsem);\n                               local_irq_disable();\n                               lock(&sbi->gc_mutex);\n                               lock(&sbi->cp_mutex);\n  <Interrupt>\n    lock(&sbi->gc_mutex);\n\n *** DEADLOCK ***\n\nThis bug is due to the f2fs_balance_fs call in f2fs_write_data_page.\nIf f2fs_write_data_page is triggered by wbc->for_reclaim via kswapd, it should\nnot call f2fs_balance_fs which tries to get a mutex grabbed by original syscall\nflow.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: missing REQ_META and REQ_PRIO when sync_meta_pages(META_FLUSH)\n\nDoing sync_meta_pages with META_FLUSH when checkpoint, we overide rw\nusing WRITE_FLUSH_FUA. At this time, we also should set\nREQ_META|REQ_PRIO.\n\nSigned-off-by: Changman Lee <cm224.lee@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: clean checkpatch warnings\n\nFixed a variety of trivial checkpatch warnings.  The only delta should\nbe some minor formatting on log strings that were split / too long.\n\nSigned-off-by: Chris Fries <cfries@motorola.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: call mark_inode_dirty to flush dirty pages\n\nIf a dentry page is updated, we should call mark_inode_dirty to add the inode\ninto the dirty list, so that its dentry pages are flushed to the disk.\nOtherwise, the inode can be evicted without flush.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: move a branch for code redability\n\nThis patch moves a function in f2fs_delete_entry for code readability.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: add help function META_MAPPING\n\nIntroduce help function META_MAPPING() to get the cache meta blocks'\naddress space.\n\nSigned-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: remove the orphan block page array\n\nAs the orphan_blocks may be max to 504, so it is not security\nand rigorous to store such a large array in the kernel stack\nas Dan Carpenter said.\nIn fact, grab_meta_page has locked the page in the page cache,\nand we can use find_get_page() to fetch the page safely in the\ndownstream, so we can remove the page array directly.\n\nReported-by: Dan Carpenter <dan.carpenter@oracle.com>\nSigned-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: introduce NODE_MAPPING for code consistency\n\nThis patch adds NODE_MAPPING which is similar as META_MAPPING introduced by\nGu Zheng.\n\nCc: Gu Zheng <guz.fnst@cn.fujitsu.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nf2fs: drop obsolete node page when it is truncated\n\nIf a node page is trucated, we'd better drop the page in the node_inode's page\ncache for better memory footprint.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>\n\nChange-Id: I1b7c3378b7f7adb13477376164e91ab080b50d8b","Changman Lee",true],["07c59c098d5469c309283af5b2e58ac09a4b9587","20424effba9d4aeeb410130c5f23aa328fa29e09@samsung.com","f2fs: update_inode_page should be done all the time\n\nIn order to make fs consistency, update_inode_page should not be failed all\nthe time. Otherwise, it is possible to lose some metadata in the inode like\na link count.\n\nChange-Id: Ifd3ed8f10ecfe5d42b994c8d8bad263f453d4afb\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Jaegeuk Kim",true],["87b879702c203871164794f6217a0065293d7915","20424effba9d4aeeb410130c5f23aa328fa29e09@samsung.com","f2fs: handle dirty segments inside refresh_sit_entry\n\nThis patch cleans up the refresh_sit_entry to handle locate_dirty_segments.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Jaegeuk Kim",true],["249f1552227e0e699cc6dc2671f16713f1458fa6","20424effba9d4aeeb410130c5f23aa328fa29e09@samsung.com","f2fs: fix to recover xattr node block\n\nIf a new xattr node page was allocated and its inode is fsynced, we should\nrecover the xattr node page during the roll-forward process after power-cut.\nBut, previously, f2fs didn't handle that case, resulting in kernel panic as\nfollows reported by Tom Li.\n\nBUG: unable to handle kernel paging request at ffffc9001c861a98\nIP: [<ffffffffa0295236>] check_index_in_prev_nodes+0x86/0x2d0 [f2fs]\nCall Trace:\n [<ffffffff815ece9b>] ? printk+0x48/0x4a\n [<ffffffffa029626a>] recover_fsync_data+0xdca/0xf50 [f2fs]\n [<ffffffffa02873ae>] f2fs_fill_super+0x92e/0x970 [f2fs]\n [<ffffffff8112c9f8>] mount_bdev+0x1b8/0x200\n [<ffffffffa0286a80>] ? f2fs_remount+0x130/0x130 [f2fs]\n [<ffffffffa0285e40>] f2fs_mount+0x10/0x20 [f2fs]\n [<ffffffff8112d4de>] mount_fs+0x3e/0x1b0\n [<ffffffff810ef4eb>] ? __alloc_percpu+0xb/0x10\n [<ffffffff8114761f>] vfs_kern_mount+0x6f/0x120\n [<ffffffff811497b9>] do_mount+0x259/0xa90\n [<ffffffff810ead1d>] ? memdup_user+0x3d/0x80\n [<ffffffff810eadb3>] ? strndup_user+0x53/0x70\n [<ffffffff8114a2c9>] SyS_mount+0x89/0xd0\n [<ffffffff815feae2>] system_call_fastpath+0x16/0x1b\n\nThis patch adds a recovery function of xattr node pages.\n\nReported-by: Tom Li <biergaizi@members.fsf.org>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Jaegeuk Kim",true],["5d7890aa6116f2395418e5b202403eedb50358b9","20424effba9d4aeeb410130c5f23aa328fa29e09@samsung.com","f2fs: remove the ugly pointer conversion\n\nThis patch modifies the use of bi_private to remove pointer chasing for sbi.\nPreviously, we had a bi_private structure, but it needs memory allocation.\nSo this patch uses bi_private by the sbi pointer and adds a completion pointer\ninto the sbi.\nThis can achieve no memory allocation and nice use of the bi_private.\n\nChange-Id: I1546c1e7f991f8eebe9323d6930a5919d18773cb\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Jaegeuk Kim",true],["04f1e07011d6f979d3d297c7da19ca8b30a7eb1c","20424effba9d4aeeb410130c5f23aa328fa29e09@samsung.com","f2fs: fix the potential mismatch between dir's i_size and i_blocks\n\nThis is the erroneous scenario.\n\n                             i_size    on-disk i_size    i_blocks\n__f2fs_add_link()             4096           4096           2\n get_new_data_page            8192           4096           3\n -ENOSPC = init_inode_metadata\n checkpoint                     -            4096           3\n POR and reboot\n\n__f2fs_add_link()             4096           4096           3\n page = get_new_data_page (page->index = 1 by NEW_ADDR)\n add a dentry to the page successfully\n\nf2fs_rmdir()\n f2fs_empty_dir()             4096           4096           3\n f2fs_unlink() goes, since there is no valid dentry due to i_size = 4096.\n But, still there is one dentry in page->index = 1.\n\nSo this patch moves the code to write dir->i_size into on-disk i_size in order\nto sync dir's i_size, on-disk i_size, and its i_blocks.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Jaegeuk Kim",true],["105ff0e886520a095966d517a2627cb24dc8bc12","20424effba9d4aeeb410130c5f23aa328fa29e09@samsung.com","f2fs: clean up with a macro\n\nThis patch adds GET_BLKOFF_FROM_SEG0 to clean up some codes.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Jaegeuk Kim",true],["5c9f8f18240e87138f41379e2faedfa2b969ed32","20424effba9d4aeeb410130c5f23aa328fa29e09@samsung.com","f2fs: fix a build warning\n\nThis patch modifies flow a little bit to avoid the following build warnings.\n\nsrc/fs/f2fs/recovery.c: In function ‘check_index_in_prev_nodes’:\nsrc/fs/f2fs/recovery.c:288:51: warning: ‘sum.<U5390>.<U52f8>.ofs_in_node’ may\n\tbe used uninitialized in this function [-Wmaybe-uninitialized]\nsrc/fs/f2fs/recovery.c:260:23: warning: ‘sum.nid’ may be used uninitialized\n\tin this function [-Wmaybe-uninitialized]\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Jaegeuk Kim",true],["2383e9b801be214d4f9a44772536ef94e3a6c899","20424effba9d4aeeb410130c5f23aa328fa29e09@samsung.com","f2fs: fix to truncate dentry pages in the error case\n\nWhen a new directory is allocated, if an error is occurred, we should truncate\npreallocated dentry pages too.\n\nThis bug was reported by Andrey Tsyvarev after a while as follows.\n\nmkdir()->\n f2fs_add_link()->\n  init_inode_metadata()->\n    f2fs_init_acl()->\n      f2fs_get_acl()->\n        f2fs_getxattr()->\n          read_all_xattrs() fails.\n\nAlso there was a BUG_ON triggered after the fault in\nmkdir()->\n f2fs_add_link()->\n   init_inode_metadata()->\n    remove_inode_page() ->\n      f2fs_bug_on(inode->i_blocks != 0 && inode->i_blocks != 1);\n\nBut, previous patch wasn't perfect to resolve that bug, so the following bug\nreport was also submitted.\n\nkernel BUG at fs/f2fs/inode.c:274!\nCall Trace:\n [<ffffffff811fde03>] evict+0xa3/0x1a0\n [<ffffffff811fe615>] iput+0xf5/0x180\n [<ffffffffa01c7f63>] f2fs_mkdir+0xf3/0x150 [f2fs]\n [<ffffffff811f2a77>] vfs_mkdir+0xb7/0x160\n [<ffffffff811f36bf>] SyS_mkdir+0x5f/0xc0\n [<ffffffff81680769>] system_call_fastpath+0x16/0x1b\n\nFinally, this patch resolves all the issues like below.\n\nIf an error is occurred after make_empty_dir(),\n 1. truncate_inode_pages()\n   The make_bad_inode() prior to iput() will change i_mode to S_IFREG, which\n   means that f2fs will not decrement fi->dirty_dents during f2fs_evict_inode.\n   But, by calling it here, we can do that.\n\n 2. truncate_blocks()\n   Preallocated dentry pages are trucated here to sync i_blocks.\n\n 3. remove_dirty_dir_inode()\n   Remove this directory inode from the list.\n\nReported-and-Tested-by: Andrey Tsyvarev <tsyvarev@ispras.ru>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Jaegeuk Kim",true],["39989f01f1748c67f570cd8bc3f583821d28d83d","20424effba9d4aeeb410130c5f23aa328fa29e09@samsung.com","f2fs: fix f2fs_write_meta_page at no checkpoint status\n\nIf f2fs entered errorneous checkpoint status, it should skip writing meta\npages instead of redirtying the pages out.\nOtherwise, it cannot unmount the partition even though f2fs is under read-only\nstatus.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Jaegeuk Kim",true],["234ff891c66e2d2221fcf14d984ace3c1a3185fb","20424effba9d4aeeb410130c5f23aa328fa29e09@samsung.com","f2fs: clean up redundant function call\n\nThis patch integrates inode_[inc|dec]_dirty_dents with inc_page_count to remove\nredundant calls.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Jaegeuk Kim",true],["a2dc2045545317cf108d96d34bbb1873cab7c0a8","0cc5db7488e13b393f245aa6263acec5e92fdcc5@samsung.com","f2fs: use inode mutex to keep atomicity of f2fs_falloc\n\nPreviously without protection of inode mutex, f2fs_falloc and other data\ncorrelated operations will interfere with each other.\nSo let's use inode mutex to keep atomicity of f2fs_falloc.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Chao Yu",true],["2dbb255c45562fd6a4f4125bd8815909b5cb86a1","0cc5db7488e13b393f245aa6263acec5e92fdcc5@samsung.com","f2fs: introduce ra_meta_pages to readahead CP/NAT/SIT pages\n\nThis patch help us to cleanup the readahead code by merging ra_{sit,nat}_pages\nfunction into ra_meta_pages.\nAdditionally the new function is used to readahead cp block in\nrecover_orphan_inodes.\n\nChange log from v1:\n o fix a deadloop bug pointed by Jaegeuk Kim.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Chao Yu",true],["40e636c64a608592863349b39e3276f57ac832b0","f10da886ecf5f6d400f766170992d382feccd416@samsung.com","f2fs: show counts of checkpoint in status\n\nThis patch shows the counts of checkpoint in f2fs' status.\n\nSigned-off-by: Changman Lee <cm224.lee@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Changman Lee",true],["84e3b335967b057dd0f1955c4c662fee5cb138cd","20424effba9d4aeeb410130c5f23aa328fa29e09@samsung.com","f2fs: fix the calculation of max_nids\n\nTotal nids that f2fs can use should not include 0, nid for node inode, and nid\nfor meta inode.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Jaegeuk Kim",true],["268a7532df20f3cb643add591f127699d797c775","20424effba9d4aeeb410130c5f23aa328fa29e09@samsung.com","f2fs: fix not to write data pages on the page reclaiming path\n\nEven if f2fs_write_data_page is called by the page reclaiming path, we should\nnot write the page to provide enough free segments for the worst case scenario.\nOtherwise, f2fs can face with no free segment while gc is conducted, resulting\nin:\n\n ------------[ cut here ]------------\n kernel BUG at /home/zeus/f2fs_test/src/fs/f2fs/segment.c:565!\n RIP: 0010:[<ffffffffa02c3b11>]  [<ffffffffa02c3b11>] new_curseg+0x331/0x340 [f2fs]\n Call Trace:\n  allocate_segment_by_default+0x204/0x280 [f2fs]\n  allocate_data_block+0x108/0x210 [f2fs]\n  write_data_page+0x8a/0xc0 [f2fs]\n  do_write_data_page+0xe1/0x2a0 [f2fs]\n  move_data_page+0x8a/0xf0 [f2fs]\n  f2fs_gc+0x446/0x970 [f2fs]\n  f2fs_balance_fs+0xb6/0xd0 [f2fs]\n  f2fs_write_begin+0x50/0x350 [f2fs]\n  ? unlock_page+0x27/0x30\n  ? unlock_page+0x27/0x30\n  generic_file_buffered_write+0x10a/0x280\n  ? file_update_time+0xa3/0xf0\n  __generic_file_aio_write+0x1c8/0x3d0\n  ? generic_file_aio_write+0x52/0xb0\n  ? generic_file_aio_write+0x52/0xb0\n  generic_file_aio_write+0x65/0xb0\n  do_sync_write+0x5a/0x90\n  vfs_write+0xc5/0x1f0\n  SyS_write+0x55/0xa0\n  system_call_fastpath+0x16/0x1b\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Jaegeuk Kim",true],["b7587b1f5fd3a5f3b2fd75a3bdaadb6a0ec833e1","20424effba9d4aeeb410130c5f23aa328fa29e09@samsung.com","f2fs: fix to do build_stat prior to the recovery procedure\n\nAt the end of the recovery procedure, write_checkpoint is called and updates\nthe cp count which is managed by f2fs stat.\nBut, previously build_stat() is called after the recovery procedure, which\nresults in:\n\nBUG: unable to handle kernel NULL pointer dereference at 000000000000012c\nIP: [<ffffffffa03b1030>] write_checkpoint+0x720/0xbc0 [f2fs]\nCall Trace:\n [<ffffffff810a6b44>] ? mark_held_locks+0x74/0x140\n [<ffffffff8109a3e0>] ? __init_waitqueue_head+0x60/0x60\n [<ffffffffa03bf036>] recover_fsync_data+0x656/0xf20 [f2fs]\n [<ffffffff812ee3eb>] ? security_d_instantiate+0x1b/0x30\n [<ffffffffa03aeb4d>] f2fs_fill_super+0x94d/0xa00 [f2fs]\n [<ffffffff811a9825>] mount_bdev+0x1a5/0x1f0\n [<ffffffff8114915e>] ? __get_free_pages+0xe/0x40\n [<ffffffffa03ae200>] ? f2fs_remount+0x130/0x130 [f2fs]\n [<ffffffffa03aa575>] f2fs_mount+0x15/0x20 [f2fs]\n [<ffffffff811aa713>] mount_fs+0x43/0x1b0\n [<ffffffff811c7124>] vfs_kern_mount+0x74/0x160\n [<ffffffff811c5cb1>] ? __get_fs_type+0x51/0x60\n [<ffffffff811c9727>] do_mount+0x237/0xb50\n [<ffffffff811c936a>] ? copy_mount_options+0x3a/0x170\n\nSo, this patche changes the order of recovery_fsync_data() and\nf2fs_build_stats().\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Jaegeuk Kim",true],["b63a21d9d361e0bf9566979e69a352c79251a603","20424effba9d4aeeb410130c5f23aa328fa29e09@samsung.com","f2fs: fix to mark the checkpointed nat entry correctly\n\nThe nat cache entry maintains a status whether it is checkpointed or not.\nSo, if a new cache entry is loaded from the last checkpoint,\nnat_entry->checkpointed should be true.\nIf the cache entry is modified as being dirty, nat_entry->checkpoint should\nbe false.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>","Jaegeuk Kim",true]],"size":158,"ref":"refs/heads/cm-11.0","head":"9e80d9c5811aae100dba2604c502345a75afcf9e"}