1. 23 Oct, 2008 2 commits
  2. 21 Oct, 2008 1 commit
  3. 15 Oct, 2008 1 commit
  4. 13 Oct, 2008 1 commit
  5. 10 Oct, 2008 1 commit
  6. 26 Sep, 2008 2 commits
    • Lachlan McIlroy's avatar
      [XFS] Remove xfs_iext_irec_compact_full() · 71a8c87f
      Lachlan McIlroy authored
      Yet another bug was found in xfs_iext_irec_compact_full() and while the
      source of the bug was found it wasn't an easy task to track it down
      because the conditions are very difficult to reproduce.
      
      A HUGE thank-you goes to Russell Cattelan and Eric Sandeen for their
      significant effort in tracking down the source of this corruption.
      
      xfs_iext_irec_compact_full() and xfs_iext_irec_compact_pages() are almost
      identical - they both compact indirect extent lists by moving extents from
      subsequent buffers into earlier ones. xfs_iext_irec_compact_pages() only
      moves extents if all of the extents in the next buffer will fit into the
      empty space in the buffer before it. xfs_iext_irec_compact_full() will go
      a step further and move part of the next buffer if all the extents wont
      fit. It will then shift the remaining extents in the next buffer up to the
      start of the buffer. The bug here was that we did not update er_extoff and
      this caused extent list corruption.
      
      It does not appear that this extra functionality gains us much. Calling
      xfs_iext_irec_compact_pages() instead will do a good enough job at
      compacting the indirect list and will be quicker too.
      
      For the case in xfs_iext_indirect_to_direct() the total number of extents
      in the indirect list will fit into one buffer so we will never need the
      extra functionality of xfs_iext_irec_compact_full() there.
      
      Also xfs_iext_irec_compact_pages() doesn't need to do a memmove() (the
      buffers will never overlap) so we don't want the performance hit that can
      incur.
      
      SGI-PV: 987159
      
      SGI-Modid: xfs-linux-melb:xfs-kern:32166a
      Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: default avatarEric Sandeen <sandeen@sandeen.net>
      71a8c87f
    • Lachlan McIlroy's avatar
      [XFS] Fix extent list corruption in xfs_iext_irec_compact_full(). · f1ccd295
      Lachlan McIlroy authored
      If we don't move all the records from the next buffer into the current
      buffer then we need to update the er_extoff field of the next buffer as we
      shift the remaining records to the start of the buffer.
      
      SGI-PV: 987159
      
      SGI-Modid: xfs-linux-melb:xfs-kern:32165a
      Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: default avatarEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: default avatarRussell Cattelan <cattelan@thebarn.com>
      f1ccd295
  7. 17 Sep, 2008 7 commits
    • Lachlan McIlroy's avatar
      [XFS] Don't do I/O beyond eof when unreserving space · 2fd6f6ec
      Lachlan McIlroy authored
      When unreserving space with boundaries that are not block aligned we round
      up the start and round down the end boundaries and then use this function,
      xfs_zero_remaining_bytes(), to zero the parts of the blocks that got
      dropped during the rounding. The problem is we don't consider if these
      blocks are beyond eof. Worse still is if we encounter delayed allocations
      beyond eof we will try to use the magic delayed allocation block number as
      a real block number. If the file size is ever extended to expose these
      blocks then we'll go through xfs_zero_eof() to zero them anyway.
      
      SGI-PV: 983683
      
      SGI-Modid: xfs-linux-melb:xfs-kern:32055a
      Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
      2fd6f6ec
    • Lachlan McIlroy's avatar
      [XFS] Fix use-after-free with buffers · e1f5dbd7
      Lachlan McIlroy authored
      We have a use-after-free issue where log completions access buffers via
      the buffer log item and the buffer has already been freed. Fix this by
      taking a reference on the buffer when attaching the buffer log item and
      release the hold when the buffer log item is detached and we no longer
      need the buffer. Also create a new function xfs_buf_item_free() to combine
      some common code.
      
      SGI-PV: 985757
      
      SGI-Modid: xfs-linux-melb:xfs-kern:32025a
      Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
      e1f5dbd7
    • David Chinner's avatar
      [XFS] Prevent lockdep false positives when locking two inodes. · f9114eba
      David Chinner authored
      If we call xfs_lock_two_inodes() to grab both the iolock and the ilock,
      then drop the ilocks on both inodes, then grab them again (as
      xfs_swap_extents() does) then lockdep will report a locking order problem.
      This is a false positive.
      
      To avoid this, disallow xfs_lock_two_inodes() fom locking both inode locks
      at once - force calers to make two separate calls. This means that nested
      dropping and regaining of the ilocks will retain the same lockdep subclass
      and so lockdep will not see anything wrong with this code.
      
      SGI-PV: 986238
      
      SGI-Modid: xfs-linux-melb:xfs-kern:31999a
      Signed-off-by: default avatarDavid Chinner <david@fromorbit.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
      Signed-off-by: default avatarPeter Leckie <pleckie@sgi.com>
      Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
      f9114eba
    • David Chinner's avatar
      [XFS] Fix barrier status change detection. · b5b8c9ac
      David Chinner authored
      The current code in xlog_iodone() uses the wrong macro to check if the
      barrier has been cleared due to an EOPNOTSUPP error form the lower layer.
      
      SGI-PV: 986143
      
      SGI-Modid: xfs-linux-melb:xfs-kern:31984a
      Signed-off-by: default avatarDavid Chinner <david@fromorbit.com>
      Signed-off-by: default avatarNathaniel W. Turner <nate@houseofnate.net>
      Signed-off-by: default avatarPeter Leckie <pleckie@sgi.com>
      Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
      b5b8c9ac
    • Lachlan McIlroy's avatar
      [XFS] Prevent direct I/O from mapping extents beyond eof · 364f358a
      Lachlan McIlroy authored
      With the help from some tracing I found that we try to map extents beyond
      eof when doing a direct I/O read. It appears that the way to inform the
      generic direct I/O path (ie do_direct_IO()) that we have breached eof is
      to return an unmapped buffer from xfs_get_blocks_direct(). This will cause
      do_direct_IO() to jump to the hole handling code where is will check for
      eof and then abort.
      
      This problem was found because a direct I/O read was trying to map beyond
      eof and was encountering delayed allocations. The delayed allocations
      beyond eof are speculative allocations and they didn't get converted when
      the direct I/O flushed the file because there was only enough space in the
      current AG to convert and write out the dirty pages within eof. Note that
      xfs_iomap_write_allocate() wont necessarily convert all the delayed
      allocation passed to it - it will return after allocating the first extent
      - so if the delayed allocation extends beyond eof then it will stay that
      way.
      
      SGI-PV: 983683
      
      SGI-Modid: xfs-linux-melb:xfs-kern:31929a
      Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
      364f358a
    • Christoph Hellwig's avatar
      [XFS] Fix regression introduced by remount fixup · 6efdf281
      Christoph Hellwig authored
      Logically we would return an error in xfs_fs_remount code to prevent users
      from believing they might have changed mount options using remount which
      can't be changed.
      
      But unfortunately mount(8) adds all options from mtab and fstab to the
      mount arguments in some cases so we can't blindly reject options, but have
      to check for each specified option if it actually differs from the
      currently set option and only reject it if that's the case.
      
      Until that is implemented we return success for every remount request, and
      silently ignore all options that we can't actually change.
      
      SGI-PV: 985710
      
      SGI-Modid: xfs-linux-melb:xfs-kern:31908a
      Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
      Signed-off-by: default avatarTim Shimmin <tes@sgi.com>
      Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
      6efdf281
    • Lachlan McIlroy's avatar
      [XFS] Move memory allocations for log tracing out of the critical path · 31bd61f2
      Lachlan McIlroy authored
      Memory allocations for log->l_grant_trace and iclog->ic_trace are done on
      demand when the first event is logged. In xlog_state_get_iclog_space() we
      call xlog_trace_iclog() under a spinlock and allocating memory here can
      cause us to sleep with a spinlock held and deadlock the system.
      
      For the log grant tracing we use KM_NOSLEEP but that means we can lose
      trace entries. Since there is no locking to serialize the log grant
      tracing we could race and have multiple allocations and leak memory.
      
      So move the allocations to where we initialize the log/iclog structures.
      Use KM_NOFS to avoid recursing into the filesystem and drop log->l_trace
      since it's not even used.
      
      SGI-PV: 983738
      
      SGI-Modid: xfs-linux-melb:xfs-kern:31896a
      Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
      31bd61f2
  8. 25 Aug, 2008 2 commits
  9. 23 Aug, 2008 1 commit
  10. 13 Aug, 2008 22 commits