1. 30 10月, 2008 7 次提交
  2. 23 10月, 2008 2 次提交
  3. 21 10月, 2008 1 次提交
  4. 16 10月, 2008 1 次提交
  5. 14 10月, 2008 1 次提交
  6. 11 10月, 2008 1 次提交
  7. 26 9月, 2008 2 次提交
    • L
      [XFS] Remove xfs_iext_irec_compact_full() · 71a8c87f
      Lachlan McIlroy 提交于
      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: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      71a8c87f
    • L
      [XFS] Fix extent list corruption in xfs_iext_irec_compact_full(). · f1ccd295
      Lachlan McIlroy 提交于
      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: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NRussell Cattelan <cattelan@thebarn.com>
      f1ccd295
  8. 17 9月, 2008 7 次提交
    • L
      [XFS] Don't do I/O beyond eof when unreserving space · 2fd6f6ec
      Lachlan McIlroy 提交于
      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: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      2fd6f6ec
    • L
      [XFS] Fix use-after-free with buffers · e1f5dbd7
      Lachlan McIlroy 提交于
      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: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      e1f5dbd7
    • D
      [XFS] Prevent lockdep false positives when locking two inodes. · f9114eba
      David Chinner 提交于
      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: NDavid Chinner <david@fromorbit.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NPeter Leckie <pleckie@sgi.com>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      f9114eba
    • D
      [XFS] Fix barrier status change detection. · b5b8c9ac
      David Chinner 提交于
      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: NDavid Chinner <david@fromorbit.com>
      Signed-off-by: NNathaniel W. Turner <nate@houseofnate.net>
      Signed-off-by: NPeter Leckie <pleckie@sgi.com>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      b5b8c9ac
    • L
      [XFS] Prevent direct I/O from mapping extents beyond eof · 364f358a
      Lachlan McIlroy 提交于
      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: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      364f358a
    • C
      [XFS] Fix regression introduced by remount fixup · 6efdf281
      Christoph Hellwig 提交于
      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: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      6efdf281
    • L
      [XFS] Move memory allocations for log tracing out of the critical path · 31bd61f2
      Lachlan McIlroy 提交于
      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: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      31bd61f2
  9. 25 8月, 2008 2 次提交
  10. 24 8月, 2008 1 次提交
  11. 14 8月, 2008 1 次提交
    • D
      CRED: Introduce credential access wrappers · 9e2b2dc4
      David Howells 提交于
      The patches that are intended to introduce copy-on-write credentials for 2.6.28
      require abstraction of access to some fields of the task structure,
      particularly for the case of one task accessing another's credentials where RCU
      will have to be observed.
      
      Introduced here are trivial no-op versions of the desired accessors for current
      and other tasks so that other subsystems can start to be converted over more
      easily.
      
      Wrappers are introduced into a new header (linux/cred.h) for UID/GID,
      EUID/EGID, SUID/SGID, FSUID/FSGID, cap_effective and current's subscribed
      user_struct.  These wrappers are macros because the ordering between header
      files mitigates against making them inline functions.
      
      linux/cred.h is #included from linux/sched.h.
      
      Further, XFS is modified such that it no longer defines and uses parameterised
      versions of current_fs[ug]id(), thus getting rid of the namespace collision
      otherwise incurred.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      9e2b2dc4
  12. 13 8月, 2008 14 次提交