1. 26 Dec, 2013 5 commits
    • Gu Zheng's avatar
      f2fs: convert max_orphans to a field of f2fs_sb_info · 0d47c1ad
      Gu Zheng authored
      Previously, we need to calculate the max orphan num when we try to acquire an
      orphan inode, but it's a stable value since the super block was inited. So
      converting it to a field of f2fs_sb_info and use it directly when needed seems
      a better choose.
      Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      0d47c1ad
    • Jaegeuk Kim's avatar
      f2fs: check the blocksize before calling generic_direct_IO path · 944fcfc1
      Jaegeuk Kim authored
      The f2fs supports 4KB block size. If user requests dwrite with under 4KB data,
      it allocates a new 4KB data block.
      However, f2fs doesn't add zero data into the untouched data area inside the
      newly allocated data block.
      
      This incurs an error during the xfstest #263 test as follow.
      
      263 12s ... [failed, exit status 1] - output mismatch (see 263.out.bad)
      	--- 263.out	2013-03-09 03:37:15.043967603 +0900
      	+++ 263.out.bad	2013-12-27 04:20:39.230203114 +0900
      	@@ -1,3 +1,976 @@
      	QA output created by 263
      	fsx -N 10000 -o 8192 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z
      	-fsx -N 10000 -o 128000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z
      	+fsx -N 10000 -o 8192 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z
      	+truncating to largest ever: 0x12a00
      	+truncating to largest ever: 0x75400
      	+fallocating to largest ever: 0x79cbf
      	...
      	(Run 'diff -u 263.out 263.out.bad' to see the entire diff)
      	Ran: 263
      	Failures: 263
      	Failed 1 of 1 tests
      
      It turns out that, when the test tries to write 2KB data with dio, the new dio
      path allocates 4KB data block without filling zero data inside the remained 2KB
      area. Finally, the output file contains a garbage data for that region.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      944fcfc1
    • Jaegeuk Kim's avatar
      f2fs: should put the dnode when NEW_ADDR is detected · 1ec79083
      Jaegeuk Kim authored
      When get_dnode_of_data() in get_data_block() returns a successful dnode, we
      should put the dnode.
      But, previously, if its data block address is equal to NEW_ADDR, we didn't do
      that, resulting in a deadlock condition.
      So, this patch splits original error conditions with this case, and then calls
      f2fs_put_dnode before finishing the function.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      1ec79083
    • Jaegeuk Kim's avatar
      f2fs: introduce F2FS_INODE macro to get f2fs_inode · 58bfaf44
      Jaegeuk Kim authored
      This patch introduces F2FS_INODE that returns struct f2fs_inode * from the inode
      page.
      By using this macro, we can remove unnecessary casting codes like below.
      
         struct f2fs_inode *ri = &F2FS_NODE(inode_page)->i;
      -> struct f2fs_inode *ri = F2FS_INODE(inode_page);
      Reviewed-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      58bfaf44
    • Chao Yu's avatar
      f2fs: check filename length in recover_dentry · d96b1431
      Chao Yu authored
      In current flow, we will get Null return value of f2fs_find_entry in
      recover_dentry when name.len is bigger than F2FS_NAME_LEN, and then we
      still add this inode into its dir entry.
      To avoid this situation, we must check filename length before we use it.
      
      Another point is that we could remove the code of checking filename length
      In f2fs_find_entry, because f2fs_lookup will be called previously to ensure of
      validity of filename length.
      
      V2:
       o add WARN_ON() as Jaegeuk Kim suggested.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      d96b1431
  2. 23 Dec, 2013 35 commits