1. 19 8月, 2016 3 次提交
    • C
      f2fs: allow copying file range only in between regular files · fe8494bf
      Chao Yu 提交于
      Only if two input files are regular files, we allow copying data in
      range of them, otherwise, deny it.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      fe8494bf
    • C
      Revert "f2fs: move i_size_write in f2fs_write_end" · 3024c9a1
      Chao Yu 提交于
      This reverts commit a2ee0a30.
      
      When testing with generic/032 of xfstest suit, failure message will be
      reported as below:
      
      generic/032 8s ... [failed, exit status 1] - output mismatch (see results/generic/032.out.bad)
          --- tests/generic/032.out	2015-01-11 16:52:27.643681072 +0800
          +++ results/generic/032.out.bad	2016-08-06 13:44:43.861330500 +0800
          @@ -1,5 +1,5 @@
           QA output created by 032
          -100 iterations
          -0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
          -*
          -0100000
          +1: [768..775]: unwritten
          +Unwritten extents found!
          ...
          (Run 'diff -u tests/generic/032.out results/generic/032.out.bad'  to see the entire diff)
      Ran: generic/032
      Failures: generic/032
      Failed 1 of 1 tests
      
      In write_end(), we should update i_size of inode before unlock page,
      otherwise, we will lose newly updated data in following race condition.
      
      Thread A			Thread B
      - write_end
       - unlock page
      				- writepages
      				 - lock_page
      				  - writepage
      				  if page is out-of-range of file size,
      				  we will skip writting the page.
       - update i_size
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      3024c9a1
    • J
      Revert "f2fs: use percpu_rw_semaphore" · b873b798
      Jaegeuk Kim 提交于
      LKP reported -36.3% regression of fsmark.files_per_sec due to this patch.
      I've confirmed that fxmark [1] has also slight regression for DWAL.
      
      [1] https://github.com/sslab-gatech/fxmark
      
      This reverts commit ec795418.
      b873b798
  2. 05 8月, 2016 1 次提交
  3. 31 7月, 2016 1 次提交
  4. 27 7月, 2016 1 次提交
    • M
      mm, memcg: use consistent gfp flags during readahead · 8a5c743e
      Michal Hocko 提交于
      Vladimir has noticed that we might declare memcg oom even during
      readahead because read_pages only uses GFP_KERNEL (with mapping_gfp
      restriction) while __do_page_cache_readahead uses
      page_cache_alloc_readahead which adds __GFP_NORETRY to prevent from
      OOMs.  This gfp mask discrepancy is really unfortunate and easily
      fixable.  Drop page_cache_alloc_readahead() which only has one user and
      outsource the gfp_mask logic into readahead_gfp_mask and propagate this
      mask from __do_page_cache_readahead down to read_pages.
      
      This alone would have only very limited impact as most filesystems are
      implementing ->readpages and the common implementation mpage_readpages
      does GFP_KERNEL (with mapping_gfp restriction) again.  We can tell it to
      use readahead_gfp_mask instead as this function is called only during
      readahead as well.  The same applies to read_cache_pages.
      
      ext4 has its own ext4_mpage_readpages but the path which has pages !=
      NULL can use the same gfp mask.  Btrfs, cifs, f2fs and orangefs are
      doing a very similar pattern to mpage_readpages so the same can be
      applied to them as well.
      
      [akpm@linux-foundation.org: coding-style fixes]
      [mhocko@suse.com: restrict gfp mask in mpage_alloc]
        Link: http://lkml.kernel.org/r/20160610074223.GC32285@dhcp22.suse.cz
      Link: http://lkml.kernel.org/r/1465301556-26431-1-git-send-email-mhocko@kernel.orgSigned-off-by: NMichal Hocko <mhocko@suse.com>
      Cc: Vladimir Davydov <vdavydov@parallels.com>
      Cc: Chris Mason <clm@fb.com>
      Cc: Steve French <sfrench@samba.org>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Mike Marshall <hubcap@omnibond.com>
      Cc: Jaegeuk Kim <jaegeuk@kernel.org>
      Cc: Changman Lee <cm224.lee@samsung.com>
      Cc: Chao Yu <yuchao0@huawei.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8a5c743e
  5. 26 7月, 2016 1 次提交
  6. 23 7月, 2016 1 次提交
    • Y
      f2fs: get victim segment again after new cp · fe94793e
      Yunlei He 提交于
      Previous selected segment may become free after write_checkpoint,
      if we do garbage collect on this segment, and then new_curseg happen
      to reuse it, it may cause f2fs_bug_on as below.
      
      	panic+0x154/0x29c
      	do_garbage_collect+0x15c/0xaf4
      	f2fs_gc+0x2dc/0x444
      	f2fs_balance_fs.part.22+0xcc/0x14c
      	f2fs_balance_fs+0x28/0x34
      	f2fs_map_blocks+0x5ec/0x790
      	f2fs_preallocate_blocks+0xe0/0x100
      	f2fs_file_write_iter+0x64/0x11c
      	new_sync_write+0xac/0x11c
      	vfs_write+0x144/0x1e4
      	SyS_write+0x60/0xc0
      
      Here, maybe we check sit and ssa type during reset_curseg. So, we check
      segment is stale or not, and select a new victim to avoid this.
      Signed-off-by: NYunlei He <heyunlei@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      fe94793e
  7. 21 7月, 2016 5 次提交
  8. 19 7月, 2016 1 次提交
  9. 16 7月, 2016 7 次提交
  10. 09 7月, 2016 15 次提交
  11. 07 7月, 2016 4 次提交