1. 07 11月, 2011 1 次提交
  2. 06 11月, 2011 21 次提交
    • C
      Btrfs: fix race during transaction joins · d43317dc
      Chris Mason 提交于
      While we're allocating ram for a new transaction, we drop our spinlock.
      When we get the lock back, we do check to see if a transaction started
      while we slept, but we don't check to make sure it isn't blocked
      because a commit has already started.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      d43317dc
    • I
      Btrfs: fix a potential btrfs_bio leak on scrub fixups · 56d2a48f
      Ilya Dryomov 提交于
      In case we were able to map less than we wanted (length < PAGE_SIZE
      clause is true) btrfs_bio is still allocated and we have to free it.
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      56d2a48f
    • I
      21ca543e
    • I
      Btrfs: stop leaking btrfs_bios on readahead · 9510dc4c
      Ilya Dryomov 提交于
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      9510dc4c
    • C
      Btrfs: stop the readahead threads on failed mount · 306c8b68
      Chris Mason 提交于
      If we don't stop them, they linger around corrupting
      memory by using pointers to freed things.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      306c8b68
    • C
      Btrfs: fix extent_buffer leak in the metadata IO error handling · c674e04e
      Chris Mason 提交于
      The scrub readahead branch brought in a new error handling hook,
      but it was leaking extent_buffer references.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      c674e04e
    • C
      Btrfs: fix the new inspection ioctls for 32 bit compat · 740c3d22
      Chris Mason 提交于
      The new ioctls to follow backrefs are not clean for 32/64 bit
      compat.  This reworks them for u64s everywhere.  They are brand new, so
      there are no problems with changing the interface now.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      740c3d22
    • C
      Merge git://git.jan-o-sch.net/btrfs-unstable into integration · 806468f8
      Chris Mason 提交于
      Conflicts:
      	fs/btrfs/Makefile
      	fs/btrfs/extent_io.c
      	fs/btrfs/extent_io.h
      	fs/btrfs/scrub.c
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      806468f8
    • C
      Merge branch 'for-chris' of git://github.com/sensille/linux into integration · 531f4b1a
      Chris Mason 提交于
      Conflicts:
      	fs/btrfs/ctree.h
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      531f4b1a
    • J
      Btrfs: fix delayed insertion reservation · c06a0e12
      Josef Bacik 提交于
      We all keep getting those stupid warnings from use_block_rsv when running
      stress.sh, and it's because the delayed insertion stuff is being stupid.  It's
      not the delayed insertion stuffs fault, it's all just stupid.  When marking an
      inode dirty for oh say updating the time on it, we just do a
      btrfs_join_transaction, which doesn't reserve any space.  This is stupid because
      we're going to have to have space reserve to make this change, but we do it
      because it's fast because chances are we're going to call it over and over again
      and it doesn't matter.  Well thanks to the delayed insertion stuff this is
      mostly the case, so we do actually need to make this reservation.  So if
      trans->bytes_reserved is 0 then try to do a normal reservation.  If not return
      ENOSPC which will make the btrfs_dirty_inode start a proper transaction which
      will let it do the whole ENOSPC dance and reserve enough space for the delayed
      insertion to steal the reservation from the transaction.
      
      The other stupid thing we do is not reserve space for the inode when writing to
      the thing.  Usually this is ok since we have to update the time so we'd have
      already done all this work before we get to the endio stuff, so it doesn't
      matter.  But this is stupid because we could write the data after the
      transaction commits where we changed the mtime of the inode so we have to cow
      all the way down to the inode anyway.  This used to be masked by the delalloc
      reservation stuff, but because we delay the update it doesn't get masked in this
      case.  So again the delayed insertion stuff bites us in the ass.  So if our
      trans->block_rsv is delalloc, just steal the reservation from the delalloc
      reserve.  Hopefully this won't bite us in the ass, but I've said that before.
      
      With this patch stress.sh no longer spits out those stupid warnings (famous last
      words).  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      c06a0e12
    • C
      Btrfs: ClearPageError during writepage and clean_tree_block · bf0da8c1
      Chris Mason 提交于
      Failure testing was tripping up over stale PageError bits in
      metadata pages.  If we have an io error on a block, and later on
      end up reusing it, nobody ever clears PageError on those pages.
      
      During commit, we'll find PageError and think we had trouble writing
      the block, which will lead to aborts and other problems.
      
      This changes clean_tree_block and the btrfs writepage code to
      clear the PageError bit.  In both cases we're either completely
      done with the page or the page has good stuff and the error bit
      is no longer valid.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      bf0da8c1
    • J
      Btrfs: be smarter about committing the transaction in reserve_metadata_bytes · 663350ac
      Josef Bacik 提交于
      Because of the overcommit stuff I had to make it so that we committed the
      transaction all the time in reserve_metadata_bytes in case we had overcommitted
      because of delayed items.  This was because previously we had no way of knowing
      how much space was reserved for delayed items.  Now that we have the
      delayed_block_rsv we can check it to see if committing the transaction would get
      us anywhere.  This patch breaks out the committing logic into a helper function
      that will check to see if committing the transaction would free enough space for
      us to get anything done.  With this patch xfstests 83 goes from taking 445
      seconds to taking 28 seconds on my box.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      663350ac
    • J
      Btrfs: make a delayed_block_rsv for the delayed item insertion · 6d668dda
      Josef Bacik 提交于
      I've been hitting warnings in use_block_rsv when running the delayed insertion
      stuff.  It's because we will readjust global block rsv based on what is in use,
      which means we could end up discarding reservations that are for the delayed
      insertion stuff.  So instead create a seperate block rsv for the delayed
      insertion stuff.  This will also make it easier to debug problems with the
      delayed insertion reservations since we will know that only the delayed
      insertion code touches this block_rsv.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      6d668dda
    • C
      Btrfs: add a log of past tree roots · af31f5e5
      Chris Mason 提交于
      This takes some of the free space in the btrfs super block
      to record information about most of the roots in the last four
      commits.
      
      It also adds a -o recovery to use the root history log when
      we're not able to read the tree of tree roots, the extent
      tree root, the device tree root or the csum root.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      af31f5e5
    • D
      btrfs: separate superblock items out of fs_info · 6c41761f
      David Sterba 提交于
      fs_info has now ~9kb, more than fits into one page. This will cause
      mount failure when memory is too fragmented. Top space consumers are
      super block structures super_copy and super_for_commit, ~2.8kb each.
      Allocate them dynamically. fs_info will be ~3.5kb. (measured on x86_64)
      
      Add a wrapper for freeing fs_info and all of it's dynamically allocated
      members.
      Signed-off-by: NDavid Sterba <dsterba@suse.cz>
      6c41761f
    • J
      Btrfs: use the global reserve when truncating the free space cache inode · c8174313
      Josef Bacik 提交于
      We no longer use the orphan block rsv for holding the reservation for truncating
      the inode, so instead use the global block rsv and check to make sure it has
      enough space for us to truncate the space.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      c8174313
    • J
      Btrfs: release metadata from global reserve if we have to fallback for unlink · 5a77d76c
      Josef Bacik 提交于
      I fixed a problem where we weren't reserving space for an orphan item when we
      had to fallback to using the global reserve for an unlink, but I introduced
      another problem.  I was migrating the bytes from the transaction reserve to the
      global reserve and then releasing from the global reserve in
      btrfs_end_transaction().  The problem with this is that a migrate will jack up
      the size for the destination, but leave the size alone for the source, with the
      idea that you can do a release normally on the source and it all washes out, and
      then you can do a release again on the destination and it works out right.  My
      way was skipping the release on the trans_block_rsv which still had the jacked
      up size from our original reservation.  So instead release manually from the
      global reserve if this transaction was using it, and then set the
      trans->block_rsv back to the trans_block_rsv so that btrfs_end_transaction
      cleans everything up properly.  With this patch xfstest 83 doesn't emit warnings
      about leaking space.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      5a77d76c
    • C
      Btrfs: make sure to flush queued bios if write_cache_pages waits · 01d658f2
      Chris Mason 提交于
      write_cache_pages tries to build up a large bio to stuff down the pipe.
      But if it needs to wait for a page lock, it needs to make sure and send
      down any pending writes so we don't deadlock with anyone who has the
      page lock and is waiting for writeback of things inside the bio.
      
      Dave Sterba triggered this as a deadlock between the autodefrag code and
      the extent write_cache_pages
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      01d658f2
    • C
      Btrfs: fix extent pinning bugs in the tree log · e688b725
      Chris Mason 提交于
      The tree log had two important bugs that could cause corruptions after a
      crash.  Sometimes we were allowing tree log blocks to be reused after
      the tree log was committed but before the transaction commit was done.
      
      This allowed a future metadata write to overwrite the tree log data.  It
      is fixed by adding a new variant of freeing reserved extents that always
      pins them.  Credit goes to Stefan Behrens and Arne Jansen for many many
      hours spent tracking this bug down.
      
      During tree log replay, we do a pass through the tree log and pin all
      the extents we find.  This makes sure the replay code won't go in and
      use any of those blocks for new allocations during replay.  The problem
      is the free space cache isn't honoring these pinned extents.  So the
      allocator can end up handing them out, leading to all kinds of problems
      during replay.
      
      The fix here is to force any free space cache to load while we pin the
      extents, and then to make sure we remove the pinned extents from the
      free space rbtree.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      Reported-by: NStefan Behrens <sbehrens@giantdisaster.de>
      e688b725
    • C
      Btrfs: make sure btrfs_remove_free_space doesn't leak EAGAIN · 1eae31e9
      Chris Mason 提交于
      btrfs_remove_free_space needs to make sure to set ret back to a
      valid return value after setting it to EAGAIN, otherwise we return
      it to the callers.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      1eae31e9
    • C
      Btrfs: don't wait as long for more batches during SSD log commit · cd354ad6
      Chris Mason 提交于
      When we're doing log commits, we try to wait for more writers to come in
      and make the commit bigger.  This helps improve performance on rotating
      disks, but on SSDs it adds latencies.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      cd354ad6
  3. 24 10月, 2011 9 次提交
  4. 23 10月, 2011 2 次提交
  5. 22 10月, 2011 1 次提交
  6. 21 10月, 2011 6 次提交
    • L
      Merge git://github.com/herbertx/crypto · 2efd7c0f
      Linus Torvalds 提交于
      * git://github.com/herbertx/crypto:
        crypto: ghash - Avoid null pointer dereference if no key is set
      2efd7c0f
    • L
      Merge branch 'fix/hda' of git://github.com/tiwai/sound · 62ddc004
      Linus Torvalds 提交于
      * 'fix/hda' of git://github.com/tiwai/sound:
        ALSA: HDA: conexant support for Lenovo T520/W520
        ALSA: hda - Add position_fix quirk for Dell Inspiron 1010
      62ddc004
    • N
      crypto: ghash - Avoid null pointer dereference if no key is set · 7ed47b7d
      Nick Bowler 提交于
      The ghash_update function passes a pointer to gf128mul_4k_lle which will
      be NULL if ghash_setkey is not called or if the most recent call to
      ghash_setkey failed to allocate memory.  This causes an oops.  Fix this
      up by returning an error code in the null case.
      
      This is trivially triggered from unprivileged userspace through the
      AF_ALG interface by simply writing to the socket without setting a key.
      
      The ghash_final function has a similar issue, but triggering it requires
      a memory allocation failure in ghash_setkey _after_ at least one
      successful call to ghash_update.
      
        BUG: unable to handle kernel NULL pointer dereference at 00000670
        IP: [<d88c92d4>] gf128mul_4k_lle+0x23/0x60 [gf128mul]
        *pde = 00000000
        Oops: 0000 [#1] PREEMPT SMP
        Modules linked in: ghash_generic gf128mul algif_hash af_alg nfs lockd nfs_acl sunrpc bridge ipv6 stp llc
      
        Pid: 1502, comm: hashatron Tainted: G        W   3.1.0-rc9-00085-ge9308cfd #32 Bochs Bochs
        EIP: 0060:[<d88c92d4>] EFLAGS: 00000202 CPU: 0
        EIP is at gf128mul_4k_lle+0x23/0x60 [gf128mul]
        EAX: d69db1f0 EBX: d6b8ddac ECX: 00000004 EDX: 00000000
        ESI: 00000670 EDI: d6b8ddac EBP: d6b8ddc8 ESP: d6b8dda4
         DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
        Process hashatron (pid: 1502, ti=d6b8c000 task=d6810000 task.ti=d6b8c000)
        Stack:
         00000000 d69db1f0 00000163 00000000 d6b8ddc8 c101a520 d69db1f0 d52aa000
         00000ff0 d6b8dde8 d88d310f d6b8a3f8 d52aa000 00001000 d88d502c d6b8ddfc
         00001000 d6b8ddf4 c11676ed d69db1e8 d6b8de24 c11679ad d52aa000 00000000
        Call Trace:
         [<c101a520>] ? kmap_atomic_prot+0x37/0xa6
         [<d88d310f>] ghash_update+0x85/0xbe [ghash_generic]
         [<c11676ed>] crypto_shash_update+0x18/0x1b
         [<c11679ad>] shash_ahash_update+0x22/0x36
         [<c11679cc>] shash_async_update+0xb/0xd
         [<d88ce0ba>] hash_sendpage+0xba/0xf2 [algif_hash]
         [<c121b24c>] kernel_sendpage+0x39/0x4e
         [<d88ce000>] ? 0xd88cdfff
         [<c121b298>] sock_sendpage+0x37/0x3e
         [<c121b261>] ? kernel_sendpage+0x4e/0x4e
         [<c10b4dbc>] pipe_to_sendpage+0x56/0x61
         [<c10b4e1f>] splice_from_pipe_feed+0x58/0xcd
         [<c10b4d66>] ? splice_from_pipe_begin+0x10/0x10
         [<c10b51f5>] __splice_from_pipe+0x36/0x55
         [<c10b4d66>] ? splice_from_pipe_begin+0x10/0x10
         [<c10b6383>] splice_from_pipe+0x51/0x64
         [<c10b63c2>] ? default_file_splice_write+0x2c/0x2c
         [<c10b63d5>] generic_splice_sendpage+0x13/0x15
         [<c10b4d66>] ? splice_from_pipe_begin+0x10/0x10
         [<c10b527f>] do_splice_from+0x5d/0x67
         [<c10b6865>] sys_splice+0x2bf/0x363
         [<c129373b>] ? sysenter_exit+0xf/0x16
         [<c104dc1e>] ? trace_hardirqs_on_caller+0x10e/0x13f
         [<c129370c>] sysenter_do_call+0x12/0x32
        Code: 83 c4 0c 5b 5e 5f c9 c3 55 b9 04 00 00 00 89 e5 57 8d 7d e4 56 53 8d 5d e4 83 ec 18 89 45 e0 89 55 dc 0f b6 70 0f c1 e6 04 01 d6 <f3> a5 be 0f 00 00 00 4e 89 d8 e8 48 ff ff ff 8b 45 e0 89 da 0f
        EIP: [<d88c92d4>] gf128mul_4k_lle+0x23/0x60 [gf128mul] SS:ESP 0068:d6b8dda4
        CR2: 0000000000000670
        ---[ end trace 4eaa2a86a8e2da24 ]---
        note: hashatron[1502] exited with preempt_count 1
        BUG: scheduling while atomic: hashatron/1502/0x10000002
        INFO: lockdep is turned off.
        [...]
      Signed-off-by: NNick Bowler <nbowler@elliptictech.com>
      Cc: stable@kernel.org [2.6.37+]
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      7ed47b7d
    • M
      ARM: S5P: fix offset calculation on gpio-interrupt · 1052cff3
      Marek Szyprowski 提交于
      Offsets of the irq controller registers were calculated
      correctly only for first GPIO bank. This patch fixes
      calculation of the register offsets for all GPIO banks.
      Reported-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NKukjin Kim <kgene.kim@samsung.com>
      1052cff3
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · fd11e153
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        sparc: Add alignment flag to PCI expansion resources
        sparc: Avoid calling sigprocmask()
        sparc: Use set_current_blocked()
        sparc32,leon: SRMMU MMU Table probe fix
      fd11e153
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 505f48b5
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        fib_rules: fix unresolved_rules counting
        r8169: fix wrong eee setting for rlt8111evl
        r8169: fix driver shutdown WoL regression.
        ehea: Change maintainer to me
        pptp: pptp_rcv_core() misses pskb_may_pull() call
        tproxy: copy transparent flag when creating a time wait
        pptp: fix skb leak in pptp_xmit()
        bonding: use local function pointer of bond->recv_probe in bond_handle_frame
        smsc911x: Add support for SMSC LAN89218
        tg3: negate USE_PHYLIB flag check
        netconsole: enable netconsole can make net_device refcnt incorrent
        bluetooth: Properly clone LSM attributes to newly created child connections
        l2tp: fix a potential skb leak in l2tp_xmit_skb()
        bridge: fix hang on removal of bridge via netlink
        x25: Prevent skb overreads when checking call user data
        x25: Handle undersized/fragmented skbs
        x25: Validate incoming call user data lengths
        udplite: fast-path computation of checksum coverage
        IPVS netns shutdown/startup dead-lock
        netfilter: nf_conntrack: fix event flooding in GRE protocol tracker
      505f48b5