1. 25 5月, 2011 4 次提交
  2. 24 5月, 2011 4 次提交
    • J
      jbd2: Add function jbd2_trans_will_send_data_barrier() · bbd2be36
      Jan Kara 提交于
      Provide a function which returns whether a transaction with given tid
      will send a flush to the filesystem device.  The function will be used
      by ext4 to detect whether fsync needs to send a separate flush or not.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      bbd2be36
    • J
      jbd2: fix sending of data flush on journal commit · 81be12c8
      Jan Kara 提交于
      
      In data=ordered mode, it's theoretically possible (however rare) that
      an inode is filed to transaction's t_inode_list and a flusher thread
      writes all the data and inode is reclaimed before the transaction
      starts to commit.  In such a case, we could erroneously omit sending a
      flush to file system device when it is different from the journal
      device (because data can still be in disk cache only).
      
      Fix the problem by setting a flag in a transaction when some inode is added
      to it and then send disk flush in the commit code when the flag is set.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      81be12c8
    • Y
      ext4: fix ext4_ext_fiemap_cb() to handle blocks before request range correctly · b221349f
      Yongqiang Yang 提交于
      To get delayed-extent information, ext4_ext_fiemap_cb() looks up
      pagecache, it thus collects information starting from a page's
      head block.
      
      If blocksize < pagesize, the beginning blocks of a page may lies
      before the request range. So ext4_ext_fiemap_cb() should proceed
      ignoring them, because they has been handled before. If no mapped
      buffer in the range is found in the 1st page, we need to look up
      the 2nd page, otherwise delayed-extents after a hole will be ignored.
      
      Without this patch, xfstests 225 will hung on ext4 with 1K block.
      Reported-by: NAmir Goldstein <amir73il@users.sourceforge.net>
      Signed-off-by: NYongqiang Yang <xiaoqiangnk@gmail.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      b221349f
    • T
      ext4: use truncate_setsize() unconditionally · 072bd7ea
      Theodore Ts'o 提交于
      In commit c8d46e41 (ext4: Add flag to files with blocks intentionally
      past EOF), if the EOFBLOCKS_FL flag is set, we call ext4_truncate()
      before calling vmtruncate().  This caused any allocated but unwritten
      blocks created by calling fallocate() with the FALLOC_FL_KEEP_SIZE
      flag to be dropped.  This was done to make to make sure that
      EOFBLOCKS_FL would not be cleared while still leaving blocks past
      i_size allocated.  This was not necessary, since ext4_truncate()
      guarantees that blocks past i_size will be dropped, even in the case
      where truncate() has increased i_size before calling ext4_truncate().
      
      So fix this by removing the EOFBLOCKS_FL special case treatment in
      ext4_setattr().  In addition, use truncate_setsize() followed by a
      call to ext4_truncate() instead of using vmtruncate().  This is more
      efficient since it skips the call to inode_newsize_ok(), which has
      been checked already by inode_change_ok().  This is also in a win in
      the case where EOFBLOCKS_FL is set since it avoids calling
      ext4_truncate() twice.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      072bd7ea
  3. 23 5月, 2011 5 次提交
  4. 21 5月, 2011 4 次提交
  5. 19 5月, 2011 3 次提交
  6. 16 5月, 2011 2 次提交
  7. 15 5月, 2011 1 次提交
  8. 10 5月, 2011 4 次提交
  9. 09 5月, 2011 8 次提交
  10. 04 5月, 2011 2 次提交
  11. 03 5月, 2011 3 次提交
    • Y
      ext4: add a function merging extents right and left · 197217a5
      Yongqiang Yang 提交于
      1) Rename ext4_ext_try_to_merge() to ext4_ext_try_to_merge_right().
      
      2) Add a new function ext4_ext_try_to_merge() which tries to merge
         an extent both left and right.
      
      3) Use the new function in ext4_ext_convert_unwritten_endio() and
         ext4_ext_insert_extent().
      Signed-off-by: NYongqiang Yang <xiaoqiangnk@gmail.com>
      Tested-by: NAllison Henderson <achender@linux.vnet.ibm.com>
      197217a5
    • J
      ext4: fix deadlock in ext4_symlink() in ENOSPC conditions · df5e6223
      Jan Kara 提交于
      ext4_symlink() cannot call __page_symlink() with transaction open.
      __page_symlink() calls ext4_write_begin() which can wait for
      transaction commit if we are running out of space thus causing a
      deadlock. Also error recovery in ext4_truncate_failed_write() does not
      count with the transaction being already started (although I'm not
      aware of any particular deadlock here).
      
      Fix the problem by stopping a transaction before calling
      __page_symlink() (we have to be careful and put inode to orphan list
      so that it gets deleted in case of crash) and starting another one
      after __page_symlink() returns for addition of symlink into a
      directory.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      df5e6223
    • J
      ext4: Fix fs corruption when make_indexed_dir() fails · 7ad8e4e6
      Jan Kara 提交于
      When make_indexed_dir() fails (e.g. because of ENOSPC) after it has
      allocated block for index tree root, we did not properly mark all
      changed buffers dirty.  This lead to only some of these buffers being
      written out and thus effectively corrupting the directory.
      
      Fix the issue by marking all changed data dirty even in the error
      failure case.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      7ad8e4e6