{"push_id":1672890571,"size":1,"distinct_size":1,"ref":"refs/heads/stock","head":"01f7179f48c19c7d3e9823cd03f403b6decf78a8","before":"9acc83afae0a88b87465a127443dd08d70897eb2","commits":[{"sha":"01f7179f48c19c7d3e9823cd03f403b6decf78a8","author":{"name":"Jaegeuk Kim","email":"c9e6543abf9bc130570115f8ac41a9d9b583b810@kernel.org"},"message":"f2fs: catch up to v4.4-rc1 with all the updates and fixes\n\nThe last patch is:\n\ncommit beaa57dd986d4f398728c060692fc2452895cfd8\nAuthor: Chao Yu <chao2.yu@samsung.com>\nDate:   Thu Oct 22 18:24:12 2015 +0800\n\n    f2fs: fix to skip shrinking extent nodes\n\n    In f2fs_shrink_extent_tree we should stop shrink flow if we have already\n    shrunk enough nodes in extent cache.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: Fix a system panic caused by f2fs_follow_link\n\nIn linux 3.10, we can not make sure the return value of nd_get_link function\nis valid. So this patch add a check before use it.\n\nSigned-off-by: Yunlei He <heyunlei@huawei.com>\nSigned-off-by: Shuoran Liu <liushuoran@huawei.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: report error of f2fs_create_root_stats\n\nf2fs_create_root_stats can fail due to no memory, report it to user.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: commit atomic written page in LFS mode\n\nWe should always commit atomic written pages in LFS mode, otherwise data\nwill become corrupted if we encounter suddent power cut after partial\npages committed in IPU mode.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: support file defragment\n\nThis patch introduces a new ioctl F2FS_IOC_DEFRAGMENT to support file\ndefragment in a specified range of regular file.\n\nThis ioctl can be used in very limited workload: if user expects high\nsequential read performance in randomly written file, this interface\ncan be used for defragmentation, after that file can be written as\ncontinuous as possible in the device.\n\nMeanwhile, it has side-effect, it will make holes in segments where\nblocks located originally, so it's better to trigger GC to eliminate\nfragment in segments.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix memory leak of kobject in error path of fill_super\n\nf2fs_sb_info::s_kobj should be released in error path of fill_super,\notherwise it will lead to memory leak.\n\nThis bug was found by kmemleak:\n\ndmesg:\nkmemleak: 2 new suspected memory leaks (see /sys/kernel/debug/kmemleak)\n\ncat /sys/kernel/debug/kmemleak\nunreferenced object 0xffff8800838dc358 (size 8):\n  comm \"mount\", pid 4154, jiffies 4297482839 (age 1911.412s)\n  hex dump (first 8 bytes):\n    7a 72 61 6d 31 00 ff ff                          zram1...\n  backtrace:\n    [<ffffffff817a3668>] kmemleak_alloc+0x28/0x50\n    [<ffffffff811dc99f>] __kmalloc_track_caller+0xef/0x1c0\n    [<ffffffff8119d1c5>] kstrdup+0x45/0x80\n    [<ffffffff8119d228>] kstrdup_const+0x28/0x30\n    [<ffffffff813d2333>] kvasprintf_const+0x63/0xa0\n    [<ffffffff813c59fc>] kobject_set_name_vargs+0x3c/0xa0\n    [<ffffffff813c5a85>] kobject_add_varg+0x25/0x60\n    [<ffffffff813c5b13>] kobject_init_and_add+0x53/0x70\n    [<ffffffffa07ced19>] f2fs_fill_super+0x9d9/0xc40 [f2fs]\n    [<ffffffff811ff0b2>] mount_bdev+0x192/0x1d0\n    [<ffffffffa07cd3e5>] f2fs_mount+0x15/0x20 [f2fs]\n    [<ffffffff811fec93>] mount_fs+0x43/0x170\n    [<ffffffff81220256>] vfs_kern_mount+0x76/0x160\n    [<ffffffff812211c8>] do_mount+0x258/0xdc0\n    [<ffffffff81221dab>] SyS_mount+0x7b/0xc0\n    [<ffffffff817aecd7>] entry_SYSCALL_64_fastpath+0x12/0x6f\n...\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix to enable missing ioctl interfaces in ->compat_ioctl\n\nIn 64-bit kernel f2fs can supports 32-bit ioctl system call by identifying\nencoded code which is converted from 32-bit one to 64-bit one in\n->compat_ioctl.\n\nWhen we introduced new interfaces in ->ioctl, we forgot to enable them in\n->compat_ioctl, so enable them for fixing.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\n[Jaegeuk Kim: fix wrongly added spaces together]\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix to remove directory inode from dirty list\n\nIf last dirty dentry page was writebacked in reclaim path, we should\nremove its directory inode from global dirty list to avoid unnecessary\nflush for this inode when doing checkpoint.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: optimize __find_rev_next_bit\n\n1. Skip __reverse_ulong if the bitmap is empty.\n2. Reduce branches and codes.\nAccording to my test, the performance of this new version is 5% higher on\nan empty bitmap of 64bytes, and remains about the same in the worst scenario.\n\nSigned-off-by: Fan li <fanofcode.li@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: clear page uptodate when dropping cache for atomic write\n\nWe should clear uptodate flag for all pages atomic written when we drop\nthem, otherwise before these cached pages were reclaimed or invalidated\neventually, we will see invalid data when hitting them again.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix to report error in f2fs_readdir\n\nget_lock_data_page in f2fs_readdir can fail due to a lot of reasons (i.e.\nno memory or IO error...), it's better to report this kind of error to\nuser rather than ignoring it.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: avoid deadlock in f2fs_shrink_extent_tree\n\nWhile handling extent trees, we can enter into a reclaiming path anytime.\nIf it tries to release some extent nodes in the same extent tree,\nwrite_lock(&et->lock) would be hanged.\nIn order to avoid the deadlock, we can just skip it.\n\nNote that, if it is an unreferenced tree, we should get write_lock(&et->lock)\nsuccessfully and release all of therein nodes.\n\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: do not recover from previous remained wrong dnodes\n\nIf device does not support discard, some obsolete dnodes can be recovered\nby roll-forward. This patch enhances the recovery flow.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: clean up error path in f2fs_readdir\n\nNo logic changes, just clean up the error path.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tfs/f2fs/dir.c\n\nf2fs: clean up code with __has_cursum_space\n\nClean up codes in lookup_journal_in_cursum() with __has_cursum_space().\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: clean up argument of recover_data\n\nIn recover_data, value of argument 'type' will be CURSEG_WARM_NODE all\nthe time, remove it for cleanup.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: kill f2fs_drop_largest_extent\n\nFor direct IO, f2fs only allocate new address for the block which is not\nexist in the disk before, its mapping info should not exist in extent\ncache previously, so here we do not need to call f2fs_drop_largest_extent\nto drop related cache.\n\nDue to no more callers for f2fs_drop_largest_extent now, kill it.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: use sbi->blocks_per_seg to avoid unnecessary calculation\n\nUse sbi->blocks_per_seg directly to avoid unnecessary calculation when using\n1 << sbi->log_blocks_per_seg.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix to convert inline inode in ->setattr\n\nIn commit 3c4541452748 (\"f2fs: do not trim preallocated blocks when\ntruncating after i_size\"), in order to follow the regulation: \"truncate(x)\nwhere x > i_size will not trim all blocks past i_size.\" like other file\nsystems, in ->setattr we invoked truncate_setsize instead of f2fs_truncate\nto avoid unneeded block trimming in such case, but forgot to call\nf2fs_convert_inline_inode keep consistency of inline data conversion rule.\n\nThis patch fixes to convert inline data if necessary.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: enhance the bit operation for SSR\n\nThis patch enhances the existing bit operation when f2fs allocates SSR\nblocks.\n\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: refactor f2fs_commit_super\n\nPreviously, f2fs_commit_super hacks the bh->blocknr to write the broken\nalternate superblock.\nInstead of it, we should use the correct logic to retrieve its buffer head\nwith locking it appropriately.\n\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: use lock_buffer when changing superblock\n\nWhen modifying sb contents, we need to use lock its buffer.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: clean up node page updating flow\n\nIf read_node_page return LOCKED_PAGE, in its caller it's better a) skip\nunneeded 'Update' flag and mapping info verfication; b) check nid value\nstored in footer structure of node page.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tfs/f2fs/node.c\n\nf2fs: write only the pages in range during defragment\n\n@lend of filemap_write_and_wait_range is supposed to be a \"offset\nin bytes where the range ends (inclusive)\". Subtract 1 to avoid\nwriting an extra page.\n\nSigned-off-by: Fan li <fanofcode.li@samsung.com>\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix to update variable correctly when skip a unmapped block\n\nmap.m_len should be reduced after skip a block\n\nSigned-off-by: Fan li <fanofcode.li@samsung.com>\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: do more integrity verification for superblock\n\nDo more sanity check for superblock during ->mount.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: add symbol to avoid any confusion with tools\n\nThis patch adds MAX_VOLUME_NAME to sync with f2fs-tools.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: rename {add,remove,release}_dirty_inode to {add,remove,release}_ino_entry\n\nremove_dirty_dir_inode will be renamed to remove_dirty_inode as a generic\nfunction in following patch for removing directory/regular/symlink inode\nin global dirty list.\n\nHere rename ino management related functions for readability, also in\norder to avoid name conflict.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: introduce dirty list node in inode info\n\nAdd a new dirt list node member in inode info for linking the inode to\nglobal dirty list in superblock, instead of old implementation which\nallocate slab cache memory as an entry to inode.\n\nIt avoids memory pressure due to slab cache allocation, and also makes\ncodes more clean.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: introduce __remove_dirty_inode\n\nIntroduce __remove_dirty_inode to clean up codes in remove_dirty_dir_inode.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix to reset variable correctlly\n\nf2fs_map_blocks will set m_flags and m_len to 0, so we don't need to\nreset m_flags ourselves, but have to reset m_len to correct value\nbefore use it again.\n\nSigned-off-by: Fan li <fanofcode.li@samsung.com>\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: backup raw_super in sbi\n\nf2fs use fields of f2fs_super_block struct directly in a grabbed buffer.\n\nOnce the buffer happen to be destroyed (e.g. through dd), it may bring\nin unpredictable effect on f2fs.\n\nThis patch fixes to allocate additional buffer to store datas of super\nblock rather than using grabbed block buffer directly.\n\nSigned-off-by: Yunlei He <heyunlei@huawei.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: don't grab super block buffer header all the time\n\nWe have already got one copy of valid super block in memory, do not grab\nbuffer header of super block all the time.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: relocate tracepoint of write_checkpoint\n\nIt needs to relocate its location to see exact trace logs.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: introduce __f2fs_commit_super\n\nIntroduce __f2fs_commit_super to include duplicated codes in\nf2fs_commit_super for cleanup.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: record dirty status of regular/symlink inode\n\nMaintain regular/symlink inode which has dirty pages in global dirty list\nand record their total dirty pages count like the way of handling directory\ninode.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: introduce new option for controlling data flush\n\nAdd a new option 'data_flush' to enable data flush functionality.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tDocumentation/filesystems/f2fs.txt\n\nf2fs: stat dirty regular/symlink inodes\n\nAdd to stat dirty regular and symlink inode for showing in debugfs.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: support data flush in background\n\nPreviously, when finishing a checkpoint, we have persisted all fs meta\ninfo including meta inode, node inode, dentry page of directory inode, so,\nafter a sudden power cut, f2fs can recover from last checkpoint with full\ndirectory structure.\n\nBut during checkpoint, we didn't flush dirty pages of regular and symlink\ninode, so such dirty datas still in memory will be lost in that moment of\npower off.\n\nIn order to reduce the chance of lost data, this patch enables\nf2fs_balance_fs_bg with the ability of data flushing. It will try to flush\nuser data before starting a checkpoint. So user's data written after last\ncheckpoint which may not be fsynced could be saved.\n\nWhen we mount with data_flush option, after every period of cp_interval\n(could be configured in sysfs: /sys/fs/f2fs/device/cp_interval) seconds\nuser data could be flushed into device once f2fs_balance_fs_bg was called\nin kworker thread or gc thread.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: optimize the flow of f2fs_map_blocks\n\ncheck map->m_len right after it changes to avoid excess call\nto update dnode_of_data.\n\nSigned-off-by: Fan li <fanofcode.li@samsung.com>\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: add a tracepoint for sync_dirty_inodes\n\nThis patch adds a tracepoint for sync_dirty_inodes.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: use atomic variable for total_extent_tree\n\nIt would be better to use atomic variable for total_extent_tree.\n\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: speed up shrinking extent tree entries\n\nIf there is no candidates for shrinking slab entries, we don't need to traverse\nany trees at all.\n\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\n[Jaegeuk Kim: fix missing initialization reported by Yunlei He]\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: check inline_data flag at converting time\n\nWe can check inode's inline_data flag  when calling to convert it.\n\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: avoid unnecessary f2fs_gc for dir operations\n\nThe f2fs_balance_fs doesn't need to cover f2fs_new_inode or f2fs_find_entry\nworks.\n\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tfs/f2fs/namei.c\n\nf2fs: record node block allocation in dnode_of_data\n\nThis patch introduces recording node block allocation in dnode_of_data.\nThis information helps to figure out whether any node block is allocated during\nspecific file operations.\n\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: reduce covered region of sbi->cp_rwsem in f2fs_map_blocks\n\nOnly cover sbi->cp_rwsem on one dnode page's allocation and modification\ninstead of multiple's in f2fs_map_blocks, it can reduce the covered region\nof cp_rwsem, then we can avoid potential long time delay for concurrent\ncheckpointer.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: call f2fs_balance_fs only when node was changed\n\nIf user tries to update or read data, we don't need to call f2fs_balance_fs\nwhich triggers f2fs_gc, which increases unnecessary long latency.\n\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: report error of do_checkpoint\n\ndo_checkpoint and write_checkpoint can fail due to reasons like triggering\nin a readonly fs or encountering IO error of storage device.\n\nSo it's better to report such error info to user, let user be aware of\nfailure of doing checkpoint.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: don't convert inline inode when inline_data option is disable\n\nIf inline_data option is disable, when truncating an inline inode with\nsize which is not exceed maxinum inline size, we should not convert\ninline inode to regular one to avoid the overhead of synchronizing\nconversion.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: introduce prepare_write_begin to clean up\n\nThis patch adds prepare_write_begin to clean f2fs_write_begin.\nThe major role of this function is to convert any inline_data and allocate\nor find block address.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: return early when trying to read null nid\n\nIf get_node_page() gets zero nid, we can return early without getting a wrong\npage. For example, get_dnode_of_data() can try to do that.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: avoid f2fs_lock_op in f2fs_write_begin\n\nIf f2fs_write_begin is to update data, we can bypass calling f2fs_lock_op() in\norder to avoid the checkpoint latency in the write syscall.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: declare static function\n\nThe __f2fs_commit_super is static.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: add missing f2fs_balance_fs in __recover_dot_dentries\n\n__recover_do_dentries will try to grab free space in storage, so fix to\nadd missing f2fs_balance_fs here.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: let user being aware of IO error\n\nSometimes we keep dumb when IO error occur in lower layer device, so user\nwill not receive any error return value for some operation, but actually,\nthe operation did not succeed.\n\nThis sould be avoided, so this patch reports such kind of error to user.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tfs/f2fs/data.c\n\nf2fs: fix bugs and simplify codes of f2fs_fiemap\n\nfix bugs:\n1. len could be updated incorrectly when start+len is beyond isize.\n2. If there is a hole consisting of more than two blocks, it could\n   fail to add FIEMAP_EXTENT_LAST flag for the last extent.\n3. If there is an extent beyond isize, when we search extents in a range\n   that ends at isize, it will also return the extent beyond isize,\n   which is outside the range.\n\nSigned-off-by: Fan li <fanofcode.li@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: add a max block check for get_data_block_bmap\n\nThis patch adds a max block check for get_data_block_bmap.\n\nTrinity test program will send a block number as parameter into\nioctl_fibmap, which will be used in get_node_path(), when the block\nnumber large than f2fs max blocks, it will trigger kernel bug.\n\nSigned-off-by: Yunlei He <heyunlei@huawei.com>\nSigned-off-by: Xue Liu <liuxueliu.liu@huawei.com>\n[Jaegeuk Kim: fix missing condition, pointed by Chao Yu]\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: clean up f2fs_ioc_write_checkpoint\n\nUse f2fs_sync_fs to clean up codes in f2fs_ioc_write_checkpoint.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\n[Jaegeuk Kim: remove unused err variable]\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: early check broken symlink length in the encrypted case\n\nIf link is broken, its len is zero, and we don't need to move forward.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: use i_size_read to get i_size\n\nWe need to use i_size_read() to get inode->i_size.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tfs/f2fs/data.c\n\nf2fs: load largest extent all the time\n\nOtherwise, we can get mismatched largest extent information.\n\nOne example is:\n1. mount f2fs w/ extent_cache\n2. make a small extent\n3. umount\n4. mount f2fs w/o extent_cache\n5. update the largest extent\n6. umount\n7. mount f2fs w/ extent_cache\n8. get the old extent made by #2\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix to skip recovering dot dentries in a readonly fs\n\nIf filesystem is readonly, leave user message info instead of recovering\ninline dot inode.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix f2fs_ioc_abort_volatile_write\n\nThere are two rules to handle aborting volatile or atomic writes.\n\n1. drop atomic writes\n - we don't need to keep any stale db data.\n\n2. write journal data\n - we should keep the journal data with fsync for db recovery.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: remove f2fs_bug_on in terms of max_depth\n\nThere is no report on this bug_on case, but if malicious attacker changed this\nfield intentionally, we can just reset it as a MAX value.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: write pending bios when cp_error is set\n\nWhen testing ioc_shutdown, put_super is able to be hanged by waiting for\nwritebacking pages as follows.\n\nINFO: task umount:2723 blocked for more than 120 seconds.\n      Tainted: G           O    4.4.0-rc3+ #8\n\"echo 0 > /proc/sys/kernel/hung_task_timeout_secs\" disables this message.\numount          D ffff88000859f9d8     0  2723   2110 0x00000000\n ffff88000859f9d8 0000000000000000 0000000000000000 ffffffff81e11540\n ffff880078c225c0 ffff8800085a0000 ffff88007fc17440 7fffffffffffffff\n ffffffff818239f0 ffff88000859fb48 ffff88000859f9f0 ffffffff8182310c\nCall Trace:\n [<ffffffff818239f0>] ? bit_wait+0x50/0x50\n [<ffffffff8182310c>] schedule+0x3c/0x90\n [<ffffffff81827fb9>] schedule_timeout+0x2d9/0x430\n [<ffffffff810e0f8f>] ? mark_held_locks+0x6f/0xa0\n [<ffffffff8111614d>] ? ktime_get+0x7d/0x140\n [<ffffffff818239f0>] ? bit_wait+0x50/0x50\n [<ffffffff8106a655>] ? kvm_clock_get_cycles+0x25/0x30\n [<ffffffff8111617c>] ? ktime_get+0xac/0x140\n [<ffffffff818239f0>] ? bit_wait+0x50/0x50\n [<ffffffff81822564>] io_schedule_timeout+0xa4/0x110\n [<ffffffff81823a25>] bit_wait_io+0x35/0x50\n [<ffffffff818235bd>] __wait_on_bit+0x5d/0x90\n [<ffffffff811b9e8b>] wait_on_page_bit+0xcb/0xf0\n [<ffffffff810d5f90>] ? autoremove_wake_function+0x40/0x40\n [<ffffffff811cf84c>] truncate_inode_pages_range+0x4bc/0x840\n [<ffffffff811cfc3d>] truncate_inode_pages_final+0x4d/0x60\n [<ffffffffc023ced5>] f2fs_evict_inode+0x75/0x400 [f2fs]\n [<ffffffff812639bc>] evict+0xbc/0x190\n [<ffffffff81263d19>] iput+0x229/0x2c0\n [<ffffffffc0241885>] f2fs_put_super+0x105/0x1a0 [f2fs]\n [<ffffffff8124756a>] generic_shutdown_super+0x6a/0xf0\n [<ffffffff812478f7>] kill_block_super+0x27/0x70\n [<ffffffffc0241290>] kill_f2fs_super+0x20/0x30 [f2fs]\n [<ffffffff81247b03>] deactivate_locked_super+0x43/0x70\n [<ffffffff81247f4c>] deactivate_super+0x5c/0x60\n [<ffffffff81268d2f>] cleanup_mnt+0x3f/0x90\n [<ffffffff81268dc2>] __cleanup_mnt+0x12/0x20\n [<ffffffff810ac463>] task_work_run+0x73/0xa0\n [<ffffffff810032ac>] exit_to_usermode_loop+0xcc/0xd0\n [<ffffffff81003e7c>] syscall_return_slowpath+0xcc/0xe0\n [<ffffffff81829ea2>] int_ret_from_sys_call+0x25/0x9f\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: use IPU for fdatasync\n\nThis patch fixes missing IPU condition when fdatasync is called.\nWith this patch, fdatasync is able to avoid additional node writes for recovery.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: monitor zombie_tree count\n\nThis patch adds an entry to show the number of zombie extent_tree.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: introduce zombie list for fast shrinking extent trees\n\nThis patch removes refcount, and instead, adds zombie_list to shrink directly\nwithout radix tree traverse.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs crypto: check CONFIG_F2FS_FS_XATTR for encrypted symlink\n\nAdd missed CONFIG_F2FS_FS_XATTR for encrypted symlink inode in order\nto avoid unneeded registry of ->{get,set,remove}xattr.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: introduce max_file_blocks in sbi\n\nIntroduce max_file_blocks in sbi to store max block index of file in f2fs,\nit could be used to avoid unneeded calculation of max block index in\nruntime.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\n[Jaegeuk Kim: fix overflow of sbi->max_file_blocks]\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: cover more area with nat_tree_lock\n\nThere was a subtle bug on nat cache management which incurs wrong nid allocation\nor wrong block addresses when try_to_free_nats is triggered heavily.\nThis patch enlarges the previous coverage of nat_tree_lock to avoid data race.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nRevert \"f2fs: check the node block address of newly allocated nid\"\n\nOriginal issue is fixed by:\n\n  f2fs: cover more area with nat_tree_lock\n\nThis reverts commit 24928634f81b1592e83b37dcd89ed45c28f12feb.\n\nf2fs: read isize while holding i_mutex in fiemap\n\nmake sure the isize we read doesn't change during the process.\n\nSigned-off-by: Fan li <fanofcode.li@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: check node id earily when readaheading node page\n\nAdd node id check in ra_node_page and get_node_page_ra like get_node_page.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: introduce __get_node_page to reuse common code\n\nThere are duplicated code in between get_node_page and get_node_page_ra,\nintroduce __get_node_page to includes common parts of these two, and\nexport get_node_page and get_node_page_ra by reusing __get_node_page.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tfs/f2fs/node.c\n\nf2fs: check the page status filled from disk\n\nAfter reading a page, we need to check whether there is any error.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: avoid unnecessary f2fs_balance_fs calls\n\nOnly when node page is newly dirtied, it needs to check whether we need to do\nf2fs_gc.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: remove redundant calls\n\nThis patch removes redundant calls.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: clean up f2fs_balance_fs\n\nThis patch adds one parameter to clean up all the callers of f2fs_balance_fs.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tfs/f2fs/namei.c\n\nf2fs: recognize encrypted data in f2fs_fiemap\n\nThis patch fixes to teach f2fs_fiemap to recognize encrypted data.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: use atomic type for node count in extent tree\n\n1. rename field in struct extent_tree from count to node_cnt for\n   readability.\n2. alter to use atomic type for node_cnt.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: skip releasing nodes in chindless extent tree\n\nIf there are no nodes in extent tree, let's skip releasing step to avoid\nany overhead of grabbing/releasing extent tree lock.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: introduce time and interval facility\n\nThis patch adds time and interval arrays to store some timing variables.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: detect idle time depending on user behavior\n\nThis patch adds last time that user requested filesystem operations.\nThis information is used to detect whether system is idle or not later.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tDocumentation/ABI/testing/sysfs-fs-f2fs\n\nf2fs: monitor the number of background checkpoint\n\nThis patch adds to show the number of background checkpoint.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix wrong memory condition check\n\nThis patch fixes wrong decision for avaliable_free_memory.\nThe return valus is already set as false, so we should consider true condition\nbelow only.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tfs/f2fs/node.c\n\nf2fs: should unset atomic flag after successful commit\n\nIf there is an error during commit, we should keep the flag in order to\nabort it.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: relocate is_merged_page\n\nOperations in is_merged_page is related to inner bio cache, move it to\ndata.c.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: flush dirty nat entries when exceeding threshold\n\nWhen testing f2fs with xfstest, generic/251 is stuck for long time,\nthe case uses below serials to obtain fresh released space in device,\nin order to prepare for following fstrim test.\n\n1. rm -rf /mnt/dir\n2. mkdir /mnt/dir/\n3. cp -axT `pwd`/ /mnt/dir/\n4. goto 1\n\nDuring preparing step, all nat entries will be cached in nat cache,\nmost of them are dirty entries with invalid blkaddr, which means\nnodes related to these entries have been truncated, and they could\nbe reused after the dirty entries been checkpointed.\n\nHowever, there was no checkpoint been triggered, so nid allocators\n(e.g. mkdir, creat) will run into long journey of iterating all NAT\npages, looking for free nids in alloc_nid->build_free_nids.\n\nHere, in f2fs_balance_fs_bg we give another chance to do checkpoint\nto flush nat entries for reusing them in free nid cache when dirty\nentry count exceeds 10% of max count.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: export dirty_nats_ratio in sysfs\n\nThis patch exports a new sysfs entry 'dirty_nat_ratio' to control threshold\nof dirty nat entries, if current ratio exceeds configured threshold,\ncheckpoint will be triggered in f2fs_balance_fs_bg for flushing dirty nats.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tDocumentation/ABI/testing/sysfs-fs-f2fs\n\nf2fs: correct search area in get_new_segment\n\nget_new_segment starts from current segment position, tries to search a\nfree segment among its right neighbors locate in same section.\n\nBut previously our search area was set as [current segment, max segment],\nwhich means we have to search to more bits in free_segmap bitmap for some\nworse cases. So here we correct the search area to [current segment, last\nsegment in section] to avoid unnecessary searching.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: remove needless condition check\n\nThis patch removes needless condition variable.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: use writepages->lock for WB_SYNC_ALL\n\nIf there are many writepages calls by multiple threads in background, we don't\nneed to serialize to merge all the bios, since it's background.\nIn such the case, it'd better to run writepages concurrently.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix to overcome inline_data floods\n\nThe scenario is:\n1. create lots of node blocks\n2. sync\n3. write lots of inline_data\n-> got panic due to no free space\n\nIn that case, we should flush node blocks when writing inline_data in #3,\nand trigger gc as well.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: do f2fs_balance_fs when block is allocated\n\nWe should consider data block allocation to trigger f2fs_balance_fs.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: avoid multiple node page writes due to inline_data\n\nThe sceanrio is:\n1. create fully node blocks\n2. flush node blocks\n3. write inline_data for all the node blocks again\n4. flush node blocks redundantly\n\nSo, this patch tries to flush inline_data when flushing node blocks.\n\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: don't need to sync node page at every time\n\nIn write_end, we don't need to sync inode page at every time.\nInstead, we can expect f2fs_write_inode will update later.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: avoid needless sync_inode_page when reading inline_data\n\nIn write_begin, if there is an inline_data, f2fs loads it into 0'th data page.\nSince it's the read path, we don't need to sync its inode page.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: don't need to call set_page_dirty for io error\n\nIf end_io gets an error, we don't need to set the page as dirty, since we\nalready set f2fs_stop_checkpoint which will not flush any data.\n\nThis will resolve the following warning.\n\n======================================================\n[ INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected ]\n4.4.0+ #9 Tainted: G           O\n------------------------------------------------------\nxfs_io/26773 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:\n (&(&sbi->inode_lock[i])->rlock){+.+...}, at: [<ffffffffc025483f>] update_dirty_page+0x6f/0xd0 [f2fs]\n\nand this task is already holding:\n (&(&q->__queue_lock)->rlock){-.-.-.}, at: [<ffffffff81396ea2>] blk_queue_bio+0x422/0x490\nwhich would create a new lock dependency:\n (&(&q->__queue_lock)->rlock){-.-.-.} -> (&(&sbi->inode_lock[i])->rlock){+.+...}\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tfs/f2fs/data.c\n\nf2fs: enhance foreground GC\n\nIf we configure section consist of multiple segments, foreground GC will\ndo the garbage collection with following approach:\n\n\tfor each segment in victim section\n\t\tblk_start_plug\n\t\tfor each valid block in segment\n\t\t\twrite out by OPU method\n\t\tsubmit bio cache   <---\n\t\tblk_finish_plug   <---\n\nThere are two issue:\n1) for most of the time, 'submit bio cache' will break the merging in\ncurrent bio buffer from writes of next segments, making a smaller bio\nsubmitting.\n2) block plug only cover IO submitting in one segment, which reduce\nopportunity of merging IOs in plug with multiple segments.\n\nSo refactor the code as below structure to strive for biggest\nopportunity of merging IOs:\n\n\tblk_start_plug\n\tfor each segment in victim section\n\t\tfor each valid block in segment\n\t\t\twrite out by OPU method\n\tsubmit bio cache\n\tblk_finish_plug\n\nTest method:\n1. mkfs.f2fs -s 8 /dev/sdX\n2. touch 32 files\n3. write 2M data into each file\n4. punch 1.5M data from offset 0 for each file\n5. trigger foreground gc through ioctl\n\nBefore patch, there are totoally 40 bios submitted.\nf2fs_submit_write_bio: dev = (8,32), WRITE_SYNC, DATA, sector = 65536, size = 122880\nf2fs_submit_write_bio: dev = (8,32), WRITE_SYNC, DATA, sector = 65776, size = 122880\nf2fs_submit_write_bio: dev = (8,32), WRITE_SYNC, DATA, sector = 66016, size = 122880\nf2fs_submit_write_bio: dev = (8,32), WRITE_SYNC, DATA, sector = 66256, size = 122880\nf2fs_submit_write_bio: dev = (8,32), WRITE_SYNC, DATA, sector = 66496, size = 32768\n----repeat for 8 times\n\nAfter patch, there are totally 35 bios submitted.\nf2fs_submit_write_bio: dev = (8,32), WRITE_SYNC, DATA, sector = 65536, size = 122880\n----repeat 34 times\nf2fs_submit_write_bio: dev = (8,32), WRITE_SYNC, DATA, sector = 73696, size = 16384\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: use wait_for_stable_page to avoid contention\n\nIn write_begin, if storage supports stable_page, we don't need to wait for\nwriteback to update its contents.\nThis patch introduces to use wait_for_stable_page instead of\nwait_on_page_writeback.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: delete unnecessary wait for page writeback\n\nno need to wait inline file page writeback for no one\nuse it, so this patch delete unnecessary wait.\n\nSigned-off-by: Yunlei He <heyunlei@huawei.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: avoid unnecessary search while finding victim in gc\n\nvariable nsearched in get_victim_by_default() indicates the number of\ndirty segments we already checked. There are 2 problems about the way\nit updates:\n1. When p.ofs_unit is greater than 1, the victim we find consists\n   of multiple segments, possibly more than 1 dirty segment.\n   But nsearched always increases by 1.\n2. If segments have been found but not been chosen, nsearched won't\n   increase. So even we have checked all dirty segments, nsearched\n   may still less than p.max_search.\nAll these problems could cause unnecessary search after all dirty\nsegments have already been checked.\n\nSigned-off-by: Fan li <fanofcode.li@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: use wq_has_sleeper for cp_wait wait_queue\n\nWe need to use wq_has_sleeper including smp_mb to consider cp_wait concurrency.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: reconstruct the code to free an extent_node\n\nThere are three steps to free an extent node:\n1) list_del_init, 2)__detach_extent_node, 3) kmem_cache_free\n\nIn path f2fs_destroy_extent_tree, 1->2->3 to free a node,\nBut in path f2fs_update_extent_tree_range, it is 2->1->3.\n\nThis patch makes all the order to be: 1->2->3\nIt makes sense, since in the next patch, we import a victim list in the\npath shrink_extent_tree, we could check if the extent_node is in the victim\nlist by checking the list_empty(). So it is necessary to put 1) first.\n\nSigned-off-by: Hou Pengyang <houpengyang@huawei.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: move extent_node list operations being coupled with rbtree operation\n\nThis patch moves extent_node list operations to be handled together with\nits rbtree operations.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: don't set cached_en if it will be freed\n\nIf en has empty list pointer, it will be freed sooner, so we don't need to\nset cached_en with it.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: improve shrink performance of extent nodes\n\nOn the worst case, we need to scan the whole radix tree and every rb-tree to\nfree the victimed extent_nodes when shrinking.\n\nPengyang initially introduced a victim_list to record the victimed extent_nodes,\nand free these extent_nodes by just scanning a list.\n\nLater, Chao Yu enhances the original patch to improve memory footprint by\nremoving victim list.\n\nThe policy of lru list shrinking becomes:\n1) lock lru list's lock\n2) trylock extent tree's lock\n3) remove extent node from lru list\n4) unlock lru list's lock\n5) do shrink\n6) repeat 1) to 5)\n\nSigned-off-by: Hou Pengyang <houpengyang@huawei.com>\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: give scheduling point in shrinking path\n\nIt needs to give a chance to be rescheduled while shrinking slab entries.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: introduce lifetime write IO statistics\n\nThis patch introduces lifetime IO write statistics exposed to the sysfs interface.\nThe write IO amount is obtained from block layer, accumulated in the file system and\nstored in the hot node summary of checkpoint.\n\nSigned-off-by: Shuoran Liu <liushuoran@huawei.com>\nSigned-off-by: Pengyang Hou <houpengyang@huawei.com>\n[Jaegeuk Kim: add sysfs documentation]\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: simplify f2fs_map_blocks\n\nIn f2fs_map_blocks, we use duplicated codes to handle first block mapping\nand the following blocks mapping, it's unnecessary. This patch simplifies\nf2fs_map_blocks to avoid using copied codes.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: simplify __allocate_data_blocks\n\nThis patch uses existing function f2fs_map_block to simplify implementation\nof __allocate_data_blocks.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: remove unneeded pointer conversion\n\nThere are redundant pointer conversion in following call stack:\n - at position a, inode was been converted to f2fs_file_info.\n - at position b, f2fs_file_info was been converted to inode again.\n\n - truncate_blocks(inode,..)\n  - fi = F2FS_I(inode)\t\t---a\n  - ADDRS_PER_PAGE(node_page, fi)\n   - addrs_per_inode(fi)\n    - inode = &fi->vfs_inode\t---b\n    - f2fs_has_inline_xattr(inode)\n     - fi = F2FS_I(inode)\n     - is_inode_flag_set(fi,..)\n\nIn order to avoid unneeded conversion, alter ADDRS_PER_PAGE and\naddrs_per_inode to acept parameter with type of inode pointer.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: introduce get_next_page_offset to speed up SEEK_DATA\n\nWhen seeking data in ->llseek, if we encounter a big hole which covers\nseveral dnode pages, we will try to seek data from index of page which\nis the first page of next dnode page, at most we could skip searching\n(ADDRS_PER_BLOCK - 1) pages.\n\nHowever it's still not efficient, because if our indirect/double-indirect\npointer are NULL, there are no dnode page locate in the tree indirect/\ndouble-indirect pointer point to, it's not necessary to search the whole\nregion.\n\nThis patch introduces get_next_page_offset to calculate next page offset\nbased on current searching level and max searching level returned from\nget_dnode_of_data, with this, we could skip searching the entire area\nindirect or double-indirect node block is not exist.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: speed up handling holes in fiemap\n\nThis patch makes f2fs_map_blocks supporting returning next potential\npage offset which skips hole region in indirect tree of inode, and\nuse it to speed up fiemap in handling big hole case.\n\nTest method:\nxfs_io -f /mnt/f2fs/file  -c \"pwrite 1099511627776 4096\"\ntime xfs_io -f /mnt/f2fs/file -c \"fiemap -v\"\n\nBefore:\ntime xfs_io -f /mnt/f2fs/file -c \"fiemap -v\"\n/mnt/f2fs/file:\n EXT: FILE-OFFSET              BLOCK-RANGE      TOTAL FLAGS\n   0: [0..2147483647]:         hole             2147483648\n   1: [2147483648..2147483655]: 81920..81927         8   0x1\n\nreal    3m3.518s\nuser    0m0.000s\nsys     3m3.456s\n\nAfter:\ntime xfs_io -f /mnt/f2fs/file -c \"fiemap -v\"\n/mnt/f2fs/file:\n EXT: FILE-OFFSET              BLOCK-RANGE      TOTAL FLAGS\n   0: [0..2147483647]:         hole             2147483648\n   1: [2147483648..2147483655]: 81920..81927         8   0x1\n\nreal    0m0.008s\nuser    0m0.000s\nsys     0m0.008s\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix endianness of on-disk summary_footer\n\nSigned-off-by: Sheng Yong <shengyong1@huawei.com>\nReviewed-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: wait on page's writeback in writepages path\n\nLikewise f2fs_write_cache_pages, let's do for node and meta pages too.\nEspecially, for node blocks, we should do this before marking its fsync\nand dentry flags.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: flush bios to handle cp_error in put_super\n\nSometimes, if cp_error is set, there remains under-writeback pages, resulting in\nkernel hang in put_super.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix conflict on page->private usage\n\nThis patch fixes confilct on page->private value between f2fs_trace_pid and\natomic page.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: introduce f2fs_submit_merged_bio_cond\n\nf2fs use single bio buffer per type data (META/NODE/DATA) for caching\nwrites locating in continuous block address as many as possible, after\nsubmitting, these writes may be still cached in bio buffer, so we have\nto flush cached writes in bio buffer by calling f2fs_submit_merged_bio.\n\nUnfortunately, in the scenario of high concurrency, bio buffer could be\nflushed by someone else before we submit it as below reasons:\na) there is no space in bio buffer.\nb) add a request of different type (SYNC, ASYNC).\nc) add a discontinuous block address.\n\nFor this condition, f2fs_submit_merged_bio will be devastating, because\nit could break the following merging of writes in bio buffer, split one\nbig bio into two smaller one.\n\nThis patch introduces f2fs_submit_merged_bio_cond which can do a\nconditional submitting with bio buffer, before submitting it will judge\nwhether:\n - page in DATA type bio buffer is matching with specified page;\n - page in DATA type bio buffer is belong to specified inode;\n - page in NODE type bio buffer is belong to specified inode;\nIf there is no eligible page in bio buffer, we will skip submitting step,\nresult in gaining more chance to merge consecutive block IOs in bio cache.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix missing skip pages info\n\nfix missing skip pages info in f2fs_writepages trace event.\n\nSigned-off-by: Yunlei He <heyunlei@huawei.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: move dio preallocation into f2fs_file_write_iter\n\nThis patch moves preallocation code for direct IOs into f2fs_file_write_iter.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tfs/f2fs/data.c\n\tfs/f2fs/file.c\n\nf2fs: preallocate blocks for buffered aio writes\n\nThis patch preallocates data blocks for buffered aio writes.\nWith this patch, we can avoid redundant locking and unlocking of node pages\ngiven consecutive aio request.\n\n[For 3.10]\n - Add preallocationg for generic_splice_write(sendfile) for xfstests/249, 285\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tfs/f2fs/data.c\n\nf2fs: increase i_size to avoid missing data\n\nWhen finsert is doing with dirting pages, we should increase i_size right away.\nOtherwise, the moved page is able to be dropped by the following\nfilemap_write_and_wait_range before updating i_size.\nEspecially, it can be done by\n\tif ((page->index >= end_index + 1) || !offset)\n\t\tgoto out;\nin f2fs_write_data_page.\n\nThis should resolve the below xfstests/091 failure reported by Dave.\n\n$ diff -u tests/generic/091.out /home/dave/src/xfstests-dev/results//f2fs/generic/091.out.bad\n--- tests/generic/091.out       2014-01-20 16:57:33.000000000 +1100\n+++ /home/dave/src/xfstests-dev/results//f2fs/generic/091.out.bad       2016-02-08 15:21:02.701375087 +1100\n@@ -1,7 +1,18 @@\n QA output created by 091\n fsx -N 10000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -R -W\n-fsx -N 10000 -o 8192 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -R -W\n-fsx -N 10000 -o 32768 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -R -W\n-fsx -N 10000 -o 8192 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -R -W\n-fsx -N 10000 -o 32768 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -R -W\n-fsx -N 10000 -o 128000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -W\n+mapped writes DISABLED\n+skipping insert range behind EOF\n+skipping insert range behind EOF\n+truncating to largest ever: 0x11e00\n+dowrite: write: Invalid argument\n+LOG DUMP (7 total operations):\n+1(  1 mod 256): SKIPPED (no operation)\n+2(  2 mod 256): SKIPPED (no operation)\n+3(  3 mod 256): FALLOC   0x2e0f2 thru 0x3134a  (0x3258 bytes) PAST_EOF\n+4(  4 mod 256): SKIPPED (no operation)\n+5(  5 mod 256): SKIPPED (no operation)\n+6(  6 mod 256): TRUNCATE UP    from 0x0 to 0x11e00\n+7(  7 mod 256): WRITE    0x73400 thru 0x79fff  (0x6c00 bytes) HOLE\n+Log of operations saved to \"/mnt/test/junk.fsxops\"; replay with --replay-ops\n+Correct content saved for comparison\n+(maybe hexdump \"/mnt/test/junk\" vs \"/mnt/test/junk.fsxgood\")\n\nReported-by: Dave Chinner <david@fromorbit.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs crypto: replace some BUG_ON()'s with error checks\n\nThis patch adopts:\n\text4 crypto: replace some BUG_ON()'s with error checks\n\nSigned-off-by: Theodore Ts'o <tytso@mit.edu>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tfs/f2fs/crypto_key.c\n\nf2fs crypto: fix spelling typo in comment\n\nThis patch adopts:\n\text4 crypto: fix spelling typo in comment\n\nSigned-off-by: Laurent Navet <laurent.navet@gmail.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs crypto: f2fs_page_crypto() doesn't need a encryption context\n\nThis patch adopts:\n\text4 crypto: ext4_page_crypto() doesn't need a encryption context\n\nSince ext4_page_crypto() doesn't need an encryption context (at least\nnot any more), this allows us to simplify a number function signature\nand also allows us to avoid needing to allocate a context in\next4_block_write_begin().  It also means we no longer need a separate\next4_decrypt_one() function.\n\nSigned-off-by: Theodore Ts'o <tytso@mit.edu>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs crypto: check for too-short encrypted file names\n\nThis patch adopts:\n\text4 crypto: check for too-short encrypted file names\n\nAn encrypted file name should never be shorter than an 16 bytes, the\nAES block size.  The 3.10 crypto layer will oops and crash the kernel\nif ciphertext shorter than the block size is passed to it.\n\nFortunately, in modern kernels the crypto layer will not crash the\nkernel in this scenario, but nevertheless, it represents a corrupted\ndirectory, and we should detect it and mark the file system as\ncorrupted so that e2fsck can fix this.\n\nSigned-off-by: Theodore Ts'o <tytso@mit.edu>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs crypto: add missing locking for keyring_key access\n\nThis patch adopts:\n\text4 crypto: add missing locking for keyring_key access\n\nSigned-off-by: Theodore Ts'o <tytso@mit.edu>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\n Conflicts:\n\tfs/f2fs/crypto_key.c\n\nf2fs: use correct errno\n\nThis patch is to fix misused error number.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs crypto: sync with ext4's fname padding\n\nThis patch fixes wrong adoption on fname padding.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: avoid garbage lenghs in dentries\n\nThis patch fixes to eliminate garbage name lengths in dentries in order\nto provide correct answers of readdir.\n\nFor example, if a valid dentry consists of:\n bitmap : 1   1 1 1\n len    : 32  0 x 0,\n\nreaddir can start with second bit_pos having len = 0.\nOr, it can start with third bit_pos having garbage.\n\nIn both of cases, we should avoid to try filling dentries.\nSo, this patch not only removes any garbage length, but also avoid entering\nzero length case in readdir.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: split drop_inmem_pages from commit_inmem_pages\n\nSplit drop_inmem_pages from commit_inmem_pages for code readability,\nand prepare for the following modification.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: support revoking atomic written pages\n\nf2fs support atomic write with following semantics:\n1. open db file\n2. ioctl start atomic write\n3. (write db file) * n\n4. ioctl commit atomic write\n5. close db file\n\nWith this flow we can avoid file becoming corrupted when abnormal power\ncut, because we hold data of transaction in referenced pages linked in\ninmem_pages list of inode, but without setting them dirty, so these data\nwon't be persisted unless we commit them in step 4.\n\nBut we should still hold journal db file in memory by using volatile\nwrite, because our semantics of 'atomic write support' is incomplete, in\nstep 4, we could fail to submit all dirty data of transaction, once\npartial dirty data was committed in storage, then after a checkpoint &\nabnormal power-cut, db file will be corrupted forever.\n\nSo this patch tries to improve atomic write flow by adding a revoking flow,\nonce inner error occurs in committing, this gives another chance to try to\nrevoke these partial submitted data of current transaction, it makes\ncommitting operation more like aotmical one.\n\nIf we're not lucky, once revoking operation was failed, EAGAIN will be\nreported to user for suggesting doing the recovery with held journal file,\nor retrying current transaction again.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs crypto: make sure the encryption info is initialized on opendir(2)\n\nThis patch syncs f2fs with commit 6bc445e0ff44 (\"ext4 crypto: make\nsure the encryption info is initialized on opendir(2)\") from ext4.\n\nSigned-off-by: Theodore Ts'o <tytso@mit.edu>\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs crypto: handle unexpected lack of encryption keys\n\nThis patch syncs f2fs with commit abdd438b26b4 (\"ext4 crypto: handle\nunexpected lack of encryption keys\") from ext4.\n\nFix up attempts by users to try to write to a file when they don't\nhave access to the encryption key.\n\nSigned-off-by: Theodore Ts'o <tytso@mit.edu>\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs crypto: avoid unneeded memory allocation when {en/de}crypting symlink\n\nThis patch adopts f2fs with codes of ext4, it removes unneeded memory\nallocation in creating/accessing path of symlink.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: introduce f2fs_journal struct to wrap journal info\n\nIntroduce a new structure f2fs_journal to wrap journal info in struct\nf2fs_summary_block for readability.\n\nstruct f2fs_journal {\n\tunion {\n\t\t__le16 n_nats;\n\t\t__le16 n_sits;\n\t};\n\tunion {\n\t\tstruct nat_journal nat_j;\n\t\tstruct sit_journal sit_j;\n\t\tstruct f2fs_extra_info info;\n\t};\n} __packed;\n\nstruct f2fs_summary_block {\n\tstruct f2fs_summary entries[ENTRIES_IN_SUM];\n\tstruct f2fs_journal journal;\n\tstruct summary_footer footer;\n} __packed;\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: enhance IO path with block plug\n\nTry to use block plug in more place as below to let process cache bios\nas much as possbile, in order to reduce lock overhead of queue in IO\nscheduler.\n1) sync_meta_pages\n2) ra_meta_pages\n3) f2fs_balance_fs_bg\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: split journal cache from curseg cache\n\nIn curseg cache, f2fs caches two different parts:\n - datas of current summay block, i.e. summary entries, footer info.\n - journal info, i.e. sparse nat/sit entries or io stat info.\n\nWith this approach, 1) it may cause higher lock contention when we access\nor update both of the parts of cache since we use the same mutex lock\ncurseg_mutex to protect the cache. 2) current summary block with last\njournal info will be writebacked into device as a normal summary block\nwhen flushing, however, we treat journal info as valid one only in current\nsummary, so most normal summary blocks contain junk journal data, it wastes\nremaining space of summary block.\n\nSo, in order to fix above issues, we split curseg cache into two parts:\na) current summary block, protected by original mutex lock curseg_mutex\nb) journal cache, protected by newly introduced r/w semaphore journal_rwsem\n\nWhen loading curseg cache during ->mount, we store summary info and\njournal info into different caches; When doing checkpoint, we combine\ndatas of two cache into current summary block for persisting.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: reorder nat cache lock in cache_nat_entry\n\nWhen lookuping nat entry in cache_nat_entry, if we fail to hit nat cache,\nwe try to load nat entries a) from journal of current segment cache or b)\nfrom NAT pages for updating, during the process, write lock of\nnat_tree_lock will be held to avoid inconsistent condition in between\nnid cache and nat cache caused by racing among nat entry shrinker,\ncheckpointer, nat entry updater.\n\nBut this way may cause low efficient when updating nat cache, because it\nserializes accessing in journal cache or reading NAT pages.\n\nHere, we reorder lock and update flow as below to enhance accessing\nconcurrency:\n\n - get_node_info\n  - down_read(nat_tree_lock)\n  - lookup nat cache --- hit -> unlock & return\n  - lookup journal cache --- hit -> unlock & goto update\n  - up_read(nat_tree_lock)\nupdate:\n  - down_write(nat_tree_lock)\n  - cache_nat_entry\n   - lookup nat cache --- nohit -> update\n  - up_write(nat_tree_lock)\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: slightly reorganize read_raw_super_block\n\nread_raw_super_block was introduced to help find the\nfirst valid superblock. Commit da554e48caab (\"f2fs:\nrecovering broken superblock during mount\") changed the\nbehaviour to read both of them and check whether need\nthe recovery flag or not. So the comment before this\nfunction isn't consistent with what it actually does.\nAlso, the origin code use two tags to round the err\ncases, which isn't so readable. So this patch amend\nthe comment and slightly reorganize it.\n\nSigned-off-by: Shawn Lin <shawn.lin@rock-chips.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: move sanity checking of cp into get_valid_checkpoint\n\n>From the function name of get_valid_checkpoint, it seems to return\nthe valid cp or NULL for caller to check. If no valid one is found,\nf2fs_fill_super will print the err log. But if get_valid_checkpoint\nget one valid(the return value indicate that it's valid, however actually\nit is invalid after sanity checking), then print another similar err\nlog. That seems strange. Let's keep sanity checking inside the procedure\nof geting valid cp. Another improvement we gained from this move is\nthat even the large volume is supported, we check the cp in advanced\nto skip the following procedure if failing the sanity checking.\n\nSigned-off-by: Shawn Lin <shawn.lin@rock-chips.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: detect error of update_dent_inode in ->rename\n\nShould check and show correct return value of update_dent_inode in\n->rename.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix to delete old dirent in converted inline directory in ->rename\n\nWhen doing test with fstests/generic/068 in inline_dentry enabled f2fs,\nfollowing oops dmesg will be reported:\n\n ------------[ cut here ]------------\n WARNING: CPU: 5 PID: 11841 at fs/inode.c:273 drop_nlink+0x49/0x50()\n Modules linked in: f2fs(O) ip6table_filter ip6_tables ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state\n CPU: 5 PID: 11841 Comm: fsstress Tainted: G           O    4.5.0-rc1 #45\n Hardware name: Hewlett-Packard HP Z220 CMT Workstation/1790, BIOS K51 v01.61 05/16/2013\n  0000000000000111 ffff88009cdf7ae8 ffffffff813e5944 0000000000002e41\n  0000000000000000 0000000000000111 0000000000000000 ffff88009cdf7b28\n  ffffffff8106a587 ffff88009cdf7b58 ffff8804078fe180 ffff880374a64e00\n Call Trace:\n  [<ffffffff813e5944>] dump_stack+0x48/0x64\n  [<ffffffff8106a587>] warn_slowpath_common+0x97/0xe0\n  [<ffffffff8106a5ea>] warn_slowpath_null+0x1a/0x20\n  [<ffffffff81231039>] drop_nlink+0x49/0x50\n  [<ffffffffa07b95b4>] f2fs_rename2+0xe04/0x10c0 [f2fs]\n  [<ffffffff81231ff1>] ? lock_two_nondirectories+0x81/0x90\n  [<ffffffff813f454d>] ? lockref_get+0x1d/0x30\n  [<ffffffff81220f70>] vfs_rename+0x2e0/0x640\n  [<ffffffff8121f9db>] ? lookup_dcache+0x3b/0xd0\n  [<ffffffff810b8e41>] ? update_fast_ctr+0x21/0x40\n  [<ffffffff8134ff12>] ? security_path_rename+0xa2/0xd0\n  [<ffffffff81224af6>] SYSC_renameat2+0x4b6/0x540\n  [<ffffffff810ba8ed>] ? trace_hardirqs_off+0xd/0x10\n  [<ffffffff810022ba>] ? exit_to_usermode_loop+0x7a/0xd0\n  [<ffffffff817e0ade>] ? int_ret_from_sys_call+0x52/0x9f\n  [<ffffffff810bdc90>] ? trace_hardirqs_on_caller+0x100/0x1c0\n  [<ffffffff81224b8e>] SyS_renameat2+0xe/0x10\n  [<ffffffff8121f08e>] SyS_rename+0x1e/0x20\n  [<ffffffff817e0957>] entry_SYSCALL_64_fastpath+0x12/0x6f\n ---[ end trace 2b31e17995404e42 ]---\n\nThis is because: in the same inline directory, when we renaming one file\nfrom source name to target name which is not existed, once space of inline\ndentry is not enough, inline conversion will be triggered, after that all\ndata in inline dentry will be moved to normal dentry page.\n\nAfter attaching the new entry in coverted dentry page, still we try to\nremove old entry in original inline dentry, since old entry has been\nmoved, so it obviously doesn't make any effect, result in remaining old\nentry in converted dentry page.\n\nNow, we have two valid dentries pointed to the same inode which has nlink\nvalue of 1, deleting them both, above warning appears.\n\nThis issue can be reproduced easily as below steps:\n1. mount f2fs with inline_dentry option\n2. mkdir dir\n3. touch 180 files named [001-180] in dir\n4. rename dir/180 dir/181\n5. rm dir/180 dir/181\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: reuse read_inline_data for f2fs_convert_inline_page\n\nf2fs_convert_inline_page introduce what read_inline_data\nalready does for copying out the inline data from inode_page.\nWe can use read_inline_data instead to simplify the code.\n\nSigned-off-by: Shawn Lin <shawn.lin@rock-chips.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: remain last victim segment number ascending order\n\nThis patch avoids to remain inefficient victim segment number selected by\na victim.\n\nFor example, if all the dirty segments has same valid blocks, we can get\nthe victim segments descending order due to keeping wrong last segment number.\n\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix the wrong stat count of calling gc\n\nWith a partition which was formated as multi segments in one section,\nwe stated incorrectly for count of gc operation.\n\ne.g., for a partition with segs_per_sec = 4\n\ncat /sys/kernel/debug/f2fs/status\n\nGC calls: 208 (BG: 7)\n  - data segments : 104 (52)\n  - node segments : 104 (24)\n\nGC called count should be (104 (data segs) + 104 (node segs)) / 4 = 52,\nrather than 208. Fix it.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: show more info about superblock recovery\n\nThis patch changes to show more info in message log about the recovery\nof the corrupted superblock during ->mount, e.g. the index of corrupted\nsuperblock and the result of recovery.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: try to flush inode after merging inline data\n\nWhen flushing node pages, if current node page is an inline inode page, we\nwill try to merge inline data from data page into inline inode page, then\nskip flushing current node page, it will decrease the number of nodes to\nbe flushed in batch in this round, which may lead to worse performance.\n\nThis patch gives a chance to flush just merged inline inode pages for\nperformance.\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: trace old block address for CoWed page\n\nThis patch enables to trace old block address of CoWed page for better\ndebugging.\n\nf2fs_submit_page_mbio: dev = (1,0), ino = 1, page_index = 0x1d4f0, oldaddr = 0xfe8ab, newaddr = 0xfee90 rw = WRITE_SYNC, type = NODE\nf2fs_submit_page_mbio: dev = (1,0), ino = 1, page_index = 0x1d4f8, oldaddr = 0xfe8b0, newaddr = 0xfee91 rw = WRITE_SYNC, type = NODE\nf2fs_submit_page_mbio: dev = (1,0), ino = 1, page_index = 0x1d4fa, oldaddr = 0xfe8ae, newaddr = 0xfee92 rw = WRITE_SYNC, type = NODE\n\nf2fs_submit_page_mbio: dev = (1,0), ino = 134824, page_index = 0x96, oldaddr = 0xf049b, newaddr = 0x2bbe rw = WRITE, type = DATA\nf2fs_submit_page_mbio: dev = (1,0), ino = 134824, page_index = 0x97, oldaddr = 0xf049c, newaddr = 0x2bbf rw = WRITE, type = DATA\nf2fs_submit_page_mbio: dev = (1,0), ino = 134824, page_index = 0x98, oldaddr = 0xf049d, newaddr = 0x2bc0 rw = WRITE, type = DATA\n\nf2fs_submit_page_mbio: dev = (1,0), ino = 135260, page_index = 0x47, oldaddr = 0xffffffff, newaddr = 0xf2631 rw = WRITE, type = DATA\nf2fs_submit_page_mbio: dev = (1,0), ino = 135260, page_index = 0x48, oldaddr = 0xffffffff, newaddr = 0xf2632 rw = WRITE, type = DATA\nf2fs_submit_page_mbio: dev = (1,0), ino = 135260, page_index = 0x49, oldaddr = 0xffffffff, newaddr = 0xf2633 rw = WRITE, type = DATA\n\nSigned-off-by: Chao Yu <chao2.yu@samsung.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: avoid hungtask problem caused by losing wake_up\n\nThe D state of wait_on_all_pages_writeback should be waken by\nfunction f2fs_write_end_io when all writeback pages have been\nsuccesfully written to device. It's possible that wake_up comes\nbetween get_pages and io_schedule. Maybe in this case it will\nlost wake_up and still in D state even if all pages have been\nwrite back to device, and finally, the whole system will be into\nthe hungtask state.\n\n                if (!get_pages(sbi, F2FS_WRITEBACK))\n                         break;\n\t\t\t\t\t<---------  wake_up\n                io_schedule();\n\nSigned-off-by: Yunlei He <heyunlei@huawei.com>\nSigned-off-by: Biao He <hebiao6@huawei.com>\nSigned-off-by: Jaegeuk Kim <jaegeuk@kernel.org>\n\nf2fs: fix incorrect upper bound when iterating inode mapping tree\n\n1. Inode mapping tree can index page in range of [0, ULONG_MAX], however,\nin some places, f2fs only search or iterate page in ragne of [0, LONG_MAX],\nresult in…","distinct":true,"url":"https://api.github.com/repos/RiteshSaxena/Reloaded_tomato/commits/01f7179f48c19c7d3e9823cd03f403b6decf78a8"}]}
{"actor":{"display_login":"RiteshSaxena"}}