1. 04 11月, 2014 8 次提交
    • J
      f2fs: add stat info for inline_dentry inodes · 3289c061
      Jaegeuk Kim 提交于
      This patch adds status information for inline_dentry inodes.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      3289c061
    • J
      f2fs: avoid deadlock on init_inode_metadata · bce8d112
      Jaegeuk Kim 提交于
      Previously, init_inode_metadata does not hold any parent directory's inode
      page. So, f2fs_init_acl can grab its parent inode page without any problem.
      But, when we use inline_dentry, that page is grabbed during f2fs_add_link,
      so that we can fall into deadlock condition like below.
      
      INFO: task mknod:11006 blocked for more than 120 seconds.
            Tainted: G           OE  3.17.0-rc1+ #13
      "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      mknod           D ffff88003fc94580     0 11006  11004 0x00000000
       ffff880007717b10 0000000000000002 ffff88003c323220 ffff880007717fd8
       0000000000014580 0000000000014580 ffff88003daecb30 ffff88003c323220
       ffff88003fc94e80 ffff88003ffbb4e8 ffff880007717ba0 0000000000000002
      Call Trace:
       [<ffffffff8173dc40>] ? bit_wait+0x50/0x50
       [<ffffffff8173d4cd>] io_schedule+0x9d/0x130
       [<ffffffff8173dc6c>] bit_wait_io+0x2c/0x50
       [<ffffffff8173da3b>] __wait_on_bit_lock+0x4b/0xb0
       [<ffffffff811640a7>] __lock_page+0x67/0x70
       [<ffffffff810acf50>] ? autoremove_wake_function+0x40/0x40
       [<ffffffff811652cc>] pagecache_get_page+0x14c/0x1e0
       [<ffffffffa029afa9>] get_node_page+0x59/0x130 [f2fs]
       [<ffffffffa02a63ad>] read_all_xattrs+0x24d/0x430 [f2fs]
       [<ffffffffa02a6ca2>] f2fs_getxattr+0x52/0xe0 [f2fs]
       [<ffffffffa02a7481>] f2fs_get_acl+0x41/0x2d0 [f2fs]
       [<ffffffff8122d847>] get_acl+0x47/0x70
       [<ffffffff8122db5a>] posix_acl_create+0x5a/0x150
       [<ffffffffa02a7759>] f2fs_init_acl+0x29/0xcb [f2fs]
       [<ffffffffa0286a8d>] init_inode_metadata+0x5d/0x340 [f2fs]
       [<ffffffffa029253a>] f2fs_add_inline_entry+0x12a/0x2e0 [f2fs]
       [<ffffffffa0286ea5>] __f2fs_add_link+0x45/0x4a0 [f2fs]
       [<ffffffffa028b5b6>] ? f2fs_new_inode+0x146/0x220 [f2fs]
       [<ffffffffa028b816>] f2fs_mknod+0x86/0xf0 [f2fs]
       [<ffffffff811e3ec1>] vfs_mknod+0xe1/0x160
       [<ffffffff811e4b26>] SyS_mknod+0x1f6/0x200
       [<ffffffff81741d7f>] tracesys+0xe1/0xe6
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      bce8d112
    • J
      f2fs: fix to wait correct block type · 59a06155
      Jaegeuk Kim 提交于
      The inode page needs to wait NODE block io.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      59a06155
    • J
      f2fs: reuse find_in_block code for find_in_inline_dir · 4e6ebf6d
      Jaegeuk Kim 提交于
      This patch removes redundant copied code in find_in_inline_dir.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      4e6ebf6d
    • J
      f2fs: reuse room_for_filename for inline dentry operation · a82afa20
      Jaegeuk Kim 提交于
      This patch introduces to reuse the existing room_for_filename for inline dentry
      operation.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      a82afa20
    • C
      f2fs: enable inline dir handling · 622f28ae
      Chao Yu 提交于
      Add inline dir functions into normal dir ops' function to handle inline ops.
      Besides, we enable inline dir mode when a new dir inode is created if
      inline_data option is on.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      622f28ae
    • C
      f2fs: add key function to handle inline dir · 201a05be
      Chao Yu 提交于
      Adds Functions to implement inline dir init/lookup/insert/delete/convert ops.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      [Jaegeuk Kim: remove needless reserved area copy, pointed by Dan Carpenter]
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      201a05be
    • J
      f2fs: should truncate any allocated block for inline_data write · c08a690b
      Jaegeuk Kim 提交于
      When trying to write inline_data, we should truncate any data block allocated
      and pointed by the inode block.
      We should consider the data index is not 0.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      c08a690b
  2. 07 10月, 2014 1 次提交
    • J
      f2fs: support atomic writes · 88b88a66
      Jaegeuk Kim 提交于
      This patch introduces a very limited functionality for atomic write support.
      In order to support atomic write, this patch adds two ioctls:
       o F2FS_IOC_START_ATOMIC_WRITE
       o F2FS_IOC_COMMIT_ATOMIC_WRITE
      
      The database engine should be aware of the following sequence.
      1. open
       -> ioctl(F2FS_IOC_START_ATOMIC_WRITE);
      2. writes
        : all the written data will be treated as atomic pages.
      3. commit
       -> ioctl(F2FS_IOC_COMMIT_ATOMIC_WRITE);
        : this flushes all the data blocks to the disk, which will be shown all or
        nothing by f2fs recovery procedure.
      4. repeat to #2.
      
      The IO pattens should be:
      
        ,- START_ATOMIC_WRITE                  ,- COMMIT_ATOMIC_WRITE
       CP | D D D D D D | FSYNC | D D D D | FSYNC ...
                            `- COMMIT_ATOMIC_WRITE
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      88b88a66
  3. 10 9月, 2014 1 次提交
  4. 04 9月, 2014 1 次提交
  5. 22 8月, 2014 2 次提交
  6. 20 8月, 2014 2 次提交
  7. 29 7月, 2014 1 次提交
  8. 07 5月, 2014 4 次提交
  9. 02 4月, 2014 1 次提交
  10. 14 1月, 2014 1 次提交
  11. 06 1月, 2014 6 次提交
    • C
      f2fs: avoid to read inline data except first page · 04a17fb1
      Chao Yu 提交于
      Here is a case which could read inline page data not from first page.
      
      1. write inline data
      2. lseek to offset 4096
      3. read 4096 bytes from offset 4096
      	(read_inline_data read inline data page to non-first page,
      	And previously VFS has add this page to page cache)
      4. ftruncate offset 8192
      5. read 4096 bytes from offset 4096
      	(we meet this updated page with inline data in cache)
      
      So we should leave this page with inited data and uptodate flag
      for this case.
      
      Change log from v1:
       o fix a deadlock bug
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      04a17fb1
    • C
      f2fs: avoid to left uninitialized data in page when read inline data · 18309aaa
      Chao Yu 提交于
      Change log from v1:
       o reduce unneeded memset in __f2fs_convert_inline_data
      
      >From 58796be2bd2becbe8d52305210fb2a64e7dd80b6 Mon Sep 17 00:00:00 2001
      From: Chao Yu <chao2.yu@samsung.com>
      Date: Mon, 30 Dec 2013 09:21:33 +0800
      Subject: [PATCH] f2fs: avoid to left uninitialized data in page when read
       inline data
      
      We left uninitialized data in the tail of page when we read an inline data
      page. So let's initialize left part of the page excluding inline data region.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      18309aaa
    • J
      f2fs: handle errors correctly during f2fs_reserve_block · a8865372
      Jaegeuk Kim 提交于
      The get_dnode_of_data nullifies inode and node page when error is occurred.
      
      There are two cases that passes inode page into get_dnode_of_data().
      
      1. make_empty_dir()
          -> get_new_data_page()
            -> f2fs_reserve_block(ipage)
      	-> get_dnode_of_data()
      
      2. f2fs_convert_inline_data()
          -> __f2fs_convert_inline_data()
            -> f2fs_reserve_block(ipage)
      	-> get_dnode_of_data()
      
      This patch adds correct error handling codes when get_dnode_of_data() returns
      an error.
      
      At first, f2fs_reserve_block() calls f2fs_put_dnode() whenever reserve_new_block
      returns an error.
      So, the rule of f2fs_reserve_block() is to nullify inode page when there is any
      error internally.
      
      Finally, two callers of f2fs_reserve_block() should call f2fs_put_dnode()
      appropriately if they got an error since successful f2fs_reserve_block().
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      a8865372
    • J
      f2fs: add inline_data recovery routine · 1e1bb4ba
      Jaegeuk Kim 提交于
      This patch adds a inline_data recovery routine with the following policy.
      
      [prev.] [next] of inline_data flag
         o       o  -> recover inline_data
         o       x  -> remove inline_data, and then recover data blocks
         x       o  -> remove inline_data, and then recover inline_data
         x       x  -> recover data blocks
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      1e1bb4ba
    • J
      f2fs: add the number of inline_data files to status info · 0dbdc2ae
      Jaegeuk Kim 提交于
      This patch adds the number of inline_data files into the status information.
      Note that the number is reset whenever the filesystem is newly mounted.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      0dbdc2ae
    • J
      f2fs: refactor f2fs_convert_inline_data · 9e09fc85
      Jaegeuk Kim 提交于
      Change log from v1:
       o handle NULL pointer of grab_cache_page_write_begin() pointed by Chao Yu.
      
      This patch refactors f2fs_convert_inline_data to check a couple of conditions
      internally for deciding whether it needs to convert inline_data or not.
      
      So, the new f2fs_convert_inline_data initially checks:
      1) f2fs_has_inline_data(), and
      2) the data size to be changed.
      
      If the inode has inline_data but the size to fill is less than MAX_INLINE_DATA,
      then we don't need to convert the inline_data with data allocation.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      9e09fc85
  12. 26 12月, 2013 1 次提交