1. 08 Jun, 2009 1 commit
  2. 01 Jun, 2009 1 commit
  3. 26 May, 2009 1 commit
    • Eric Sandeen's avatar
      xfs: fix overflow in xfs_growfs_data_private · 09632487
      Eric Sandeen authored
      In the case where growing a filesystem would leave the last AG
      too small, the fixup code has an overflow in the calculation
      of the new size with one fewer ag, because "nagcount" is a 32
      bit number.  If the new filesystem has > 2^32 blocks in it
      this causes a problem resulting in an EINVAL return from growfs:
      
       # xfs_io -f -c "truncate 19998630180864" fsfile
       # mkfs.xfs -f -bsize=4096 -dagsize=76288719b,size=3905982455b fsfile
       # mount -o loop fsfile /mnt
       # xfs_growfs /mnt
      
      meta-data=/dev/loop0             isize=256    agcount=52,
      agsize=76288719 blks
               =                       sectsz=512   attr=2
      data     =                       bsize=4096   blocks=3905982455, imaxpct=5
               =                       sunit=0      swidth=0 blks
      naming   =version 2              bsize=4096   ascii-ci=0
      log      =internal               bsize=4096   blocks=32768, version=2
               =                       sectsz=512   sunit=0 blks, lazy-count=0
      realtime =none                   extsz=4096   blocks=0, rtextents=0
      xfs_growfs: XFS_IOC_FSGROWFSDATA xfsctl failed: Invalid argument
      
      Reported-by: richard.ems@cape-horn-eng.com
      Signed-off-by: default avatarEric Sandeen <sandeen@sandeen.net>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarFelix Blyakher <felixb@sgi.com>
      Signed-off-by: default avatarFelix Blyakher <felixb@sgi.com>
      09632487
  4. 08 May, 2009 1 commit
  5. 29 Apr, 2009 4 commits
  6. 06 Apr, 2009 9 commits
    • Dave Chinner's avatar
      xfs: remove xfs_flush_space · 8de2bf93
      Dave Chinner authored
      The only thing we need to do now when we get an ENOSPC condition during delayed
      allocation reservation is flush all the other inodes with delalloc blocks on
      them and retry without EOF preallocation. Remove the unneeded mess that is
      xfs_flush_space() and just call xfs_flush_inodes() directly from
      xfs_iomap_write_delay().
      
      Also, change the location of the retry label to avoid trying to do EOF
      preallocation because we don't want to do that at ENOSPC. This enables us to
      remove the BMAPI_SYNC flag as it is no longer used.
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      8de2bf93
    • Dave Chinner's avatar
      xfs: flush delayed allcoation blocks on ENOSPC in create · 153fec43
      Dave Chinner authored
      If we are creating lots of small files, we can fail to get
      a reservation for inode create earlier than we should due to
      EOF preallocation done during delayed allocation reservation.
      Hence on the first reservation ENOSPC failure flush all the
      delayed allocation blocks out of the system and retry.
      
      This fixes the last commonly triggered spurious ENOSPC issue
      that has been reported.
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      153fec43
    • Dave Chinner's avatar
      xfs: block callers of xfs_flush_inodes() correctly · e43afd72
      Dave Chinner authored
      xfs_flush_inodes() currently uses a magic timeout to wait for
      some inodes to be flushed before returning. This isn't
      really reliable but used to be the best that could be done
      due to deadlock potential of waiting for the entire flush.
      
      Now the inode flush is safe to execute while we hold page
      and inode locks, we can wait for all the inodes to flush
      synchronously. Convert the wait mechanism to a completion
      to do this efficiently. This should remove all remaining
      spurious ENOSPC errors from the delayed allocation reservation
      path.
      
      This is extracted almost line for line from a larger patch
      from Mikulas Patocka.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      e43afd72
    • Dave Chinner's avatar
      xfs: make inode flush at ENOSPC synchronous · 5825294e
      Dave Chinner authored
      When we are writing to a single file and hit ENOSPC, we trigger a background
      flush of the inode and try again.  Because we hold page locks and the iolock,
      the flush won't proceed until after we release these locks. This occurs once
      we've given up and ENOSPC has been reported. Hence if this one is the only
      dirty inode in the system, we'll get an ENOSPC prematurely.
      
      To fix this, remove the async flush from the allocation routines and move
      it to the top of the write path where we can do a synchronous flush
      and retry the write again. Only retry once as a second ENOSPC indicates
      that we really are ENOSPC.
      
      This avoids a page cache deadlock when trying to do this flush synchronously
      in the allocation layer that was identified by Mikulas Patocka.
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      5825294e
    • Dave Chinner's avatar
      xfs: use xfs_sync_inodes() for device flushing · a8d770d9
      Dave Chinner authored
      Currently xfs_device_flush calls sync_blockdev() which is
      a no-op for XFS as all it's metadata is held in a different
      address to the one sync_blockdev() works on.
      
      Call xfs_sync_inodes() instead to flush all the delayed
      allocation blocks out. To do this as efficiently as possible,
      do it via two passes - one to do an async flush of all the
      dirty blocks and a second to wait for all the IO to complete.
      This requires some modification to the xfs-sync_inodes_ag()
      flush code to do efficiently.
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      a8d770d9
    • Dave Chinner's avatar
      xfs: inform the xfsaild of the push target before sleeping · 9d7fef74
      Dave Chinner authored
      When trying to reserve log space, we find the amount of space
      we need, then go to sleep waiting for space. When we are
      woken, we try to push the tail of the log forward to make
      sure we have space available.
      
      Unfortunately, this means that if there is not space available, and
      everyone who needs space goes to sleep there is no-one left to push
      the tail of the log to make space available. Once we have a thread
      waiting for space to become available, the others queue up behind
      it in a FIFO, and none of them push the tail of the log.
      
      This can result in everyone going to sleep in xlog_grant_log_space()
      if the first sleeper races with the last I/O that moves the tail
      of the log forward. With no further I/O tomove the tail of the log,
      there is nothing to wake the sleepers and hence all transactions
      just stop.
      
      Fix this by making sure the xfsaild will create enough space for the
      transaction that is about to sleep by moving the push target far
      enough forwards to ensure that that the curent proceeees will have
      enough space available when it is woken. That is, we push the
      AIL before we go to sleep.
      
      Because we've inserted the log ticket into the queue before we've
      pushed and gone to sleep, subsequent transactions will wait behind
      this one. Hence we are guaranteed to have space available when we
      are woken.
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      9d7fef74
    • Dave Chinner's avatar
      xfs: prevent unwritten extent conversion from blocking I/O completion · c626d174
      Dave Chinner authored
      Unwritten extent conversion can recurse back into the filesystem due
      to memory allocation. Memory reclaim requires I/O completions to be
      processed to allow the callers to make progress. If the I/O
      completion workqueue thread is doing the recursion, then we have a
      deadlock situation.
      
      Move unwritten extent completion into it's own workqueue so it
      doesn't block I/O completions for normal delayed allocation or
      overwrite data.
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      c626d174
    • Dave Chinner's avatar
      xfs: fix double free of inode · 705db3fd
      Dave Chinner authored
      If we fail to initialise the VFS inode in inode_init_always(),
      it will call ->delete_inode internally resulting in the inode being
      freed. Hence we need to delay the call to inode_init_always()
      until after the XFS inode is sufficient set up to handle a
      call to ->delete_inode, and then if that fails do not touch
      the inode again at all as it has been freed.
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      705db3fd
    • Dave Chinner's avatar
      xfs: validate log feature fields correctly · a6cb767e
      Dave Chinner authored
      If the large log sector size feature bit is set in the
      superblock by accident (say disk corruption), the then
      fields that are now considered valid are not checked on
      production kernels. The checks are present as ASSERT
      statements so cause a panic on a debug kernel.
      
      Change this so that the fields are validity checked if
      the feature bit is set and abort the log mount if the
      fields do not contain valid values.
      Reported-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      a6cb767e
  7. 31 Mar, 2009 9 commits
  8. 30 Mar, 2009 14 commits
    • Linus Torvalds's avatar
      Merge branch 'proc-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/adobriyan/proc · cf2f7d7c
      Linus Torvalds authored
      * 'proc-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/adobriyan/proc:
        Revert "proc: revert /proc/uptime to ->read_proc hook"
        proc 2/2: remove struct proc_dir_entry::owner
        proc 1/2: do PDE usecounting even for ->read_proc, ->write_proc
        proc: fix sparse warnings in pagemap_read()
        proc: move fs/proc/inode-alloc.txt comment into a source file
      cf2f7d7c
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6 · 53d8f670
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
        PCI PM: Make pci_prepare_to_sleep() disable wake-up if needed
        radeonfb: Use __pci_complete_power_transition()
        PCI PM: Introduce __pci_[start|complete]_power_transition() (rev. 2)
        PCI PM: Restore config spaces of all devices during early resume
        PCI PM: Make pci_set_power_state() handle devices with no PM support
        PCI PM: Put devices into low power states during late suspend (rev. 2)
        PCI PM: Move pci_restore_standard_config to pci-driver.c
        PCI PM: Use pci_set_power_state during early resume
        PCI PM: Consistently use variable name "error" for pm call return values
        kexec: Change kexec jump code ordering
        PM: Change hibernation code ordering
        PM: Change suspend code ordering
        PM: Rework handling of interrupts during suspend-resume
        PM: Introduce functions for suspending and resuming device interrupts
      53d8f670
    • Randy Dunlap's avatar
      dma-debug: fix printk formats (i386) · 93c36ed8
      Randy Dunlap authored
      Fix printk format warnings in dma-debug:
      
        lib/dma-debug.c:645: warning: format '%016llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'
        lib/dma-debug.c:662: warning: format '%016llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'
        lib/dma-debug.c:676: warning: format '%016llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'
        lib/dma-debug.c:686: warning: format '%016llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      93c36ed8
    • Jeff Mahoney's avatar
      reiserfs: xattr_create is unused with xattrs disabled · 3a355cc6
      Jeff Mahoney authored
      This patch ifdefs xattr_create when xattrs aren't enabled.
      Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3a355cc6
    • Alexander Beregalov's avatar
      reiserfs: fix build breakage · 77e46586
      Alexander Beregalov authored
      Fix this build error when REISERFS_FS_POSIX_ACL is not set:
      
        fs/reiserfs/inode.c: In function 'reiserfs_new_inode':
        fs/reiserfs/inode.c:1919: warning: passing argument 1 of 'reiserfs_inherit_default_acl' from incompatible pointer type
        fs/reiserfs/inode.c:1919: warning: passing argument 2 of 'reiserfs_inherit_default_acl' from incompatible pointer type
        fs/reiserfs/inode.c:1919: warning: passing argument 3 of 'reiserfs_inherit_default_acl' from incompatible pointer type
        fs/reiserfs/inode.c:1919: error: too many arguments to function 'reiserfs_inherit_default_acl'
      
      due to a missing transaction-handle argument in the non-acl
      compatibility function.
      Signed-off-by: default avatarAlexander Beregalov <a.beregalov@gmail.com>
      Acked-by: default avatarJeff Mahoney <jeffm@suse.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      77e46586
    • Peter Zijlstra's avatar
      lockdep: fix deadlock in lockdep_trace_alloc · 2f850181
      Peter Zijlstra authored
      Heiko reported that we grab the graph lock with irqs enabled.
      
      Fix this by providng the same wrapper as all other lockdep entry
      functions have.
      Reported-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Nick Piggin <npiggin@suse.de>
      LKML-Reference: <1237544000.24626.52.camel@twins>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      2f850181
    • Alexey Dobriyan's avatar
      Revert "proc: revert /proc/uptime to ->read_proc hook" · a9caa3de
      Alexey Dobriyan authored
      This reverts commit 6c87df37.
      
      proc files implemented through seq_file do pread(2) now.
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      a9caa3de
    • Alexey Dobriyan's avatar
      proc 2/2: remove struct proc_dir_entry::owner · 99b76233
      Alexey Dobriyan authored
      Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
      as correctly noted at bug #12454. Someone can lookup entry with NULL
      ->owner, thus not pinning enything, and release it later resulting
      in module refcount underflow.
      
      We can keep ->owner and supply it at registration time like ->proc_fops
      and ->data.
      
      But this leaves ->owner as easy-manipulative field (just one C assignment)
      and somebody will forget to unpin previous/pin current module when
      switching ->owner. ->proc_fops is declared as "const" which should give
      some thoughts.
      
      ->read_proc/->write_proc were just fixed to not require ->owner for
      protection.
      
      rmmod'ed directories will be empty and return "." and ".." -- no harm.
      And directories with tricky enough readdir and lookup shouldn't be modular.
      We definitely don't want such modular code.
      
      Removing ->owner will also make PDE smaller.
      
      So, let's nuke it.
      
      Kudos to Jeff Layton for reminding about this, let's say, oversight.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=12454Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      99b76233
    • Alexey Dobriyan's avatar
      proc 1/2: do PDE usecounting even for ->read_proc, ->write_proc · 3dec7f59
      Alexey Dobriyan authored
      struct proc_dir_entry::owner is going to be removed. Now it's only necessary
      to protect PDEs which are using ->read_proc, ->write_proc hooks.
      
      However, ->owner assignments are racy and make it very easy for someone to switch
      ->owner on live PDE (as some subsystems do) without fixing refcounts and so on.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=12454
      
      So, ->owner is on death row.
      
      Proxy file operations exist already (proc_file_operations), just bump usecount
      when necessary.
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      3dec7f59
    • Milind Arun Choudhary's avatar
      proc: fix sparse warnings in pagemap_read() · 09729a99
      Milind Arun Choudhary authored
      fs/proc/task_mmu.c:696:12: warning: cast removes address space of expression
      fs/proc/task_mmu.c:696:9: warning: incorrect type in assignment (different address spaces)
      fs/proc/task_mmu.c:696:9:    expected unsigned long long [noderef] [usertype] <asn:1>*out
      fs/proc/task_mmu.c:696:9:    got unsigned long long [usertype] *<noident>
      fs/proc/task_mmu.c:697:12: warning: cast removes address space of expression
      fs/proc/task_mmu.c:697:9: warning: incorrect type in assignment (different address spaces)
      fs/proc/task_mmu.c:697:9:    expected unsigned long long [noderef] [usertype] <asn:1>*end
      fs/proc/task_mmu.c:697:9:    got unsigned long long [usertype] *<noident>
      fs/proc/task_mmu.c:723:12: warning: cast removes address space of expression
      fs/proc/task_mmu.c:723:26: error: subtraction of different types can't work (different address spaces)
      fs/proc/task_mmu.c:725:24: error: subtraction of different types can't work (different address spaces)
      Signed-off-by: default avatarMilind Arun Choudhary <milindchoudhary@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      09729a99
    • Randy Dunlap's avatar
      proc: move fs/proc/inode-alloc.txt comment into a source file · 1681bc30
      Randy Dunlap authored
      so that people will realize that it exists and can update it as needed.
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      1681bc30
    • Ingo Molnar's avatar
      lockdep: annotate reclaim context (__GFP_NOFS), fix SLOB · 19cefdff
      Ingo Molnar authored
      Impact: build fix
      
      fix typo in mm/slob.c:
      
       mm/slob.c:469: error: ‘flags’ undeclared (first use in this function)
       mm/slob.c:469: error: (Each undeclared identifier is reported only once
       mm/slob.c:469: error: for each function it appears in.)
      
      Cc: Nick Piggin <npiggin@suse.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20090128135457.350751756@chello.nl>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      19cefdff
    • Linus Torvalds's avatar
      Merge branch 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 · dfbbe89e
      Linus Torvalds authored
      * 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (53 commits)
        drm: detect hdmi monitor by hdmi identifier (v3)
        drm: drm_fops.c unlock missing on error path
        drm: reorder struct drm_ioctl_desc to save space on 64 bit builds
        radeon: add some new pci ids
        drm: read EDID extensions from monitor
        drm: Use a little stash on the stack to avoid kmalloc in most DRM ioctls.
        drm/radeon: add regs required for occlusion queries support
        drm/i915: check the return value from the copy from user
        drm/radeon: fix logic in r600_page_table_init() to match ati_gart
        drm/radeon: r600 ptes are 64-bit, cleanup cleanup function.
        drm/radeon: don't call irq changes on r600 suspend/resume
        drm/radeon: fix r600 writeback across suspend/resume
        drm/radeon: fix r600 writeback setup.
        drm: fix warnings about new mappings in info code.
        drm/radeon: NULL noise: drivers/gpu/drm/radeon/radeon_*.c
        drm/radeon: fix r600 pci mapping calls.
        drm/radeon: r6xx/r7xx: fix possible oops in r600_page_table_cleanup()
        radeon: call the correct idle function, logic got inverted.
        drm/radeon: RS600: fix interrupt handling
        drm/r600: fix rptr address along lines of previous fixes to radeon.
        ...
      dfbbe89e
    • Linus Torvalds's avatar
      Merge branch 'iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip · 712b0006
      Linus Torvalds authored
      * 'iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (60 commits)
        dma-debug: make memory range checks more consistent
        dma-debug: warn of unmapping an invalid dma address
        dma-debug: fix dma_debug_add_bus() definition for !CONFIG_DMA_API_DEBUG
        dma-debug/x86: register pci bus for dma-debug leak detection
        dma-debug: add a check dma memory leaks
        dma-debug: add checks for kernel text and rodata
        dma-debug: print stacktrace of mapping path on unmap error
        dma-debug: Documentation update
        dma-debug: x86 architecture bindings
        dma-debug: add function to dump dma mappings
        dma-debug: add checks for sync_single_sg_*
        dma-debug: add checks for sync_single_range_*
        dma-debug: add checks for sync_single_*
        dma-debug: add checking for [alloc|free]_coherent
        dma-debug: add add checking for map/unmap_sg
        dma-debug: add checking for map/unmap_page/single
        dma-debug: add core checking functions
        dma-debug: add debugfs interface
        dma-debug: add kernel command line parameters
        dma-debug: add initialization code
        ...
      
      Fix trivial conflicts due to whitespace changes in arch/x86/kernel/pci-nommu.c
      712b0006