1. 27 6月, 2013 1 次提交
  2. 28 4月, 2013 1 次提交
    • D
      xfs: buffer type overruns blf_flags field · 61fe135c
      Dave Chinner 提交于
      The buffer type passed to log recvoery in the buffer log item
      overruns the blf_flags field. I had assumed that flags field was a
      32 bit value, and it turns out it is a unisgned short. Therefore
      having 19 flags doesn't really work.
      
      Convert the buffer type field to numeric value, and use the top 5
      bits of the flags field for it. We currently have 17 types of
      buffers, so using 5 bits gives us plenty of room for expansion in
      future....
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NBen Myers <bpm@sgi.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      61fe135c
  3. 22 4月, 2013 2 次提交
  4. 08 3月, 2013 1 次提交
  5. 04 1月, 2013 1 次提交
  6. 27 11月, 2012 1 次提交
  7. 16 11月, 2012 5 次提交
    • D
      xfs: convert buffer verifiers to an ops structure. · 1813dd64
      Dave Chinner 提交于
      To separate the verifiers from iodone functions and associate read
      and write verifiers at the same time, introduce a buffer verifier
      operations structure to the xfs_buf.
      
      This avoids the need for assigning the write verifier, clearing the
      iodone function and re-running ioend processing in the read
      verifier, and gets rid of the nasty "b_pre_io" name for the write
      verifier function pointer. If we ever need to, it will also be
      easier to add further content specific callbacks to a buffer with an
      ops structure in place.
      
      We also avoid needing to export verifier functions, instead we
      can simply export the ops structures for those that are needed
      outside the function they are defined in.
      
      This patch also fixes a directory block readahead verifier issue
      it exposed.
      
      This patch also adds ops callbacks to the inode/alloc btree blocks
      initialised by growfs. These will need more work before they will
      work with CRCs.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NPhil White <pwhite@sgi.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      1813dd64
    • D
      xfs: connect up write verifiers to new buffers · b0f539de
      Dave Chinner 提交于
      Metadata buffers that are read from disk have write verifiers
      already attached to them, but newly allocated buffers do not. Add
      appropriate write verifiers to all new metadata buffers.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NBen Myers <bpm@sgi.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      b0f539de
    • D
      xfs: add pre-write metadata buffer verifier callbacks · 612cfbfe
      Dave Chinner 提交于
      These verifiers are essentially the same code as the read verifiers,
      but do not require ioend processing. Hence factor the read verifier
      functions and add a new write verifier wrapper that is used as the
      callback.
      
      This is done as one large patch for all verifiers rather than one
      patch per verifier as the change is largely mechanical. This
      includes hooking up the write verifier via the read verifier
      function.
      
      Hooking up the write verifier for buffers obtained via
      xfs_trans_get_buf() will be done in a separate patch as that touches
      code in many different places rather than just the verifier
      functions.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NMark Tinguely <tinguely@sgi.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      612cfbfe
    • D
      xfs: verify AGI blocks as they are read from disk · 3702ce6e
      Dave Chinner 提交于
      Add an AGI block verify callback function and pass it into the
      buffer read functions. Remove the now redundant verification code
      that is currently in use.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      3702ce6e
    • D
      xfs: make buffer read verication an IO completion function · c3f8fc73
      Dave Chinner 提交于
      Add a verifier function callback capability to the buffer read
      interfaces.  This will be used by the callers to supply a function
      that verifies the contents of the buffer when it is read from disk.
      This patch does not provide callback functions, but simply modifies
      the interfaces to allow them to be called.
      
      The reason for adding this to the read interfaces is that it is very
      difficult to tell fom the outside is a buffer was just read from
      disk or whether we just pulled it out of cache. Supplying a callbck
      allows the buffer cache to use it's internal knowledge of the buffer
      to execute it only when the buffer is read from disk.
      
      It is intended that the verifier functions will mark the buffer with
      an EFSCORRUPTED error when verification fails. This allows the
      reading context to distinguish a verification error from an IO
      error, and potentially take further actions on the buffer (e.g.
      attempt repair) based on the error reported.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NPhil White <pwhite@sgi.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      c3f8fc73
  8. 09 11月, 2012 1 次提交
  9. 03 11月, 2012 1 次提交
    • C
      xfs: Update inode alloc comments · cd856db6
      Carlos Maiolino 提交于
      I found some out of date comments while studying the inode allocation
      code, so I believe it's worth to have these comments updated.
      
      It basically rewrites the comment regarding to "call_again" variable,
      which is not used anymore, but instead, callers of xfs_ialloc() decides
      if it needs to be called again relying only if ialloc_context is NULL or
      not.
      
      Also did some small changes in another comment that I thought to be
      pertinent to the current behaviour of these functions and some alignment
      on both comments.
      Signed-off-by: NCarlos Maiolino <cmaiolino@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      cd856db6
  10. 19 10月, 2012 1 次提交
  11. 27 9月, 2012 1 次提交
    • C
      xfs: Fix m_agirotor reset during AG selection · 8aea3ff4
      Carlos Maiolino 提交于
      xfs_ialloc_next_ag() currently resets m_agirotor when it is equal to
      m_maxagi:
      
               if (++mp->m_agirotor == mp->m_maxagi)
      	         mp->m_agirotor = 0;
      
      But, if for some reason mp->m_maxagi changes to a lower value than
      current m_agirotor, this condition will never be true, causing
      m_agirotor to exceed the maximum allowed value (m_maxagi).
      
      This implies mainly during lookups for xfs_perag structs in its radix
      tree, since the agno value used for the lookup is based on m_agirotor.
      An out-of-range m_agirotor may cause a lookup failure which in case will
      return NULL.
      
      As an example, the value of m_maxagi is decreased during
      inode64->inode32 remount process, case where I've found this problem.
      Signed-off-by: NCarlos Maiolino <cmaiolino@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NMark Tinguely <tinguely@sgi.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      8aea3ff4
  12. 24 8月, 2012 1 次提交
  13. 17 8月, 2012 1 次提交
  14. 30 7月, 2012 5 次提交
  15. 23 7月, 2012 1 次提交
  16. 15 5月, 2012 2 次提交
  17. 04 1月, 2012 1 次提交
  18. 12 10月, 2011 2 次提交
  19. 26 7月, 2011 1 次提交
  20. 08 7月, 2011 1 次提交
  21. 07 3月, 2011 2 次提交
  22. 19 10月, 2010 1 次提交
  23. 24 8月, 2010 1 次提交
    • D
      xfs: fix untrusted inode number lookup · 4536f2ad
      Dave Chinner 提交于
      Commit 7124fe0a ("xfs: validate untrusted inode
      numbers during lookup") changes the inode lookup code to do btree lookups for
      untrusted inode numbers. This change made an invalid assumption about the
      alignment of inodes and hence incorrectly calculated the first inode in the
      cluster. As a result, some inode numbers were being incorrectly considered
      invalid when they were actually valid.
      
      The issue was not picked up by the xfstests suite because it always runs fsr
      and dump (the two utilities that utilise the bulkstat interface) on cache hot
      inodes and hence the lookup code in the cold cache path was not sufficiently
      exercised to uncover this intermittent problem.
      
      Fix the issue by relaxing the btree lookup criteria and then checking if the
      record returned contains the inode number we are lookup for. If it we get an
      incorrect record, then the inode number is invalid.
      
      Cc: <stable@kernel.org>
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      4536f2ad
  24. 27 7月, 2010 2 次提交
  25. 24 6月, 2010 3 次提交
    • D
      xfs: remove block number from inode lookup code · 7b6259e7
      Dave Chinner 提交于
      The block number comes from bulkstat based inode lookups to shortcut
      the mapping calculations. We ar enot able to trust anything from
      bulkstat, so drop the block number as well so that the correct
      lookups and mappings are always done.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      7b6259e7
    • D
      xfs: rename XFS_IGET_BULKSTAT to XFS_IGET_UNTRUSTED · 1920779e
      Dave Chinner 提交于
      Inode numbers may come from somewhere external to the filesystem
      (e.g. file handles, bulkstat information) and so are inherently
      untrusted. Rename the flag we use for these lookups to make it
      obvious we are doing a lookup of an untrusted inode number and need
      to verify it completely before trying to read it from disk.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      1920779e
    • D
      xfs: validate untrusted inode numbers during lookup · 7124fe0a
      Dave Chinner 提交于
      When we decode a handle or do a bulkstat lookup, we are using an
      inode number we cannot trust to be valid. If we are deleting inode
      chunks from disk (default noikeep mode), then we cannot trust the on
      disk inode buffer for any given inode number to correctly reflect
      whether the inode has been unlinked as the di_mode nor the
      generation number may have been updated on disk.
      
      This is due to the fact that when we delete an inode chunk, we do
      not write the clusters back to disk when they are removed - instead
      we mark them stale to avoid them being written back potentially over
      the top of something that has been subsequently allocated at that
      location. The result is that we can have locations of disk that look
      like they contain valid inodes but in reality do not. Hence we
      cannot simply convert the inode number to a block number and read
      the location from disk to determine if the inode is valid or not.
      
      As a result, and XFS_IGET_BULKSTAT lookup needs to actually look the
      inode up in the inode allocation btree to determine if the inode
      number is valid or not.
      
      It should be noted even on ikeep filesystems, there is the
      possibility that blocks on disk may look like valid inode clusters.
      e.g. if there are filesystem images hosted on the filesystem. Hence
      even for ikeep filesystems we really need to validate that the inode
      number is valid before issuing the inode buffer read.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      7124fe0a