1. 07 May, 2016 18 commits
  2. 03 May, 2016 3 commits
  3. 27 Apr, 2016 4 commits
  4. 26 Apr, 2016 6 commits
  5. 15 Apr, 2016 9 commits
    • Jaegeuk Kim's avatar
      f2fs: flush dirty pages before starting atomic writes · c27753d6
      Jaegeuk Kim authored
      If somebody wrote some data before atomic writes, we should flush them in order
      to handle atomic data in a right period.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      c27753d6
    • Jaegeuk Kim's avatar
      f2fs: don't invalidate atomic page if successful · 63c52d78
      Jaegeuk Kim authored
      If we committed atomic write successfully, we don't need to invalidate pages.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      63c52d78
    • Jaegeuk Kim's avatar
      f2fs: give -E2BIG for no space in xattr · 58457f1c
      Jaegeuk Kim authored
      This patch returns -E2BIG if there is no space to add an xattr entry.
      This should fix generic/026 in xfstests as well.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      58457f1c
    • Jaegeuk Kim's avatar
      f2fs: remove redundant condition check · 4da7bf5a
      Jaegeuk Kim authored
      This patch resolves the redundant condition check reported by David.
      Reported-by: default avatarDavid Binderman <dcb314@hotmail.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      4da7bf5a
    • Jaegeuk Kim's avatar
      f2fs: unset atomic/volatile flag in f2fs_release_file · 26dc3d44
      Jaegeuk Kim authored
      The atomic/volatile operation should be done in pair of start and commit
      ioctl.
      For example, if a killed process remains open-ended atomic operation, we should
      drop its flag as well as its atomic data. Otherwise, if sqlite initiates another
      operation which doesn't require atomic writes, it will lose every data, since
      f2fs still treats with them as atomic writes; nobody will trigger its commit.
      Reported-by: default avatarMiao Xie <miaoxie@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      26dc3d44
    • Jaegeuk Kim's avatar
      f2fs: fix dropping inmemory pages in a wrong time · de5307e4
      Jaegeuk Kim authored
      When one reader closes its file while the other writer is doing atomic writes,
      f2fs_release_file drops atomic data resulting in an empty commit.
      This patch fixes this wrong commit problem by checking openess of the file.
      
       Process0                       Process1
       				open file
       start atomic write
       write data
       read data
      				close file
      				f2fs_release_file()
      				clear atomic data
       commit atomic write
      Reported-by: default avatarMiao Xie <miaoxie@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      de5307e4
    • Jaegeuk Kim's avatar
      f2fs: add BUG_ON to avoid unnecessary flow · ff373558
      Jaegeuk Kim authored
      This patch adds BUG_ON instead of retrying loop.
      In the case of node pages, we already got this inode page, but unlocked it.
      By the fact that we don't truncate any node pages in operations, the page's
      mapping should be unchangeable.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      ff373558
    • Jaegeuk Kim's avatar
      f2fs: use PGP_LOCK to check its truncation · 4a6de50d
      Jaegeuk Kim authored
      Previously, after trylock_page is succeeded, it doesn't check its mapping.
      In order to fix that, we can just give PGP_LOCK to pagecache_get_page.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      4a6de50d
    • Chao Yu's avatar
      f2fs: fix to convert inline directory correctly · 675f10bd
      Chao Yu authored
      With below serials, we will lose parts of dirents:
      
      1) mount f2fs with inline_dentry option
      2) echo 1 > /sys/fs/f2fs/sdX/dir_level
      3) mkdir dir
      4) touch 180 files named [1-180] in dir
      5) touch 181 in dir
      6) echo 3 > /proc/sys/vm/drop_caches
      7) ll dir
      
      ls: cannot access 2: No such file or directory
      ls: cannot access 4: No such file or directory
      ls: cannot access 5: No such file or directory
      ls: cannot access 6: No such file or directory
      ls: cannot access 8: No such file or directory
      ls: cannot access 9: No such file or directory
      ...
      total 360
      drwxr-xr-x 2 root root 4096 Feb 19 15:12 ./
      drwxr-xr-x 3 root root 4096 Feb 19 15:11 ../
      -rw-r--r-- 1 root root    0 Feb 19 15:12 1
      -rw-r--r-- 1 root root    0 Feb 19 15:12 10
      -rw-r--r-- 1 root root    0 Feb 19 15:12 100
      -????????? ? ?    ?       ?            ? 101
      -????????? ? ?    ?       ?            ? 102
      -????????? ? ?    ?       ?            ? 103
      ...
      
      The reason is: when doing the inline dir conversion, we didn't consider
      that directory has hierarchical hash structure which can be configured
      through sysfs interface 'dir_level'.
      
      By default, dir_level of directory inode is 0, it means we have one bucket
      in hash table located in first level, all dirents will be hashed in this
      bucket, so it has no problem for us to do the duplication simply between
      inline dentry page and converted normal dentry page.
      
      However, if we configured dir_level with the value N (greater than 0), it
      will expand the bucket number of first level hash table by 2^N - 1, it
      hashs dirents into different buckets according their hash value, if we
      still move all dirents to first bucket, it makes incorrent locating for
      inline dirents, the result is, although we can iterate all dirents through
      ->readdir, we can't stat some of them in ->lookup which based on hash
      table searching.
      
      This patch fixes this issue by rehashing dirents into correct position
      when converting inline directory.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      675f10bd