1. 08 5月, 2016 7 次提交
  2. 04 5月, 2016 3 次提交
  3. 28 4月, 2016 3 次提交
  4. 27 4月, 2016 6 次提交
  5. 15 4月, 2016 15 次提交
    • J
      f2fs: flush dirty pages before starting atomic writes · c27753d6
      Jaegeuk Kim 提交于
      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: NJaegeuk Kim <jaegeuk@kernel.org>
      c27753d6
    • J
      f2fs: don't invalidate atomic page if successful · 63c52d78
      Jaegeuk Kim 提交于
      If we committed atomic write successfully, we don't need to invalidate pages.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      63c52d78
    • J
      f2fs: give -E2BIG for no space in xattr · 58457f1c
      Jaegeuk Kim 提交于
      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: NJaegeuk Kim <jaegeuk@kernel.org>
      58457f1c
    • J
      f2fs: remove redundant condition check · 4da7bf5a
      Jaegeuk Kim 提交于
      This patch resolves the redundant condition check reported by David.
      Reported-by: NDavid Binderman <dcb314@hotmail.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      4da7bf5a
    • J
      f2fs: unset atomic/volatile flag in f2fs_release_file · 26dc3d44
      Jaegeuk Kim 提交于
      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: NMiao Xie <miaoxie@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      26dc3d44
    • J
      f2fs: fix dropping inmemory pages in a wrong time · de5307e4
      Jaegeuk Kim 提交于
      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: NMiao Xie <miaoxie@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      de5307e4
    • J
      f2fs: add BUG_ON to avoid unnecessary flow · ff373558
      Jaegeuk Kim 提交于
      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: NJaegeuk Kim <jaegeuk@kernel.org>
      ff373558
    • J
      f2fs: use PGP_LOCK to check its truncation · 4a6de50d
      Jaegeuk Kim 提交于
      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: NJaegeuk Kim <jaegeuk@kernel.org>
      4a6de50d
    • C
      f2fs: fix to convert inline directory correctly · 675f10bd
      Chao Yu 提交于
      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: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      675f10bd
    • J
      f2fs: show current mount status · 8c11a53f
      Jaegeuk Kim 提交于
      This patch remains the current mount status to f2fs status info.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      8c11a53f
    • J
      f2fs: treat as a normal umount when remounting ro · faa0e55b
      Jaegeuk Kim 提交于
      When user remounts f2fs as read-only, we can mark the checkpoint as umount.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      faa0e55b
    • J
      f2fs: give -EINVAL for norecovery and rw mount · 6781eabb
      Jaegeuk Kim 提交于
      Once detecting something to recover, f2fs should stop mounting, given norecovery
      and rw mount options.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      6781eabb
    • J
      f2fs: recover superblock at RW remounts · df728b0f
      Jaegeuk Kim 提交于
      This patch adds a sbi flag, SBI_NEED_SB_WRITE, which indicates it needs to
      recover superblock when (re)mounting as RW. This is set only when f2fs is
      mounted as RO.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      df728b0f
    • J
      f2fs: give RO message when recovering superblock · f2353d7b
      Jaegeuk Kim 提交于
      When one of superblocks is missing, f2fs recovers it with the valid one.
      But, even if f2fs is mounted as RO, we'd better notify that too.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      f2353d7b
    • L
      Make file credentials available to the seqfile interfaces · 34dbbcdb
      Linus Torvalds 提交于
      A lot of seqfile users seem to be using things like %pK that uses the
      credentials of the current process, but that is actually completely
      wrong for filesystem interfaces.
      
      The unix semantics for permission checking files is to check permissions
      at _open_ time, not at read or write time, and that is not just a small
      detail: passing off stdin/stdout/stderr to a suid application and making
      the actual IO happen in privileged context is a classic exploit
      technique.
      
      So if we want to be able to look at permissions at read time, we need to
      use the file open credentials, not the current ones.  Normal file
      accesses can just use "f_cred" (or any of the helper functions that do
      that, like file_ns_capable()), but the seqfile interfaces do not have
      any such options.
      
      It turns out that seq_file _does_ save away the user_ns information of
      the file, though.  Since user_ns is just part of the full credential
      information, replace that special case with saving off the cred pointer
      instead, and suddenly seq_file has all the permission information it
      needs.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      34dbbcdb
  6. 13 4月, 2016 4 次提交
  7. 11 4月, 2016 1 次提交
    • L
      Revert "ext4: allow readdir()'s of large empty directories to be interrupted" · 9f2394c9
      Linus Torvalds 提交于
      This reverts commit 1028b55b.
      
      It's broken: it makes ext4 return an error at an invalid point, causing
      the readdir wrappers to write the the position of the last successful
      directory entry into the position field, which means that the next
      readdir will now return that last successful entry _again_.
      
      You can only return fatal errors (that terminate the readdir directory
      walk) from within the filesystem readdir functions, the "normal" errors
      (that happen when the readdir buffer fills up, for example) happen in
      the iterorator where we know the position of the actual failing entry.
      
      I do have a very different patch that does the "signal_pending()"
      handling inside the iterator function where it is allowable, but while
      that one passes all the sanity checks, I screwed up something like four
      times while emailing it out, so I'm not going to commit it today.
      
      So my track record is not good enough, and the stars will have to align
      better before that one gets committed.  And it would be good to get some
      review too, of course, since celestial alignments are always an iffy
      debugging model.
      
      IOW, let's just revert the commit that caused the problem for now.
      Reported-by: NGreg Thelen <gthelen@google.com>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9f2394c9
  8. 09 4月, 2016 1 次提交