1. 12 12月, 2009 1 次提交
    • C
      xfs: simplify inode teardown · 848ce8f7
      Christoph Hellwig 提交于
      Currently the reclaim code for the case where we don't reclaim the
      final reclaim is overly complicated.  We know that the inode is clean
      but instead of just directly reclaiming the clean inode we go through
      the whole process of marking the inode reclaimable just to directly
      reclaim it from the calling context.  Besides being overly complicated
      this introduces a race where iget could recycle an inode between
      marked reclaimable and actually being reclaimed leading to panics.
      
      This patch gets rid of the existing reclaim path, and replaces it with
      a simple call to xfs_ireclaim if the inode was clean.  While we're at
      it we also use the slightly more lax xfs_inode_clean check we'd use
      later to determine if we need to flush the inode here.
      
      Finally get rid of xfs_reclaim function and place the remaining small
      bits of reclaim code directly into xfs_fs_destroy_inode.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reported-by: NPatrick Schreurs <patrick@news-service.com>
      Reported-by: NTommy van Leeuwen <tommy@news-service.com>
      Tested-by: NPatrick Schreurs <patrick@news-service.com>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      848ce8f7
  2. 09 10月, 2009 1 次提交
    • C
      xfs: implement ->dirty_inode to fix timestamp handling · f9581b14
      Christoph Hellwig 提交于
      This is picking up on Felix's repost of Dave's patch to implement a
      .dirty_inode method.  We really need this notification because
      the VFS keeps writing directly into the inode structure instead
      of going through methods to update this state.  In addition to
      the long-known atime issue we now also have a caller in VM code
      that updates c/mtime that way for shared writeable mmaps.  And
      I found another one that no one has noticed in practice in the FIFO
      code.
      
      So implement ->dirty_inode to set i_update_core whenever the
      inode gets externally dirtied, and switch the c/mtime handling to
      the same scheme we already use for atime (always picking up
      the value from the Linux inode).
      
      Note that this patch also removes the xfs_synchronize_atime call
      in xfs_reclaim it was superflous as we already synchronize the time
      when writing the inode via the log (xfs_inode_item_format) or the
      normal buffers (xfs_iflush_int).
      
      In addition also remove the I_CLEAR check before copying the Linux
      timestamps - now that we always have the Linux inode available
      we can always use the timestamps in it.
      
      Also switch to just using file_update_time for regular reads/writes -
      that will get us all optimization done to it for free and make
      sure we notice early when it breaks.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NFelix Blyakher <felixb@sgi.com>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      f9581b14
  3. 10 9月, 2009 1 次提交
  4. 02 9月, 2009 1 次提交
    • C
      xfs: merge fsync and O_SYNC handling · 13e6d5cd
      Christoph Hellwig 提交于
      The guarantees for O_SYNC are exactly the same as the ones we need to
      make for an fsync call (and given that Linux O_SYNC is O_DSYNC the
      equivalent is fdadatasync, but we treat both the same in XFS), except
      with a range data writeout.  Jan Kara has started unifying these two
      path for filesystems using the generic helpers, and I've started to
      look at XFS.
      
      The actual transaction commited by xfs_fsync and xfs_write_sync_logforce
      has a different transaction number, but actually is exactly the same.
      We'll only use the fsync transaction going forward.  One major difference
      is that xfs_write_sync_logforce never issues a cache flush unless we
      commit a transaction causing that as a side-effect, which is an obvious
      bug in the O_SYNC handling.  Second all the locking and i_update_size
      vs i_update_core changes from 978b7237
      never made it to xfs_write_sync_logforce, so we add them back.
      
      To make xfs_fsync easily usable from the O_SYNC path, the filemap_fdatawait
      call is moved up to xfs_file_fsync, so that we don't wait on the whole
      file after we already waited for our portion in xfs_write.
      
      We'll also use a plain call to filemap_write_and_wait_range instead
      of the previous sync_page_rang which did it in two steps including
      an half-hearted inode write out that doesn't help us.
      
      Once we're done with this also remove the now useless i_update_size
      tracking.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NFelix Blyakher <felixb@sgi.com>
      Signed-off-by: NFelix Blyakher <felixb@sgi.com>
      13e6d5cd
  5. 01 9月, 2009 1 次提交
  6. 12 8月, 2009 1 次提交
  7. 11 8月, 2009 1 次提交
  8. 02 7月, 2009 1 次提交
  9. 10 6月, 2009 1 次提交
  10. 08 6月, 2009 1 次提交
    • C
      xfs: kill xfs_qmops · 7d095257
      Christoph Hellwig 提交于
      Kill the quota ops function vector and replace it with direct calls or
      stubs in the CONFIG_XFS_QUOTA=n case.
      
      Make sure we check XFS_IS_QUOTA_RUNNING in the right spots.  We can remove
      the number of those checks because the XFS_TRANS_DQ_DIRTY flag can't be set
      otherwise.
      
      This brings us back closer to the way this code worked in IRIX and earlier
      Linux versions, but we keep a lot of the more useful factoring of common
      code.
      
      Eventually we should also kill xfs_qm_bhv.c, but that's left for a later
      patch.
      
      Reduces the size of the source code by about 250 lines and the size of
      XFS module by about 1.5 kilobytes with quotas enabled:
      
         text	   data	    bss	    dec	    hex	filename
       615957	   2960	   3848	 622765	  980ad	fs/xfs/xfs.o
       617231	   3152	   3848	 624231	  98667	fs/xfs/xfs.o.old
      
      Fallout:
      
       - xfs_qm_dqattach is split into xfs_qm_dqattach_locked which expects
         the inode locked and xfs_qm_dqattach which does the locking around it,
         thus removing XFS_QMOPT_ILOCKED.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NEric Sandeen <sandeen@sandeen.net>
      7d095257
  11. 07 4月, 2009 1 次提交
  12. 29 3月, 2009 1 次提交
  13. 16 3月, 2009 1 次提交
  14. 09 2月, 2009 1 次提交
  15. 04 2月, 2009 2 次提交
  16. 19 1月, 2009 1 次提交
  17. 16 1月, 2009 1 次提交
  18. 11 12月, 2008 1 次提交
  19. 05 12月, 2008 1 次提交
  20. 04 12月, 2008 1 次提交
  21. 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
  22. 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
  23. 30 10月, 2008 9 次提交
  24. 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
  25. 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
  26. 13 8月, 2008 3 次提交