1. 14 Jun, 2013 1 commit
    • Dave Chinner's avatar
      xfs: don't emit v5 superblock warnings on write · 47ad2fcb
      Dave Chinner authored
      
      
      We write the superblock every 30s or so which results in the
      verifier being called. Right now that results in this output
      every 30s:
      
      XFS (vda): Version 5 superblock detected. This kernel has EXPERIMENTAL support enabled!
      Use of these features in this kernel is at your own risk!
      
      And spamming the logs.
      
      We don't need to check for whether we support v5 superblocks or
      whether there are feature bits we don't support set as these are
      only relevant when we first mount the filesytem. i.e. on superblock
      read. Hence for the write verification we can just skip all the
      checks (and hence verbose output) altogether.
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      
      (cherry picked from commit 34510185)
      47ad2fcb
  2. 27 Apr, 2013 2 commits
    • Dave Chinner's avatar
      xfs: implement extended feature masks · e721f504
      Dave Chinner authored
      
      
      The version 5 superblock has extended feature masks for compatible,
      incompatible and read-only compatible feature sets. Implement the
      masking and mount-time checking for these feature masks.
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBen Myers <bpm@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      e721f504
    • Dave Chinner's avatar
      xfs: add CRC checks to the superblock · 04a1e6c5
      Dave Chinner authored
      
      
      With the addition of CRCs, there is such a wide and varied change to
      the on disk format that it makes sense to bump the superblock
      version number rather than try to use feature bits for all the new
      functionality.
      
      This commit introduces all the new superblock fields needed for all
      the new functionality: feature masks similar to ext4, separate
      project quota inodes, a LSN field for recovery and the CRC field.
      
      This commit does not bump the superblock version number, however.
      That will be done as a separate commit at the end of the series
      after all the new functionality is present so we switch it all on in
      one commit. This means that we can slowly introduce the changes
      without them being active and hence maintain bisectability of the
      tree.
      
      This patch is based on a patch originally written by myself back
      from SGI days, which was subsequently modified by Christoph Hellwig.
      There is relatively little of that patch remaining, but the history
      of the patch still should be acknowledged here.
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBen Myers <bpm@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      04a1e6c5
  3. 01 Feb, 2013 3 commits
  4. 28 Jan, 2013 1 commit
  5. 16 Jan, 2013 1 commit
  6. 16 Nov, 2012 6 commits
    • Dave Chinner's avatar
      xfs: convert buffer verifiers to an ops structure. · 1813dd64
      Dave Chinner authored
      
      
      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: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarPhil White <pwhite@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      1813dd64
    • Dave Chinner's avatar
      xfs: connect up write verifiers to new buffers · b0f539de
      Dave Chinner authored
      
      
      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: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBen Myers <bpm@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      b0f539de
    • Dave Chinner's avatar
      xfs: add pre-write metadata buffer verifier callbacks · 612cfbfe
      Dave Chinner authored
      
      
      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: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarMark Tinguely <tinguely@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      612cfbfe
    • Dave Chinner's avatar
      xfs: verify superblocks as they are read from disk · 98021821
      Dave Chinner authored
      
      
      Add a superblock verify callback function and pass it into the
      buffer read functions. Remove the now redundant verification code
      that is currently in use.
      
      Adding verification shows that secondary superblocks never have
      their "sb_inprogress" flag cleared by mkfs.xfs, so when validating
      the secondary superblocks during a grow operation we have to avoid
      checking this field. Even if we fix mkfs, we will still have to
      ignore this field for verification purposes unless a version of mkfs
      that does not have this bug was used.
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarPhil White <pwhite@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      98021821
    • Dave Chinner's avatar
      xfs: uncached buffer reads need to return an error · eab4e633
      Dave Chinner authored
      
      
      With verification being done as an IO completion callback, different
      errors can be returned from a read. Uncached reads only return a
      buffer or NULL on failure, which means the verification error cannot
      be returned to the caller.
      
      Split the error handling for these reads into two - a failure to get
      a buffer will still return NULL, but a read error will return a
      referenced buffer with b_error set rather than NULL. The caller is
      responsible for checking the error state of the buffer returned.
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarPhil White <pwhite@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      eab4e633
    • Dave Chinner's avatar
      xfs: make buffer read verication an IO completion function · c3f8fc73
      Dave Chinner authored
      
      
      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: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarPhil White <pwhite@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      c3f8fc73
  7. 08 Nov, 2012 1 commit
  8. 17 Oct, 2012 3 commits
  9. 26 Sep, 2012 1 commit
  10. 31 Jul, 2012 1 commit
    • Jan Kara's avatar
      xfs: Convert to new freezing code · d9457dc0
      Jan Kara authored
      
      
      Generic code now blocks all writers from standard write paths. So we add
      blocking of all writers coming from ioctl (we get a protection of ioctl against
      racing remount read-only as a bonus) and convert xfs_file_aio_write() to a
      non-racy freeze protection. We also keep freeze protection on transaction
      start to block internal filesystem writes such as removal of preallocated
      blocks.
      
      CC: Ben Myers <bpm@sgi.com>
      CC: Alex Elder <elder@kernel.org>
      CC: xfs@oss.sgi.com
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      d9457dc0
  11. 29 Jul, 2012 1 commit
    • Mark Tinguely's avatar
      xfs: wait for the write the superblock on unmount · 9a57fa8e
      Mark Tinguely authored
      
      
      v2: Add the xfs_buf_lock to xfs_quiesce_attr().
          Add explaination why xfs_buf_lock() is used to wait for write.
      
      xfs_wait_buftarg() does not wait for the completion of the write of the
      uncached superblock. This write can race with the shutdown of the log
      and causes a panic if the write does not win the race.
      
      During the log write, xfsaild_push() will lock the buffer and set the
      XBF_ASYNC flag. Because the XBF_FLAG is set, complete() is not performed
      on the buffer's iowait entry, we cannot call xfs_buf_iowait() to wait
      for the write to complete. The buffer's lock is held until the write is
      complete, so we can block on a xfs_buf_lock() request to be notified
      that the write is complete.
      Signed-off-by: default avatarMark Tinguely <tinguely@sgi.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      9a57fa8e
  12. 14 Jun, 2012 1 commit
  13. 14 May, 2012 4 commits
    • Dave Chinner's avatar
      xfs: flush outstanding buffers on log mount failure · d4f3512b
      Dave Chinner authored
      
      
      When we fail to mount the log in xfs_mountfs(), we tear down all the
      infrastructure we have already allocated. However, the process of
      mounting the log may have progressed to the point of reading,
      caching and modifying buffers in memory. Hence before we can free
      all the infrastructure, we have to flush and remove all the buffers
      from memory.
      
      Problem first reported by Eric Sandeen, later a different incarnation
      was reported by Ben Myers.
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarMark Tinguely <tinguely@sgi.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      d4f3512b
    • Dave Chinner's avatar
      xfs: move xfs_get_extsz_hint() and kill xfs_rw.h · 2a0ec1d9
      Dave Chinner authored
      
      
      The only thing left in xfs_rw.h is a function prototype for an inode
      function.  Move that to xfs_inode.h, and kill xfs_rw.h.
      
      Also move the function implementing the prototype from xfs_rw.c to
      xfs_inode.c so we only have one function left in xfs_rw.c
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarMark Tinguely <tinguely@sgi.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      2a0ec1d9
    • Dave Chinner's avatar
      xfs: clean up buffer get/read call API · e70b73f8
      Dave Chinner authored
      
      
      The xfs_buf_get/read API is not consistent in the units it uses, and
      does not use appropriate or consistent units/types for the
      variables.
      
      Convert the API to use disk addresses and block counts for all
      buffer get and read calls. Use consistent naming for all the
      functions and their declarations, and convert the internal functions
      to use disk addresses and block counts to avoid need to convert them
      from one type to another and back again.
      
      Fix all the callers to use disk addresses and block counts. In many
      cases, this removes an additional conversion from the function call
      as the callers already have a block count.
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarMark Tinguely <tinguely@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      e70b73f8
    • Christoph Hellwig's avatar
      xfs: implement freezing by emptying the AIL · 211e4d43
      Christoph Hellwig authored
      
      
      Now that we write back all metadata either synchronously or through
      the AIL we can simply implement metadata freezing in terms of
      emptying the AIL.
      
      The implementation for this is fairly simply and straight-forward:
      A new routine is added that asks the xfsaild to push the AIL to the
      end and waits for it to complete and send a wakeup. The routine will
      then loop if the AIL is not actually empty, and continue to do so
      until the AIL is compeltely empty.
      
      We keep an inode reclaim pass in the freeze process to avoid having
      memory pressure have to reclaim inodes that require dirtying the
      filesystem to be reclaimed after the freeze has completed. This
      means we can also treat unmount in the exact same way as freeze.
      
      As an upside we can now remove the radix tree based inode writeback
      and xfs_unmountfs_writesb.
      
      [ Dave Chinner:
      	- Cleaned up commit message.
      	- Added inode reclaim passes back into freeze.
      	- Cleaned up wakeup mechanism to avoid the use of a new
      	  sleep counter variable. ]
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarMark Tinguely <tinguely@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      211e4d43
  14. 03 Feb, 2012 1 commit
  15. 31 Jan, 2012 1 commit
  16. 12 Oct, 2011 4 commits
  17. 26 Jul, 2011 1 commit
  18. 25 Jul, 2011 2 commits
  19. 20 Jul, 2011 1 commit
  20. 13 Jul, 2011 1 commit
  21. 11 Jul, 2011 1 commit
  22. 08 Jul, 2011 2 commits