1. 23 1月, 2018 4 次提交
  2. 19 1月, 2018 1 次提交
    • D
      f2fs: prevent newly created inode from being dirtied incorrectly · 9ac1e2d8
      Daeho Jeong 提交于
      Now, we invoke f2fs_mark_inode_dirty_sync() to make an inode dirty in
      advance of creating a new node page for the inode. By this, some inodes
      whose node page is not created yet can be linked into the global dirty
      list.
      
      If the checkpoint is executed at this moment, the inode will be written
      back by writeback_single_inode() and finally update_inode_page() will
      fail to detach the inode from the global dirty list because the inode
      doesn't have a node page.
      
      The problem is that the inode's state in VFS layer will become clean
      after execution of writeback_single_inode() and it's still linked in
      the global dirty list of f2fs and this will cause a kernel panic.
      
      So, we will prevent the newly created inode from being dirtied during
      the FI_NEW_INODE flag of the inode is set. We will make it dirty
      right after the flag is cleared.
      Signed-off-by: NDaeho Jeong <daeho.jeong@samsung.com>
      Signed-off-by: NYoungjin Gil <youngjin.gil@samsung.com>
      Tested-by: NHobin Woo <hobin.woo@samsung.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      9ac1e2d8
  3. 17 1月, 2018 4 次提交
  4. 04 1月, 2018 1 次提交
  5. 03 1月, 2018 13 次提交
  6. 28 11月, 2017 1 次提交
    • L
      Rename superblock flags (MS_xyz -> SB_xyz) · 1751e8a6
      Linus Torvalds 提交于
      This is a pure automated search-and-replace of the internal kernel
      superblock flags.
      
      The s_flags are now called SB_*, with the names and the values for the
      moment mirroring the MS_* flags that they're equivalent to.
      
      Note how the MS_xyz flags are the ones passed to the mount system call,
      while the SB_xyz flags are what we then use in sb->s_flags.
      
      The script to do this was:
      
          # places to look in; re security/*: it generally should *not* be
          # touched (that stuff parses mount(2) arguments directly), but
          # there are two places where we really deal with superblock flags.
          FILES="drivers/mtd drivers/staging/lustre fs ipc mm \
                  include/linux/fs.h include/uapi/linux/bfs_fs.h \
                  security/apparmor/apparmorfs.c security/apparmor/include/lib.h"
          # the list of MS_... constants
          SYMS="RDONLY NOSUID NODEV NOEXEC SYNCHRONOUS REMOUNT MANDLOCK \
                DIRSYNC NOATIME NODIRATIME BIND MOVE REC VERBOSE SILENT \
                POSIXACL UNBINDABLE PRIVATE SLAVE SHARED RELATIME KERNMOUNT \
                I_VERSION STRICTATIME LAZYTIME SUBMOUNT NOREMOTELOCK NOSEC BORN \
                ACTIVE NOUSER"
      
          SED_PROG=
          for i in $SYMS; do SED_PROG="$SED_PROG -e s/MS_$i/SB_$i/g"; done
      
          # we want files that contain at least one of MS_...,
          # with fs/namespace.c and fs/pnode.c excluded.
          L=$(for i in $SYMS; do git grep -w -l MS_$i $FILES; done| sort|uniq|grep -v '^fs/namespace.c'|grep -v '^fs/pnode.c')
      
          for f in $L; do sed -i $f $SED_PROG; done
      Requested-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1751e8a6
  7. 14 11月, 2017 2 次提交
  8. 07 11月, 2017 1 次提交
  9. 06 11月, 2017 10 次提交
    • C
      f2fs: fix summary info corruption · 2b60311d
      Chao Yu 提交于
      Sometimes, after running generic/270 of fstest, fsck reports summary
      info and actual position of block address in direct node becoming
      inconsistent.
      
      The root cause is race in between __f2fs_replace_block and change_curseg
      as below:
      
      Thread A				Thread B
      - __clone_blkaddrs
       - f2fs_replace_block
        - __f2fs_replace_block
         - segnoA = GET_SEGNO(sbi, blkaddrA);
         - type = se->type:=CURSEG_HOT_DATA
         - if (!IS_CURSEG(sbi, segnoA))
               type = CURSEG_WARM_DATA
      					- allocate_data_block
      					 - allocate_segment
      					  - get_ssr_segment
      					  - change_curseg(segnoA, CURSEG_HOT_DATA)
         - change_curseg(segnoA, CURSEG_WARM_DATA)
          - reset_curseg
           - __set_sit_entry_type
            - change se->type from CURSEG_HOT_DATA to CURSEG_WARM_DATA
      
      So finally, hot curseg locates in segnoA, but type of segnoA becomes
      CURSEG_WARM_DATA.
      
      Then if we invoke __f2fs_replace_block(blkaddrB, blkaddrA, true, false),
      as blkaddrA locates in segnoA, so we will move warm type curseg to segnoA,
      then change its summary cache and writeback it to summary block.
      
      But segnoA is used by hot type curseg too, once it moves or persist, it
      will cover summary block content with inner old summary cache, result in
      inconsistent status.
      
      This patch tries to fix this issue by introduce global curseg lock to avoid
      race in between __f2fs_replace_block and change_curseg.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      2b60311d
    • J
      f2fs: support quota sys files · ea676733
      Jaegeuk Kim 提交于
      This patch supports hidden quota files in the system, which will be used for
      Android. It requires up-to-date f2fs-tools later than v1.9.0.
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      ea676733
    • J
      f2fs: add quota_ino feature infra · 234a9689
      Jaegeuk Kim 提交于
      This patch adds quota_ino feature infra to be used for quota files.
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      234a9689
    • Y
      Revert "f2fs: handle dirty segments inside refresh_sit_entry" · 65f1b80b
      Yunlong Song 提交于
      This reverts commit 5e443818
      
      The commit should be reverted because call sequence of below two parts
      of code must be kept:
      a. update sit information, it needs to be updated before segment
      allocation since latter allocation may trigger SSR, and SSR allocation
      needs latest valid block information of all segments.
      b. update segment status, it needs to be updated after segment allocation
      since we can skip updating current opened segment status.
      
      Fixes: 5e443818 ("f2fs: handle dirty segments inside refresh_sit_entry")
      Suggested-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NYunlong Song <yunlong.song@huawei.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      [Jaegeuk Kim: remove refresh_sit_entry function]
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      65f1b80b
    • C
      f2fs: export SSR allocation threshold · a2a12b67
      Chao Yu 提交于
      This patch exports min_ssr_segments threshold in sysfs to let user
      control triggering SSR allocation flexibly.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      a2a12b67
    • C
      f2fs: give correct trimmed blocks in fstrim · 0ea80512
      Chao Yu 提交于
      We have supported to issue discard in specified range during fstrim,
      it needs to return caller with successfully trimmed bytes in that
      range instead of bytes of invalid blocks which are scanned in
      checkpoint.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      0ea80512
    • C
      f2fs: support bio allocation error injection · d62fe971
      Chao Yu 提交于
      This patch adds to support bio allocation error injection to simulate
      out-of-memory test scenario.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      d62fe971
    • C
      f2fs: support get_page error injection · 01eccef7
      Chao Yu 提交于
      This patch adds to support get_page error injection to simulate
      out-of-memory test scenario.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      01eccef7
    • Y
      f2fs: support soft block reservation · 80d42145
      Yunlong Song 提交于
      It supports to extend reserved_blocks sysfs interface to be soft
      threshold, which allows user configure it exceeding current available
      user space. This patch also introduces a new sysfs interface called
      current_reserved_blocks, which shows the current blocks that have
      already been reserved.
      Signed-off-by: NYunlong Song <yunlong.song@huawei.com>
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      80d42145
    • C
      f2fs: support flexible inline xattr size · 6afc662e
      Chao Yu 提交于
      Now, in product, more and more features based on file encryption were
      introduced, their demand of xattr space is increasing, however, inline
      xattr has fixed-size of 200 bytes, once inline xattr space is full, new
      increased xattr data would occupy additional xattr block which may bring
      us more space usage and performance regression during persisting.
      
      In order to resolve above issue, it's better to expand inline xattr size
      flexibly according to user's requirement.
      
      So this patch introduces new filesystem feature 'flexible inline xattr',
      and new mount option 'inline_xattr_size=%u', once mkfs enables the
      feature, we can use the option to make f2fs supporting flexible inline
      xattr size.
      
      To support this feature, we add extra attribute i_inline_xattr_size in
      inode layout, indicating that how many space inline xattr borrows from
      block address mapping space in inode layout, by this, we can easily
      locate and store flexible-sized inline xattr data in inode.
      
      Inode disk layout:
        +----------------------+
        | .i_mode              |
        | ...                  |
        | .i_ext               |
        +----------------------+
        | .i_extra_isize       |
        | .i_inline_xattr_size |-----------+
        | ...                  |           |
        +----------------------+           |
        | .i_addr              |           |
        |  - block address or  |           |
        |  - inline data       |           |
        +----------------------+<---+      v
        |    inline xattr      |    +---inline xattr range
        +----------------------+<---+
        | .i_nid               |
        +----------------------+
        |   node_footer        |
        | (nid, ino, offset)   |
        +----------------------+
      
      Note that, we have to cnosider backward compatibility which reserved
      inline_data space, 200 bytes, all the time, reported by Sheng Yong.
      
      Previous inline data or directory always reserved 200 bytes in inode layout,
      even if inline_xattr is disabled. In order to keep inline_dentry's structure
      for backward compatibility, we get the space back only from inline_data.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Reported-by: NSheng Yong <shengyong1@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      6afc662e
  10. 26 10月, 2017 3 次提交