1. 10 Feb, 2008 2 commits
    • Jan Kara's avatar
      ext4: Fix Direct I/O locking · 7fb5409d
      Jan Kara authored
      We cannot start transaction in ext4_direct_IO() and just let it last
      during the whole write because dio_get_page() acquires mmap_sem which
      ranks above transaction start (e.g. because we have dependency chain
      mmap_sem->PageLock->journal_start, or because we update atime while
      holding mmap_sem) and thus deadlocks could happen. We solve the problem
      by starting a transaction separately for each ext4_get_block() call.
      
      We *could* have a problem that we allocate a block and before its data
      are written out the machine crashes and thus we expose stale data. But
      that does not happen because for hole-filling generic code falls back to
      buffered writes and for file extension, we add inode to orphan list and
      thus in case of crash, journal replay will truncate inode back to the
      original size.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarMingming Cao <cmm@us.ibm.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      7fb5409d
    • Aneesh Kumar K.V's avatar
      ext4: Fix circular locking dependency with migrate and rm. · 8009f9fb
      Aneesh Kumar K.V authored
      In order to prevent a circular locking dependency when an unlink
      operation is racing with an ext4 migration, we delay taking i_data_sem
      until just before switch the inode format, and use i_mutex to prevent
      writes and truncates during the first part of the migration operation.
      Acked-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: default avatarMingming Cao <cmm@us.ibm.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      8009f9fb
  2. 06 Feb, 2008 1 commit
    • Eric Sandeen's avatar
      allow in-inode EAs on ext4 root inode · 0040d987
      Eric Sandeen authored
      The ext3 root inode was treated specially with respect
      to in-inode extended attributes, for reasons detailed
      in the removed comment below.  The first mkfs-created
      inodes would not get extra_i_size or the EXT3_STATE_XATTR
      flag set in ext3_read_inode, which disallowed reading or
      setting in-inode EAs on the root.
      
      However, in ext4, ext4_mark_inode_dirty calls
      ext4_expand_extra_isize for all inodes; once this is done
      EAs may be placed in the root ext4 inode body.
      
      But for reasons above, it won't be found after a reboot.
      
      testcase:
      
      setfattr -n user.name -v value mntpt/
      setfattr -n user.name2 -v value2 mntpt/
      umount mntpt/; remount mntpt/
      getfattr -d mntpt/
      
      name2/value2 has gone missing; debugfs shows it in the
      inode body, but it is not found there by getattr.
      
      The following fixes it up; newer mkfs appears to properly
      zero the inodes, so this workaround isn't needed for ext4.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      0040d987
  3. 10 Feb, 2008 1 commit
  4. 05 Feb, 2008 3 commits
  5. 01 Feb, 2008 1 commit
  6. 05 Feb, 2008 1 commit
    • Mingming Cao's avatar
      jbd2: Add error check to journal_wait_on_commit_record to avoid oops · b048d846
      Mingming Cao authored
      The buffer head pointer passed to journal_wait_on_commit_record() could
      be NULL if the previous journal_submit_commit_record() failed or journal
      has already aborted.
      
      Looking at the jbd2 debug messages, before the oops happened, the jbd2
      is aborted due to trying to access the next log block beyond the end
      of device. This might be caused by using a corrupted image.
      
      We need to check the error returns from journal_submit_commit_record()
      and avoid calling journal_wait_on_commit_record() in the failure case.
      
      This addresses Kernel Bugzilla #9849
      Signed-off-by: default avatarMingming Cao <cmm@us.ibm.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      b048d846
  7. 09 Feb, 2008 31 commits