1. 12 12月, 2009 8 次提交
    • C
      xfs: remove IO_ISAIO · c355c656
      Christoph Hellwig 提交于
      We set the IO_ISAIO flag for all read/write I/O since early Linux
      2.6.x.  Remove it as it has lost it's purpose long ago.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NDave Chinner <david@fromorbit.com>
      Reviewed-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      c355c656
    • A
      xfs: Wrapped journal record corruption on read at recovery · fc5bc4c8
      Andy Poling 提交于
      Summary of problem:
      
      If a journal record wraps at the physical end of the journal, it has to be
      read in two parts in xlog_do_recovery_pass(): a read at the physical end and a
      read at the physical beginning.  If xlog_bread() has to re-align the first
      read, the second read request does not take that re-alignment into account.
      If the first read was re-aligned, the second read over-writes the end of the
      data from the first read, effectively corrupting it.  This can happen either
      when reading the record header or reading the record data.
      
      The first sanity check in xlog_recover_process_data() is to check for a valid
      clientid, so that is the error reported.
      
      Summary of fix:
      
      If there was a first read at the physical end, XFS_BUF_PTR() returns where the
      data was requested to begin.  Conversely, because it is the result of
      xlog_align(), offset indicates where the requested data for the first read
      actually begins - whether or not xlog_bread() has re-aligned it.
      
      Using offset as the base for the calculation of where to place the second read
      data ensures that it will be correctly placed immediately following the data
      from the first read instead of sometimes over-writing the end of it.
      
      The attached patch has resolved the reported problem of occasional inability
      to recover the journal (reporting "bad clientid").
      Signed-off-by: NAndy Poling <andy@realbig.com>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      fc5bc4c8
    • C
      xfs: cleanup data end I/O handlers · 5ec4fabb
      Christoph Hellwig 提交于
      Currently we have different end I/O handlers for read vs the different
      types of write I/O.  But they are all very similar so we could just
      use one with a few conditionals and reduce code size a lot.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      5ec4fabb
    • C
      xfs: use WRITE_SYNC_PLUG for synchronous writeout · 06342cf8
      Christoph Hellwig 提交于
      The VM and I/O schedulers now expect us to use WRITE_SYNC_PLUG for
      synchronous writeout.  Right now I can't see any changes in performance
      numbers with this, but we're getting some beating for not using it,
      and the knowledge definitely could help the block code to make better
      decisions.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      06342cf8
    • C
      xfs: reset the i_iolock lock class in the reclaim path · 033da48f
      Christoph Hellwig 提交于
      The iolock is used for protecting reads, writes and block truncates
      against each other.  We have two classes of callers, the first one is
      induced by a file operation and requires a reference to the inode be
      held and not dropped after the operation is done:
      
       - xfs_vm_vmap, xfs_vn_fallocate, xfs_read, xfs_write, xfs_splice_read,
         xfs_splice_write and xfs_setattr are all implementations of VFS
         methods that require a live inode
       - xfs_getbmap and xfs_swap_extents are ioctl subcommand for which the
         same is true
       - xfs_truncate_file is only called on quota inodes just returned from
         xfs_iget
       - xfs_sync_inode_data does the lock just after an igrab()
       - xfs_filestream_associate and xfs_filestream_new_ag take the iolock
         on the parent inode of an inode which by VFS rules must be referenced
      
      And we have various calls to truncate blocks past EOF or the whole
      file when dropping the last reference to an inode.  Unfortunately
      lockdep complains when we do memory allocations that can recurse into
      the filesystem in the first class because the second class happens to
      take the same lock.  To avoid this re-init the iolock in the beginning
      of xfs_fs_clear_inode to get a new lock class.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      033da48f
    • C
      xfs: I/O completion handlers must use NOFS allocations · 80641dc6
      Christoph Hellwig 提交于
      When completing I/O requests we must not allow the memory allocator to
      recurse into the filesystem, as we might deadlock on waiting for the
      I/O completion otherwise.  The only thing currently allocating normal
      GFP_KERNEL memory is the allocation of the transaction structure for
      the unwritten extent conversion.  Add a memflags argument to
      _xfs_trans_alloc to allow controlling the allocator behaviour.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reported-by: NThomas Neumann <tneumann@users.sourceforge.net>
      Tested-by: NThomas Neumann <tneumann@users.sourceforge.net>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      80641dc6
    • C
      xfs: fix mmap_sem/iolock inversion in xfs_free_eofblocks · c56c9631
      Christoph Hellwig 提交于
      When xfs_free_eofblocks is called from ->release the VM might already
      hold the mmap_sem, but in the write path we take the iolock before
      taking the mmap_sem in the generic write code.
      
      Switch xfs_free_eofblocks to only trylock the iolock if called from
      ->release and skip trimming the prellocated blocks in that case.
      We'll still free them later on the final iput.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      c56c9631
    • 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. 18 11月, 2009 2 次提交
    • N
      xfs: copy li_lsn before dropping AIL lock · 6c06f072
      Nathaniel W. Turner 提交于
      Access to log items on the AIL is generally protected by m_ail_lock;
      this is particularly needed when we're getting or setting the 64-bit
      li_lsn on a 32-bit platform.  This patch fixes a couple places where we
      were accessing the log item after dropping the AIL lock on 32-bit
      machines.
      
      This can result in a partially-zeroed log->l_tail_lsn if
      xfs_trans_ail_delete is racing with xfs_trans_ail_update, and in at
      least some cases, this can leave the l_tail_lsn with a zero cycle
      number, which means xlog_space_left will think the log is full (unless
      CONFIG_XFS_DEBUG is set, in which case we'll trip an ASSERT), leading to
      processes stuck forever in xlog_grant_log_space.
      
      Thanks to Adrian VanderSpek for first spotting the race potential and to
      Dave Chinner for debug assistance.
      Signed-off-by: NNathaniel W. Turner <nate@houseofnate.net>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      6c06f072
    • J
      XFS bug in log recover with quota (bugzilla id 855) · 8ec6dba2
      Jan Rekorajski 提交于
      Hi,
      I was hit by a bug in linux 2.6.31 when XFS is not able to recover the
      log after a crash if fs was mounted with quotas. Gory details in XFS
      bugzilla: http://oss.sgi.com/bugzilla/show_bug.cgi?id=855.
      
      It looks like wrong struct is used in buffer length check, and the following
      patch should fix the problem.
      
      xfs_dqblk_t has a size of 104+32 bytes, while xfs_disk_dquot_t is 104 bytes
      long, and this is exactly what I see in system logs - "XFS: dquot too small
      (104) in xlog_recover_do_dquot_trans."
      Signed-off-by: NJan Rekorajski <baggins@sith.mimuw.edu.pl>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      8ec6dba2
  3. 30 10月, 2009 2 次提交
    • R
      xfs: fix xfs_quota remove error · c7ff91d7
      Ryota Yamauchi 提交于
      The xfs_quota returns ENOSYS when remove command is executed.
      Reproducable with following steps.
      
          # mount -t xfs -o uquota /dev/sda7 /mnt/mp1
          # xfs_quota -x -c off -c remove
          XFS_QUOTARM: Function not implemented.
      
      The remove command is allowed during quotaoff, but xfs_fs_set_xstate()
      checks whether quota is running, and it leads to ENOSYS.
      
      To solve this problem, add a check for X_QUOTARM.
      Signed-off-by: NRyota Yamauchi <r-yamauchi@vf.jp.nec.com>
      Signed-off-by: NUtako Kusaka <u-kusaka@wm.jp.nec.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      c7ff91d7
    • E
      xfs: free temporary cursor in xfs_dialloc · 3b826386
      Eric Sandeen 提交于
      Commit bd169565 seems
      to have a slight regression where this code path:
      
          if (!--searchdistance) {
              /*
               * Not in range - save last search
               * location and allocate a new inode
               */
              ...
              goto newino;
          }
      
      doesn't free the temporary cursor (tcur) that got dup'd in
      this function.
      
      This leaks an item in the xfs_btree_cur zone, and it's caught
      on module unload:
      
      ===========================================================
      BUG xfs_btree_cur: Objects remaining on kmem_cache_close()
      -----------------------------------------------------------
      
      It seems like maybe a single free at the end of the function might
      be cleaner, but for now put a del_cursor right in this code block
      similar to the handling in the rest of the function.
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      3b826386
  4. 14 10月, 2009 1 次提交
  5. 09 10月, 2009 7 次提交
  6. 28 9月, 2009 1 次提交
  7. 24 9月, 2009 1 次提交
  8. 22 9月, 2009 2 次提交
  9. 21 9月, 2009 1 次提交
  10. 16 9月, 2009 3 次提交
  11. 14 9月, 2009 1 次提交
  12. 10 9月, 2009 1 次提交
  13. 09 9月, 2009 1 次提交
  14. 03 9月, 2009 1 次提交
    • A
      xfs: xfs_showargs() reports group *and* project quotas enabled · 988abe40
      Alex Elder 提交于
      If you enable group or project quotas on an XFS file system, then the
      mount table presented through /proc/self/mounts erroneously shows
      that both options are in effect for the file system.  The root of
      the problem is some bad logic in the xfs_showargs() function, which
      is used to format the file system type-specific options in effect
      for a file system.
      
      The problem originated in this GIT commit:
          Move platform specific mount option parse out of core XFS code
          Date: 11/22/07
          Author: Dave Chinner
          SHA1 ID: a67d7c5f
      
      For XFS quotas, project and group quota management are mutually
      exclusive--only one can be in effect at a time.  There are two
      parts to managing quotas:  aggregating usage information; and
      enforcing limits.  It is possible to have a quota in effect
      (aggregating usage) but not enforced.
      
      These features are recorded on an XFS mount point using these flags:
          XFS_PQUOTA_ACCT - Project quotas are aggregated
          XFS_GQUOTA_ACCT - Group quotas are aggregated
          XFS_OQUOTA_ENFD - Project/group quotas are enforced
      
      The code in error is in fs/xfs/linux-2.6/xfs_super.c:
      
              if (mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_OQUOTA_ENFD))
                      seq_puts(m, "," MNTOPT_PRJQUOTA);
              else if (mp->m_qflags & XFS_PQUOTA_ACCT)
                      seq_puts(m, "," MNTOPT_PQUOTANOENF);
      
              if (mp->m_qflags & (XFS_GQUOTA_ACCT|XFS_OQUOTA_ENFD))
                      seq_puts(m, "," MNTOPT_GRPQUOTA);
              else if (mp->m_qflags & XFS_GQUOTA_ACCT)
                      seq_puts(m, "," MNTOPT_GQUOTANOENF);
      
      The problem is that XFS_OQUOTA_ENFD will be set in mp->m_qflags
      if either group or project quotas are enforced, and as a result
      both MNTOPT_PRJQUOTA and MNTOPT_GRPQUOTA will be shown as mount
      options.
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NFelix Blyakher <felixb@sgi.com>
      988abe40
  15. 02 9月, 2009 8 次提交