1. 12 2月, 2013 1 次提交
    • J
      f2fs: prevent checkpoint once any IO failure is detected · 577e3495
      Jaegeuk Kim 提交于
      This patch enhances the checkpoint routine to cope with IO errors.
      
      Basically f2fs detects IO errors from end_io_write, and the errors are able to
      be occurred during one of data, node, and meta page writes.
      
      In the previous code, when an IO error is occurred during writes, f2fs sets a
      flag, CP_ERROR_FLAG, in the raw ckeckpoint buffer which will be written to disk.
      Afterwards, write_checkpoint() will check the flag and remount f2fs as a
      read-only (ro) mode.
      
      However, even once f2fs is remounted as a ro mode, dirty checkpoint pages are
      freely able to be written to disk by flusher or kswapd in background.
      In such a case, after cold reboot, f2fs would restore the checkpoint data having
      CP_ERROR_FLAG, resulting in disabling write_checkpoint and remounting f2fs as
      a ro mode again.
      
      Therefore, let's prevent any checkpoint page (meta) writes once an IO error is
      occurred, and remount f2fs as a ro mode right away at that moment.
      Reported-by: NOliver Winker <oliver@oli1170.net>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      Reviewed-by: NNamjae Jeon <namjae.jeon@samsung.com>
      577e3495
  2. 22 1月, 2013 1 次提交
  3. 15 1月, 2013 1 次提交
  4. 14 1月, 2013 1 次提交
  5. 11 1月, 2013 1 次提交
    • J
      f2fs: add f2fs_balance_fs in several interfaces · 7d82db83
      Jaegeuk Kim 提交于
      The f2fs_balance_fs() is to check the number of free sections and decide whether
      it needs to conduct cleaning or not. If there are not enough free sections, the
      cleaning job should be started.
      
      In order to control an amount of free sections even under high utilization, f2fs
      should call f2fs_balance_fs at all the VFS interfaces that are able to produce
      dirty pages.
      This patch adds the function calls in the missing interfaces as follows.
      
      1. f2fs_setxattr()
      The f2fs_setxattr() produces dirty node pages so that we should call
      f2fs_balance_fs() either likewise doing in other VFS interfaces such as
      f2fs_lookup(), f2fs_mkdir(), and so on.
      
      2. f2fs_sync_file()
      We should guarantee serving free sections for syncing metadata during fsync.
      Previously, there is no space check before triggering checkpoint and
      sync_node_pages.
      Therefore, if a bunch of fsync calls are triggered under 100% of FS utilization,
      f2fs is able to be faced with no free sections, resulting in BUG_ON().
      
      3. f2fs_sync_fs()
      Before calling write_checkpoint(), we should guarantee that there are minimum
      free sections.
      
      4. f2fs_write_inode()
      f2fs_write_inode() is also able to produce dirty node pages.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      7d82db83
  6. 04 1月, 2013 1 次提交
  7. 28 12月, 2012 2 次提交
  8. 26 12月, 2012 2 次提交
    • J
      f2fs: should recover orphan and fsync data · 30f0c758
      Jaegeuk Kim 提交于
      The recovery routine should do all the time regardless of normal umount action.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      30f0c758
    • J
      f2fs: fix wrong calculation on f_files in statfs · 1362b5e3
      Jaegeuk Kim 提交于
      In f2fs_statfs(), f_files should be the total number of available inodes
      instead of the currently allocated inodes.
      So, this patch should resolve the reported bug below.
      
      Note that, showing 10% usage is not a bug, since f2fs reveals whole volume size
      as much as possible and shows the space overhead as *used*.
      This policy is fair enough with respect to other file systems.
      
      <Reported Bug>
      (loop0 is backed by 1GiB file)
      
      $ mkfs.f2fs /dev/loop0
      
      F2FS-tools: Ver: 1.1.0 (2012-12-11)
      Info: sector size = 512
      Info: total sectors = 2097152 (in 512bytes)
      Info: zone aligned segment0 blkaddr: 512
      Info: format successful
      
      $ mount /dev/loop0 mnt/
      
      $ df mnt/
      Filesystem     1K-blocks  Used Available Use% Mounted on
      /dev/loop0       1046528 98312    929784  10%
      /home/zeta/linux-devel/mtd-bench/mnt
      
      $ df mnt/ -i
      Filesystem     Inodes   IUsed  IFree IUse% Mounted on
      /dev/loop0       1 -465918 465919     - /home/zeta/linux-devel/mtd-bench/mnt
      
      Notice IUsed is negative. Also, 10% usage on a fresh f2fs seems too
      much to be correct.
      Reported-and-Tested-by: NEzequiel Garcia <elezegarcia@gmail.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      1362b5e3
  9. 11 12月, 2012 5 次提交