1. 02 Dec, 2008 5 commits
  2. 01 Dec, 2008 1 commit
  3. 20 Nov, 2008 5 commits
  4. 19 Nov, 2008 6 commits
    • Chris Mason's avatar
      Btrfs: Use current_fsuid/gid · 79683f2d
      Chris Mason authored
      
      
      This fixes compile problems with linux-next
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      79683f2d
    • Chris Mason's avatar
      Btrfs: Fixes for 2.6.28-rc API changes · 15916de8
      Chris Mason authored
      
      
      * open/close_bdev_excl -> open/close_bdev_exclusive
      * blkdev_issue_discard takes a GFP mask now
      * Fix blkdev_issue_discard usage now that it is enabled
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      15916de8
    • Chris Mason's avatar
    • Josef Bacik's avatar
      Btrfs: fix free space accounting when unpinning extents · 07103a3c
      Josef Bacik authored
      
      
      This patch fixes what I hope is the last early ENOSPC bug left.  I did not know
      that pinned extents would merge into one big extent when inserted on to the
      pinned extent tree, so I was adding free space to a block group that could
      possibly span multiple block groups.
      
      This is a big issue because first that space doesn't exist in that block group,
      and second we won't actually use that space because there are a bunch of other
      checks to make sure we're allocating within the constraints of the block group.
      
      This patch fixes the problem by adding the btrfs_add_free_space to
      btrfs_update_pinned_extents which makes sure we are adding the appropriate
      amount of free space to the appropriate block group.  Thanks much to Lee Trager
      for running my myriad of debug patches to help me track this problem down.
      Thank you,
      
      Signed-off-by: default avatarJosef Bacik <jbacik@redhat.com>
      07103a3c
    • Chris Mason's avatar
      Btrfs: Do fsync log replay when mount -o ro, except when on readonly media · 7c2ca468
      Chris Mason authored
      
      
      fsync log replay can change the filesystem, so it cannot be delayed until
      mount -o rw,remount, and it can't be forgotten entirely.  So, this patch
      changes btrfs to do with reiserfs, ext3 and xfs do, which is to do the
      log replay even when mounted readonly.
      
      On a readonly device if log replay is required, the mount is aborted.
      
      Getting all of this right had required fixing up some of the error
      handling in open_ctree.
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      7c2ca468
    • Chris Mason's avatar
      Btrfs: Avoid writeback stalls · d2c3f4f6
      Chris Mason authored
      
      
      While building large bios in writepages, btrfs may end up waiting
      for other page writeback to finish if WB_SYNC_ALL is used.
      
      While it is waiting, the bio it is building has a number of pages with the
      writeback bit set and they aren't getting to the disk any time soon.  This
      lowers the latencies of writeback in general by sending down the bio being
      built before waiting for other pages.
      
      The bio submission code tries to limit the total number of async bios in
      flight by waiting when we're over a certain number of async bios.  But,
      the waits are happening while writepages is building bios, and this can easily
      lead to stalls and other problems for people calling wait_on_page_writeback.
      
      The current fix is to let the congestion tests take care of waiting.
      
      sync() and others make sure to drain the current async requests to make
      sure that everything that was pending when the sync was started really get
      to disk.  The code would drain pending requests both before and after
      submitting a new request.
      
      But, if one of the requests is waiting for page writeback to finish,
      the draining waits might block that page writeback.  This changes the
      draining code to only wait after submitting the bio being processed.
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      d2c3f4f6
  5. 18 Nov, 2008 4 commits
  6. 17 Nov, 2008 6 commits
    • Chris Mason's avatar
      Btrfs: prevent loops in the directory tree when creating snapshots · ea9e8b11
      Chris Mason authored
      
      
      For a directory tree:
      
      /mnt/subvolA/subvolB
      
      btrfsctl -s /mnt/subvolA/subvolB /mnt
      
      Will create a directory loop with subvolA under subvolB.  This
      commit uses the forward refs for each subvol and snapshot to error out
      before creating the loop.
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      ea9e8b11
    • Chris Mason's avatar
      Btrfs: Add backrefs and forward refs for subvols and snapshots · 0660b5af
      Chris Mason authored
      
      
      Subvols and snapshots can now be referenced from any point in the directory
      tree.  We need to maintain back refs for them so we can find lost
      subvols.
      
      Forward refs are added so that we know all of the subvols and
      snapshots referenced anywhere in the directory tree of a single subvol.  This
      can be used to do recursive snapshotting (but they aren't yet) and it is
      also used to detect and prevent directory loops when creating new snapshots.
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      0660b5af
    • Chris Mason's avatar
      Btrfs: Give each subvol and snapshot their own anonymous devid · 3394e160
      Chris Mason authored
      
      
      Each subvolume has its own private inode number space, and so we need
      to fill in different device numbers for each subvolume to avoid confusing
      applications.
      
      This commit puts a struct super_block into struct btrfs_root so it can
      call set_anon_super() and get a different device number generated for
      each root.
      
      btrfs_rename is changed to prevent renames across subvols.
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      3394e160
    • Chris Mason's avatar
      Btrfs: Allow subvolumes and snapshots anywhere in the directory tree · 3de4586c
      Chris Mason authored
      
      
      Before, all snapshots and subvolumes lived in a single flat directory.  This
      was awkward and confusing because the single flat directory was only writable
      with the ioctls.
      
      This commit changes the ioctls to create subvols and snapshots at any
      point in the directory tree.  This requires making separate ioctls for
      snapshot and subvol creation instead of a combining them into one.
      
      The subvol ioctl does:
      
      btrfsctl -S subvol_name parent_dir
      
      After the ioctl is done subvol_name lives inside parent_dir.
      
      The snapshot ioctl does:
      
      btrfsctl -s path_for_snapshot root_to_snapshot
      
      path_for_snapshot can be an absolute or relative path.  btrfsctl breaks it up
      into directory and basename components.
      
      root_to_snapshot can be any file or directory in the FS.  The snapshot
      is taken of the entire root where that file lives.
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      3de4586c
    • Josef Bacik's avatar
      Btrfs: Add some debugging around the ENOSPC bugs · 4ce4cb52
      Josef Bacik authored
      
      
      Some people are still reporting problems with early enospc.  This
      will help narrown down the cause.
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      4ce4cb52
    • Josef Bacik's avatar
      Btrfs: fix free space leak · e3e469f8
      Josef Bacik authored
      
      
      In my batch delete/update/insert patch I introduced a free space leak.  The
      extent that we do the original search on in free_extents is never pinned, so we
      always update the block saying that it has free space, but the free space never
      actually gets added to the free space tree, since op->del will always be 0 and
      it's never actually added to the pinned extents tree.
      
      This patch fixes this problem by making sure we call pin_down_bytes on the
      pending extent op and set op->del to the return value of pin_down_bytes so
      update_block_group is called with the right value.  This seems to fix the case
      where we were getting ENOSPC when there was plenty of space available.
      
      Signed-off-by: default avatarJosef Bacik <jbacik@redhat.com>
      e3e469f8
  7. 15 Nov, 2008 13 commits
    • Linus Torvalds's avatar
      Linux 2.6.28-rc5 · 9bf1a244
      Linus Torvalds authored
      9bf1a244
    • Al Viro's avatar
      Fix inotify watch removal/umount races · 8f7b0ba1
      Al Viro authored
      
      
      Inotify watch removals suck violently.
      
      To kick the watch out we need (in this order) inode->inotify_mutex and
      ih->mutex.  That's fine if we have a hold on inode; however, for all
      other cases we need to make damn sure we don't race with umount.  We can
      *NOT* just grab a reference to a watch - inotify_unmount_inodes() will
      happily sail past it and we'll end with reference to inode potentially
      outliving its superblock.
      
      Ideally we just want to grab an active reference to superblock if we
      can; that will make sure we won't go into inotify_umount_inodes() until
      we are done.  Cleanup is just deactivate_super().
      
      However, that leaves a messy case - what if we *are* racing with
      umount() and active references to superblock can't be acquired anymore?
      We can bump ->s_count, grab ->s_umount, which will almost certainly wait
      until the superblock is shut down and the watch in question is pining
      for fjords.  That's fine, but there is a problem - we might have hit the
      window between ->s_active getting to 0 / ->s_count - below S_BIAS (i.e.
      the moment when superblock is past the point of no return and is heading
      for shutdown) and the moment when deactivate_super() acquires
      ->s_umount.
      
      We could just do drop_super() yield() and retry, but that's rather
      antisocial and this stuff is luser-triggerable.  OTOH, having grabbed
      ->s_umount and having found that we'd got there first (i.e.  that
      ->s_root is non-NULL) we know that we won't race with
      inotify_umount_inodes().
      
      So we could grab a reference to watch and do the rest as above, just
      with drop_super() instead of deactivate_super(), right? Wrong.  We had
      to drop ih->mutex before we could grab ->s_umount.  So the watch
      could've been gone already.
      
      That still can be dealt with - we need to save watch->wd, do idr_find()
      and compare its result with our pointer.  If they match, we either have
      the damn thing still alive or we'd lost not one but two races at once,
      the watch had been killed and a new one got created with the same ->wd
      at the same address.  That couldn't have happened in inotify_destroy(),
      but inotify_rm_wd() could run into that.  Still, "new one got created"
      is not a problem - we have every right to kill it or leave it alone,
      whatever's more convenient.
      
      So we can use idr_find(...) == watch && watch->inode->i_sb == sb as
      "grab it and kill it" check.  If it's been our original watch, we are
      fine, if it's a newcomer - nevermind, just pretend that we'd won the
      race and kill the fscker anyway; we are safe since we know that its
      superblock won't be going away.
      
      And yes, this is far beyond mere "not very pretty"; so's the entire
      concept of inotify to start with.
      
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Acked-by: default avatarGreg KH <greg@kroah.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8f7b0ba1
    • Huang Weiyi's avatar
      LIS3LV02Dx: remove unused #include <version.h> · 0d3b7100
      Huang Weiyi authored
      
      
      The file(s) below do not use LINUX_VERSION_CODE nor KERNEL_VERSION.
        drivers/hwmon/lis3lv02d.c
      
      This patch removes the said #include <version.h>.
      
      Signed-off-by: default avatarHuang Weiyi <weiyi.huang@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0d3b7100
    • Linus Torvalds's avatar
      Merge branch 'sh/for-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 · 537a2f88
      Linus Torvalds authored
      * 'sh/for-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
        serial: sh-sci: Reorder the SCxTDR write after the TDxE clear.
        sh: __copy_user function can corrupt the stack in case of exception
        sh: Fixed the TMU0 reload value on resume
        sh: Don't factor in PAGE_OFFSET for valid_phys_addr_range() check.
        sh: early printk port type fix
        i2c: fix i2c-sh_mobile rx underrun
        sh: Provide a sane valid_phys_addr_range() to prevent TLB reset with PMB.
        usb: r8a66597-hcd: fix wrong data access in SuperH on-chip USB
        fix sci type for SH7723
        serial: sh-sci: fix cannot work SH7723 SCIFA
        sh: Handle fixmap TLB eviction more coherently.
      537a2f88
    • Linus Torvalds's avatar
      Merge branch 'doc-subdirs' of git://git.kernel.org/pub/scm/linux/kernel/git/rdunlap/linux-docs · fab349cc
      Linus Torvalds authored
      * 'doc-subdirs' of git://git.kernel.org/pub/scm/linux/kernel/git/rdunlap/linux-docs:
        Create/use more directory structure in the Documentation/ tree.
      fab349cc
    • Martin Schwidefsky's avatar
      Add 'pr_fmt()' format modifier to pr_xyz macros. · d091c2f5
      Martin Schwidefsky authored
      
      
      A common reason for device drivers to implement their own printk macros
      is the lack of a printk prefix with the standard pr_xyz macros.
      Introduce a pr_fmt() macro that is applied for every pr_xyz macro to the
      format string.
      
      The most common use of the pr_fmt macro would be to add the name of the
      device driver to all pr_xyz messages in a source file.
      
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d091c2f5
    • Linus Torvalds's avatar
    • Linus Torvalds's avatar
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 · 6ca2cb99
      Linus Torvalds authored
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
        V4L/DVB (9624): CVE-2008-5033: fix OOPS on tvaudio when controlling bass/treble
        V4L/DVB (9623): tvaudio: Improve debug msg by printing something more human
        V4L/DVB (9622): tvaudio: Improve comments and remove a unneeded prototype
        V4L/DVB (9621): Avoid writing outside shadow.bytes[] array
        V4L/DVB (9620): tvaudio: use a direct reference for chip description
        V4L/DVB (9619): tvaudio: update initial comments
        V4L/DVB (9618): tvaudio: add additional logic to avoid OOPS
        V4L/DVB (9617): tvtime: remove generic_checkmode callback
        V4L/DVB (9616): tvaudio: cleanup - group all callbacks together
        V4L/DVB (9615): tvaudio: instead of using a magic number, use ARRAY_SIZE
        V4L/DVB (9613): tvaudio: fix a memory leak
      6ca2cb99
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 · 01133148
      Linus Torvalds authored
      * 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
        [S390] fix s390x_newuname
        [S390] dasd: log sense for fatal errors
        [S390] cpu topology: fix locking
        [S390] cio: Fix refcount after moving devices.
        [S390] ftrace: fix kernel stack backchain walking
        [S390] ftrace: disable tracing on idle psw
        [S390] lockdep: fix compile bug
        [S390] kvm_s390: Fix oops in virtio device detection with "mem="
        [S390] sclp: emit error message if assign storage fails
        [S390] Fix range for add_active_range() in setup_memory()
      01133148
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 · c98114db
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
        [SCSI] dpt_i2o: fix transferred data length for scsi_set_resid()
        [SCSI] scsi_error regression: Fix idempotent command handling
        [SCSI] zfcp: Fix hexdump data in s390dbf traces
        [SCSI] zfcp: fix erp timeout cleanup for port open requests
        [SCSI] zfcp: Wait for port scan to complete when setting adapter online
        [SCSI] zfcp: Fix cast warning
        [SCSI] zfcp: Fix request list handling in error path
        [SCSI] zfcp: fix mempool usage for status_read requests
        [SCSI] zfcp: fix req_list_locking.
        [SCSI] zfcp: Dont clear reference from SCSI device to unit
        [SCSI] qla2xxx: Update version number to 8.02.01-k9.
        [SCSI] qla2xxx: Return a FAILED status when abort mailbox-command fails.
        [SCSI] qla2xxx: Do not honour max_vports from firmware for 2G ISPs and below.
        [SCSI] qla2xxx: Use pci_disable_rom() to manipulate PCI config space.
        [SCSI] qla2xxx: Correct Atmel flash-part handling.
        [SCSI] megaraid: fix mega_internal_command oops
      c98114db
    • David Woodhouse's avatar
      Revert "x86: blacklist DMAR on Intel G31/G33 chipsets" · 52168e60
      David Woodhouse authored
      This reverts commit e51af663, which was
      wrongly hoovered up and submitted about a month after a better fix had
      already been merged.
      
      The better fix is commit cbda1ba8
      
      
      ("PCI/iommu: blacklist DMAR on Intel G31/G33 chipsets"), where we do
      this blacklisting based on the DMI identification for the offending
      motherboard, since sometimes this chipset (or at least a chipset with
      the same PCI ID) apparently _does_ actually have an IOMMU.
      
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      52168e60
    • KOSAKI Motohiro's avatar
      mm: remove unevictable's show_page_path · 748f1a2e
      KOSAKI Motohiro authored
      
      
      Hugh Dickins reported show_page_path() is buggy and unsafe because
      
       - lack dput() against d_find_alias()
       - don't concern vma->vm_mm->owner == NULL
       - lack lock_page()
      
      it was only for debugging, so rather than trying to fix it, just remove
      it now.
      
      Reported-by: default avatarHugh Dickins <hugh@veritas.com>
      Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
      Signed-off-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      CC: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      CC: Rik van Riel <riel@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      748f1a2e
    • Geert Uytterhoeven's avatar
      misc: C2port needs <linux/sched.h> · fb751098
      Geert Uytterhoeven authored
      
      
      m68k allmodconfig:
      
      | drivers/misc/c2port/core.c: In function 'c2port_reset':
      | drivers/misc/c2port/core.c:73: error: dereferencing pointer to incomplete type
      | drivers/misc/c2port/core.c: In function 'c2port_strobe_ck':
      | drivers/misc/c2port/core.c:91: error: dereferencing pointer to incomplete type
      
      Include <linux/sched.h> to fix it, as m68k's local_irq_enable() needs to know
      about struct task_struct.
      
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fb751098