1. 01 12月, 2008 3 次提交
    • D
      [XFS] remove i_gen from incore inode · 26c52951
      Dave Chinner 提交于
      i_gen is incremented in directory operations when the
      directory is changed. It is never read or otherwise used
      so it should be removed to help reduce the size of the
      struct xfs_inode.
      
      The patch also removes a duplicate logging of the directory
      inode core. We only need to do this once per transaction
      so kill the one associated with the i_gen increment.
      Signed-off-by: NDave Chinner <david@fromorbit.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNiv Sardi <xaiki@sgi.com>
      26c52951
    • D
      [XFS] fix error inversion problems with data flushing · 2e656092
      Dave Chinner 提交于
      XFS gets the sign of the error wrong in several places when
      gathering the error from generic linux functions. These functions
      return negative error values, while the core XFS code returns
      positive error values. Hence when XFS inverts the error to be
      returned to the VFS, it can incorrectly invert a negative
      error and this error will be ignored by the syscall return.
      
      Fix all the problems related to calling filemap_* functions.
      
      Problem initially identified by Nick Piggin in xfs_fsync().
      Signed-off-by: NDave Chinner <david@fromorbit.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNiv Sardi <xaiki@sgi.com>
      2e656092
    • C
      [XFS] wire up ->open for directories · f999a5bf
      Christoph Hellwig 提交于
      Currently there's no ->open method set for directories on XFS.  That
      means we don't perform any check for opening too large directories
      without O_LARGEFILE, we don't check for shut down filesystems, and we
      don't actually do the readahead for the first block in the directory.
      
      Instead of just setting the directories open routine to xfs_file_open
      we merge the shutdown check directly into xfs_file_open and create
      a new xfs_dir_open that first calls xfs_file_open and then performs
      the readahead for block 0.
      
      (First sent on September 29th)
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NDave Chinner <david@fromorbit.com>
      Signed-off-by: NNiv Sardi <xaiki@sgi.com>
      f999a5bf
  2. 17 11月, 2008 1 次提交
    • D
      [XFS] Fix double free of log tickets · cc09c0dc
      Dave Chinner 提交于
      When an I/O error occurs during an intermediate commit on a rolling
      transaction, xfs_trans_commit() will free the transaction structure
      and the related ticket. However, the duplicate transaction that
      gets used as the transaction continues still contains a pointer
      to the ticket. Hence when the duplicate transaction is cancelled
      and freed, we free the ticket a second time.
      
      Add reference counting to the ticket so that we hold an extra
      reference to the ticket over the transaction commit. We drop the
      extra reference once we have checked that the transaction commit
      did not return an error, thus avoiding a double free on commit
      error.
      
      Credit to Nick Piggin for tripping over the problem.
      
      SGI-PV: 989741
      Signed-off-by: NDave Chinner <david@fromorbit.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      cc09c0dc
  3. 30 10月, 2008 9 次提交
  4. 17 9月, 2008 2 次提交
    • 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
    • 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
  5. 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
  6. 13 8月, 2008 7 次提交
  7. 28 7月, 2008 7 次提交
  8. 23 5月, 2008 1 次提交
    • D
      [XFS] Fix fsync() b0rkage. · 978b7237
      David Chinner 提交于
      xfs_fsync() fails to wait for data I/O completion before checking if the
      inode is dirty or clean to decide whether to log the inode or not. This
      misses inode size updates when the data flushed by the fsync() is
      extending the file.
      
      Hence, like fdatasync(), we need to wait for I/o completion first, then
      check the inode for cleanliness. Doing so makes the behaviour of
      xfs_fsync() identical for fsync and fdatasync and we *always* use
      synchronous semantics if the inode is dirty. Therefore also kill the
      differences and remove the unused flags from the xfs_fsync function and
      callers.
      
      SGI-PV: 981296
      SGI-Modid: xfs-linux-melb:xfs-kern:31033a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      978b7237
  9. 29 4月, 2008 8 次提交
  10. 18 4月, 2008 1 次提交