1. 09 Jan, 2014 13 commits
  2. 20 Dec, 2013 27 commits
    • Greg Kroah-Hartman's avatar
      Linux 3.10.25 · 095f493c
      Greg Kroah-Hartman authored
      095f493c
    • Roger Quadros's avatar
      ARM: OMAP2+: hwmod: Fix SOFTRESET logic · 5a04f32c
      Roger Quadros authored
      commit 313a76ee upstream.
      
      In _ocp_softreset(), after _set_softreset() + write_sysconfig(),
      the hwmod's sysc_cache will always contain SOFTRESET bit set
      so all further writes to sysconfig using this cache will initiate
      a repeated SOFTRESET e.g. enable_sysc(). This is true for OMAP3 like
      platforms that have RESET_DONE status in the SYSSTATUS register and
      so the the SOFTRESET bit in SYSCONFIG is not automatically cleared.
      It is not a problem for OMAP4 like platforms that indicate RESET
      completion by clearing the SOFTRESET bit in the SYSCONFIG register.
      
      This repeated SOFTRESET is undesired and was the root cause of
      USB host issues on OMAP3 platforms when hwmod was allowed to do the
      SOFTRESET for the USB Host module.
      
      To fix this we clear the SOFTRESET bit and update the sysconfig
      register + sysc_cache using write_sysconfig().
      Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
      Tested-by: Tomi Valkeinen <tomi.valkeinen@ti.com> # Panda, BeagleXM
      [paul@pwsan.com: renamed _clr_softreset() to _clear_softreset()]
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5a04f32c
    • Liu Bo's avatar
      Btrfs: do not run snapshot-aware defragment on error · f5749e37
      Liu Bo authored
      commit 6f519564 upstream.
      
      If something wrong happens in write endio, running snapshot-aware defragment
      can end up with undefined results, maybe a crash, so we should avoid it.
      
      In order to share similar code, this also adds a helper to free the struct for
      snapshot-aware defrag.
      Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
      Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
      Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f5749e37
    • Filipe David Borba Manana's avatar
      Btrfs: fix incorrect inode acl reset · 9436cf97
      Filipe David Borba Manana authored
      commit 8185554d upstream.
      
      When a directory has a default ACL and a subdirectory is created
      under that directory, btrfs_init_acl() is called when the
      subdirectory's inode is created to initialize the inode's ACL
      (inherited from the parent directory) but it was clearing the ACL
      from the inode after setting it if posix_acl_create() returned
      success, instead of clearing it only if it returned an error.
      
      To reproduce this issue:
      
      $ mkfs.btrfs -f /dev/loop0
      $ mount /dev/loop0 /mnt
      $ mkdir /mnt/acl
      $ setfacl -d --set u::rwx,g::rwx,o::- /mnt/acl
      $ getfacl /mnt/acl
      user::rwx
      group::rwx
      other::r-x
      default:user::rwx
      default:group::rwx
      default:other::---
      
      $ mkdir /mnt/acl/dir1
      $ getfacl /mnt/acl/dir1
      user::rwx
      group::rwx
      other::---
      
      After unmounting and mounting again the filesystem, fgetacl returned the
      expected ACL:
      
      $ umount /mnt/acl
      $ mount /dev/loop0 /mnt
      $ getfacl /mnt/acl/dir1
      user::rwx
      group::rwx
      other::---
      default:user::rwx
      default:group::rwx
      default:other::---
      
      Meaning that the underlying xattr was persisted.
      Reported-by: default avatarGiuseppe Fierro <giuseppe@fierro.org>
      Signed-off-by: default avatarFilipe David Borba Manana <fdmanana@gmail.com>
      Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
      Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9436cf97
    • Josef Bacik's avatar
      Btrfs: fix hole check in log_one_extent · b395193e
      Josef Bacik authored
      commit ed9e8af8 upstream.
      
      I added an assert to make sure we were looking up aligned offsets for csums and
      I tripped it when running xfstests.  This is because log_one_extent was checking
      if block_start == 0 for a hole instead of EXTENT_MAP_HOLE.  This worked out fine
      in practice it seems, but it adds a lot of extra work that is uneeded.  With
      this fix I'm no longer tripping my assert.  Thanks,
      Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
      Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b395193e
    • Liu Bo's avatar
      Btrfs: fix memory leak of chunks' extent map · fb5834ff
      Liu Bo authored
      commit 7d3d1744 upstream.
      
      As we're hold a ref on looking up the extent map, we need to drop the ref
      before returning to callers.
      Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
      Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
      Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fb5834ff
    • Greg Kroah-Hartman's avatar
      Revert "net: update consumers of MSG_MORE to recognize MSG_SENDPAGE_NOTLAST" · 2845c362
      Greg Kroah-Hartman authored
      It turns out that commit: d3f7d56a was
      applied to the tree twice, which didn't hurt anything, but it's good to
      fix this up.
      Reported-by: default avatarVeaceslav Falico <veaceslav@falico.eu>
      
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Shawn Landden <shawnlandden@gmail.com>
      Cc: Tom Herbert <therbert@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2845c362
    • Nicolas Dichtel's avatar
      ip6tnl: fix use after free of fb_tnl_dev · 22c3ec55
      Nicolas Dichtel authored
      The upstream commit bb814094 ("ip6tnl: allow to use rtnl ops on fb tunnel")
      (backported into linux-3.10.y) left a bug which was fixed upstream by commit
      1e9f3d6f ("ip6tnl: fix use after free of fb_tnl_dev").
      
      The problem is a bit different in linux-3.10.y, because there is no x-netns
      support (upstream commit 0bd87628 ("ip6tnl: add x-netns support")).
      When ip6_tunnel.ko is unloaded, FB device is deleted by rtnl_link_unregister()
      and then we try to delete it again in ip6_tnl_destroy_tunnels().
      
      This patch removes the second deletion.
      Reported-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Suggested-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      22c3ec55
    • Andy Adamson's avatar
      NFSv4 wait on recovery for async session errors · 39be1c3d
      Andy Adamson authored
      commit 4a82fd7c upstream.
      
      When the state manager is processing the NFS4CLNT_DELEGRETURN flag, session
      draining is off, but DELEGRETURN can still get a session error.
      The async handler calls nfs4_schedule_session_recovery returns -EAGAIN, and
      the DELEGRETURN done then restarts the RPC task in the prepare state.
      With the state manager still processing the NFS4CLNT_DELEGRETURN flag with
      session draining off, these DELEGRETURNs will cycle with errors filling up the
      session slots.
      
      This prevents OPEN reclaims (from nfs_delegation_claim_opens) required by the
      NFS4CLNT_DELEGRETURN state manager processing from completing, hanging the
      state manager in the __rpc_wait_for_completion_task in nfs4_run_open_task
      as seen in this kernel thread dump:
      
      kernel: 4.12.32.53-ma D 0000000000000000     0  3393      2 0x00000000
      kernel: ffff88013995fb60 0000000000000046 ffff880138cc5400 ffff88013a9df140
      kernel: ffff8800000265c0 ffffffff8116eef0 ffff88013fc10080 0000000300000001
      kernel: ffff88013a4ad058 ffff88013995ffd8 000000000000fbc8 ffff88013a4ad058
      kernel: Call Trace:
      kernel: [<ffffffff8116eef0>] ? cache_alloc_refill+0x1c0/0x240
      kernel: [<ffffffffa0358110>] ? rpc_wait_bit_killable+0x0/0xa0 [sunrpc]
      kernel: [<ffffffffa0358152>] rpc_wait_bit_killable+0x42/0xa0 [sunrpc]
      kernel: [<ffffffff8152914f>] __wait_on_bit+0x5f/0x90
      kernel: [<ffffffffa0358110>] ? rpc_wait_bit_killable+0x0/0xa0 [sunrpc]
      kernel: [<ffffffff815291f8>] out_of_line_wait_on_bit+0x78/0x90
      kernel: [<ffffffff8109b520>] ? wake_bit_function+0x0/0x50
      kernel: [<ffffffffa035810d>] __rpc_wait_for_completion_task+0x2d/0x30 [sunrpc]
      kernel: [<ffffffffa040d44c>] nfs4_run_open_task+0x11c/0x160 [nfs]
      kernel: [<ffffffffa04114e7>] nfs4_open_recover_helper+0x87/0x120 [nfs]
      kernel: [<ffffffffa0411646>] nfs4_open_recover+0xc6/0x150 [nfs]
      kernel: [<ffffffffa040cc6f>] ? nfs4_open_recoverdata_alloc+0x2f/0x60 [nfs]
      kernel: [<ffffffffa0414e1a>] nfs4_open_delegation_recall+0x6a/0xa0 [nfs]
      kernel: [<ffffffffa0424020>] nfs_end_delegation_return+0x120/0x2e0 [nfs]
      kernel: [<ffffffff8109580f>] ? queue_work+0x1f/0x30
      kernel: [<ffffffffa0424347>] nfs_client_return_marked_delegations+0xd7/0x110 [nfs]
      kernel: [<ffffffffa04225d8>] nfs4_run_state_manager+0x548/0x620 [nfs]
      kernel: [<ffffffffa0422090>] ? nfs4_run_state_manager+0x0/0x620 [nfs]
      kernel: [<ffffffff8109b0f6>] kthread+0x96/0xa0
      kernel: [<ffffffff8100c20a>] child_rip+0xa/0x20
      kernel: [<ffffffff8109b060>] ? kthread+0x0/0xa0
      kernel: [<ffffffff8100c200>] ? child_rip+0x0/0x20
      
      The state manager can not therefore process the DELEGRETURN session errors.
      Change the async handler to wait for recovery on session errors.
      Signed-off-by: default avatarAndy Adamson <andros@netapp.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      39be1c3d
    • Alan's avatar
      sc1200_wdt: Fix oops · 8a8e917f
      Alan authored
      commit dace8bbf upstream.
      
      If loaded with isapnp = 0 the driver explodes. This is catching
      people out now and then. What should happen in the working case is
      a complete mystery and the code appears terminally confused, but we
      can at least make the error path work properly.
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      Partially-Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=53991Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8a8e917f
    • H Hartley Sweeten's avatar
      staging: comedi: ssv_dnp: use comedi_dio_update_state() · 4d72984a
      H Hartley Sweeten authored
      commit f6b316bc upstream.
      
      Use comedi_dio_update_state() to handle the boilerplate code to update
      the subdevice s->state.
      
      Also, fix a bug where the state of the channels is returned in data[0].
      The comedi core expects it to be returned in data[1].
      Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4d72984a
    • H Hartley Sweeten's avatar
      staging: comedi: drivers: use comedi_dio_update_state() for simple cases · 442ae1bb
      H Hartley Sweeten authored
      commit 97f4289a upstream.
      
      [Split from original patch subject: "staging: comedi: drivers: use
      comedi_dio_update_state() for simple cases"]
      
      Use comedi_dio_update_state() to handle the boilerplate code to update
      the subdevice s->state for simple cases where the hardware is updated
      when any channel is modified.
      
      Also, fix a bug in the amplc_pc263 and amplc_pci263 drivers where the
      current state is not returned in data[1].
      Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      442ae1bb
    • Ian Abbott's avatar
      staging: comedi: pcmuio: fix possible NULL deref on detach · bc049656
      Ian Abbott authored
      commit 2fd2bdfc upstream.
      
      pcmuio_detach() is called by the comedi core even if pcmuio_attach()
      returned an error, so `dev->private` might be `NULL`.  Check for that
      before dereferencing it.
      
      Also, as pointed out by Dan Carpenter, there is no need to check the
      pointer passed to `kfree()` is non-NULL, so remove that check.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bc049656
    • Ben Segall's avatar
      sched: Avoid throttle_cfs_rq() racing with period_timer stopping · 5232a719
      Ben Segall authored
      commit f9f9ffc2 upstream.
      
      throttle_cfs_rq() doesn't check to make sure that period_timer is running,
      and while update_curr/assign_cfs_runtime does, a concurrently running
      period_timer on another cpu could cancel itself between this cpu's
      update_curr and throttle_cfs_rq(). If there are no other cfs_rqs running
      in the tg to restart the timer, this causes the cfs_rq to be stranded
      forever.
      
      Fix this by calling __start_cfs_bandwidth() in throttle if the timer is
      inactive.
      
      (Also add some sched_debug lines for cfs_bandwidth.)
      
      Tested: make a run/sleep task in a cgroup, loop switching the cgroup
      between 1ms/100ms quota and unlimited, checking for timer_active=0 and
      throttled=1 as a failure. With the throttle_cfs_rq() change commented out
      this fails, with the full patch it passes.
      Signed-off-by: default avatarBen Segall <bsegall@google.com>
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: pjt@google.com
      Link: http://lkml.kernel.org/r/20131016181632.22647.84174.stgit@sword-of-the-dawn.mtv.corp.google.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Chris J Arges <chris.j.arges@canonical.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5232a719
    • Hans Verkuil's avatar
      cxd2820r_core: fix sparse warnings · a5eec39a
      Hans Verkuil authored
      commit 0db3fa27 upstream.
      
      drivers/media/dvb-frontends/cxd2820r_core.c:34:32: error: cannot size expression
      drivers/media/dvb-frontends/cxd2820r_core.c:68:32: error: cannot size expression
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: default avatarAntti Palosaari <crope@iki.fi>
      Reviewed-by: default avatarAntti Palosaari <crope@iki.fi>
      Reviewed-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
      Cc: Frederik Himpe <fhimpe@telenet.be>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a5eec39a
    • Helge Deller's avatar
      nfs: fix do_div() warning by instead using sector_div() · 0f8285ad
      Helge Deller authored
      commit 3873d064 upstream.
      
      When compiling a 32bit kernel with CONFIG_LBDAF=n the compiler complains like
      shown below.  Fix this warning by instead using sector_div() which is provided
      by the kernel.h header file.
      
      fs/nfs/blocklayout/extents.c: In function ‘normalize’:
      include/asm-generic/div64.h:43:28: warning: comparison of distinct pointer types lacks a cast [enabled by default]
      fs/nfs/blocklayout/extents.c:47:13: note: in expansion of macro ‘do_div’
      nfs/blocklayout/extents.c:47:2: warning: right shift count >= width of type [enabled by default]
      fs/nfs/blocklayout/extents.c:47:2: warning: passing argument 1 of ‘__div64_32’ from incompatible pointer type [enabled by default]
      include/asm-generic/div64.h:35:17: note: expected ‘uint64_t *’ but argument is of type ‘sector_t *’
       extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0f8285ad
    • Joe Thornber's avatar
      dm thin: switch to read only mode if a mapping insert fails · f4cf4b1b
      Joe Thornber authored
      commit fafc7a81 upstream.
      
      Switch the thin pool to read-only mode when dm_thin_insert_block() fails
      since there is little reason to expect the cause of the failure to be
      resolved without further action by user space.
      
      This issue was noticed with the device-mapper-test-suite using:
      dmtest run --suite thin-provisioning -n /exhausting_metadata_space_causes_fail_mode/
      
      The quantity of errors logged in this case must be reduced.
      
      before patch:
      
      device-mapper: thin: dm_thin_insert_block() failed
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: thin: dm_thin_insert_block() failed
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: thin: dm_thin_insert_block() failed
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: thin: dm_thin_insert_block() failed
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: thin: dm_thin_insert_block() failed
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: thin: dm_thin_insert_block() failed
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: thin: dm_thin_insert_block() failed
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: thin: dm_thin_insert_block() failed
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: thin: dm_thin_insert_block() failed
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: thin: dm_thin_insert_block() failed
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: space map metadata: unable to allocate new metadata block
      <snip ... these repeat for a long while ... >
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: space map common: dm_tm_shadow_block() failed
      device-mapper: thin: 253:4: no free metadata space available.
      device-mapper: thin: 253:4: switching pool to read-only mode
      
      after patch:
      
      device-mapper: space map metadata: unable to allocate new metadata block
      device-mapper: thin: 253:4: dm_thin_insert_block() failed: error = -28
      device-mapper: thin: 253:4: switching pool to read-only mode
      Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f4cf4b1b
    • Mikulas Patocka's avatar
      dm table: fail dm_table_create on dm_round_up overflow · 135949c1
      Mikulas Patocka authored
      commit 5b2d0657 upstream.
      
      The dm_round_up function may overflow to zero.  In this case,
      dm_table_create() must fail rather than go on to allocate an empty array
      with alloc_targets().
      
      This fixes a possible memory corruption that could be caused by passing
      too large a number in "param->target_count".
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      135949c1
    • Mike Snitzer's avatar
      dm space map metadata: return on failure in sm_metadata_new_block · 2c54d62a
      Mike Snitzer authored
      commit f62b6b8f upstream.
      
      Commit 2fc48021 ("dm persistent
      metadata: add space map threshold callback") introduced a regression
      to the metadata block allocation path that resulted in errors being
      ignored.  This regression was uncovered by running the following
      device-mapper-test-suite test:
      dmtest run --suite thin-provisioning -n /exhausting_metadata_space_causes_fail_mode/
      
      The ignored error codes in sm_metadata_new_block() could crash the
      kernel through use of either the dm-thin or dm-cache targets, e.g.:
      
      device-mapper: thin: 253:4: reached low water mark for metadata device: sending event.
      device-mapper: space map metadata: unable to allocate new metadata block
      general protection fault: 0000 [#1] SMP
      ...
      Workqueue: dm-thin do_worker [dm_thin_pool]
      task: ffff880035ce2ab0 ti: ffff88021a054000 task.ti: ffff88021a054000
      RIP: 0010:[<ffffffffa0331385>]  [<ffffffffa0331385>] metadata_ll_load_ie+0x15/0x30 [dm_persistent_data]
      RSP: 0018:ffff88021a055a68  EFLAGS: 00010202
      RAX: 003fc8243d212ba0 RBX: ffff88021a780070 RCX: ffff88021a055a78
      RDX: ffff88021a055a78 RSI: 0040402222a92a80 RDI: ffff88021a780070
      RBP: ffff88021a055a68 R08: ffff88021a055ba4 R09: 0000000000000010
      R10: 0000000000000000 R11: 00000002a02e1000 R12: ffff88021a055ad4
      R13: 0000000000000598 R14: ffffffffa0338470 R15: ffff88021a055ba4
      FS:  0000000000000000(0000) GS:ffff88033fca0000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 00007f467c0291b8 CR3: 0000000001a0b000 CR4: 00000000000007e0
      Stack:
       ffff88021a055ab8 ffffffffa0332020 ffff88021a055b30 0000000000000001
       ffff88021a055b30 0000000000000000 ffff88021a055b18 0000000000000000
       ffff88021a055ba4 ffff88021a055b98 ffff88021a055ae8 ffffffffa033304c
      Call Trace:
       [<ffffffffa0332020>] sm_ll_lookup_bitmap+0x40/0xa0 [dm_persistent_data]
       [<ffffffffa033304c>] sm_metadata_count_is_more_than_one+0x8c/0xc0 [dm_persistent_data]
       [<ffffffffa0333825>] dm_tm_shadow_block+0x65/0x110 [dm_persistent_data]
       [<ffffffffa0331b00>] sm_ll_mutate+0x80/0x300 [dm_persistent_data]
       [<ffffffffa0330e60>] ? set_ref_count+0x10/0x10 [dm_persistent_data]
       [<ffffffffa0331dba>] sm_ll_inc+0x1a/0x20 [dm_persistent_data]
       [<ffffffffa0332270>] sm_disk_new_block+0x60/0x80 [dm_persistent_data]
       [<ffffffff81520036>] ? down_write+0x16/0x40
       [<ffffffffa001e5c4>] dm_pool_alloc_data_block+0x54/0x80 [dm_thin_pool]
       [<ffffffffa001b23c>] alloc_data_block+0x9c/0x130 [dm_thin_pool]
       [<ffffffffa001c27e>] provision_block+0x4e/0x180 [dm_thin_pool]
       [<ffffffffa001fe9a>] ? dm_thin_find_block+0x6a/0x110 [dm_thin_pool]
       [<ffffffffa001c57a>] process_bio+0x1ca/0x1f0 [dm_thin_pool]
       [<ffffffff8111e2ed>] ? mempool_free+0x8d/0xa0
       [<ffffffffa001d755>] process_deferred_bios+0xc5/0x230 [dm_thin_pool]
       [<ffffffffa001d911>] do_worker+0x51/0x60 [dm_thin_pool]
       [<ffffffff81067872>] process_one_work+0x182/0x3b0
       [<ffffffff81068c90>] worker_thread+0x120/0x3a0
       [<ffffffff81068b70>] ? manage_workers+0x160/0x160
       [<ffffffff8106eb2e>] kthread+0xce/0xe0
       [<ffffffff8106ea60>] ? kthread_freezable_should_stop+0x70/0x70
       [<ffffffff8152af6c>] ret_from_fork+0x7c/0xb0
       [<ffffffff8106ea60>] ? kthread_freezable_should_stop+0x70/0x70
       [<ffffffff8152af6c>] ret_from_fork+0x7c/0xb0
       [<ffffffff8106ea60>] ? kthread_freezable_should_stop+0x70/0x70
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Acked-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2c54d62a
    • Mikulas Patocka's avatar
      dm delay: fix a possible deadlock due to shared workqueue · 729d38d1
      Mikulas Patocka authored
      commit 718822c1 upstream.
      
      The dm-delay target uses a shared workqueue for multiple instances.  This
      can cause deadlock if two or more dm-delay targets are stacked on the top
      of each other.
      
      This patch changes dm-delay to use a per-instance workqueue.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      729d38d1
    • Joe Thornber's avatar
      dm array: fix a reference counting bug in shadow_ablock · 1cfc4552
      Joe Thornber authored
      commit ed9571f0 upstream.
      
      An old array block could have its reference count decremented below
      zero when it is being replaced in the btree by a new array block.
      
      The fix is to increment the old ablock's reference count just before
      inserting a new ablock into the btree.
      Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1cfc4552
    • Mikulas Patocka's avatar
      dm snapshot: avoid snapshot space leak on crash · 20d68d38
      Mikulas Patocka authored
      commit 230c83af upstream.
      
      There is a possible leak of snapshot space in case of crash.
      
      The reason for space leaking is that chunks in the snapshot device are
      allocated sequentially, but they are finished (and stored in the metadata)
      out of order, depending on the order in which copying finished.
      
      For example, supposed that the metadata contains the following records
      SUPERBLOCK
      METADATA (blocks 0 ... 250)
      DATA 0
      DATA 1
      DATA 2
      ...
      DATA 250
      
      Now suppose that you allocate 10 new data blocks 251-260. Suppose that
      copying of these blocks finish out of order (block 260 finished first
      and the block 251 finished last). Now, the snapshot device looks like
      this:
      SUPERBLOCK
      METADATA (blocks 0 ... 250, 260, 259, 258, 257, 256)
      DATA 0
      DATA 1
      DATA 2
      ...
      DATA 250
      DATA 251
      DATA 252
      DATA 253
      DATA 254
      DATA 255
      METADATA (blocks 255, 254, 253, 252, 251)
      DATA 256
      DATA 257
      DATA 258
      DATA 259
      DATA 260
      
      Now, if the machine crashes after writing the first metadata block but
      before writing the second metadata block, the space for areas DATA 250-255
      is leaked, it contains no valid data and it will never be used in the
      future.
      
      This patch makes dm-snapshot complete exceptions in the same order they
      were allocated, thus fixing this bug.
      
      Note: when backporting this patch to the stable kernel, change the version
      field in the following way:
      * if version in the stable kernel is {1, 11, 1}, change it to {1, 12, 0}
      * if version in the stable kernel is {1, 10, 0} or {1, 10, 1}, change it
        to {1, 10, 2}
      Userspace reads the version to determine if the bug was fixed, so the
      version change is needed.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      20d68d38
    • Mikulas Patocka's avatar
      dm bufio: initialize read-only module parameters · d468a287
      Mikulas Patocka authored
      commit 4cb57ab4 upstream.
      
      Some module parameters in dm-bufio are read-only. These parameters
      inform the user about memory consumption. They are not supposed to be
      changed by the user.
      
      However, despite being read-only, these parameters can be set on
      modprobe or insmod command line, for example:
      modprobe dm-bufio current_allocated_bytes=12345
      
      The kernel doesn't expect that these variables can be non-zero at module
      initialization and if the user sets them, it results in BUG.
      
      This patch initializes the variables in the module init routine, so that
      user-supplied values are ignored.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d468a287
    • David Sterba's avatar
      btrfs: call mnt_drop_write after interrupted subvol deletion · 89ec7522
      David Sterba authored
      commit e43f998e upstream.
      
      If btrfs_ioctl_snap_destroy blocks on the mutex and the process is
      killed, mnt_write count is unbalanced and leads to unmountable
      filesystem.
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      89ec7522
    • Dan Carpenter's avatar
      Btrfs: fix access_ok() check in btrfs_ioctl_send() · 6b047827
      Dan Carpenter authored
      commit 700ff4f0 upstream.
      
      The closing parenthesis is in the wrong place.  We want to check
      "sizeof(*arg->clone_sources) * arg->clone_sources_count" instead of
      "sizeof(*arg->clone_sources * arg->clone_sources_count)".
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarJie Liu <jeff.liu@oracle.com>
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6b047827
    • Dan Carpenter's avatar
      media: af9035: unlock on error in af9035_i2c_master_xfer() · 89e6d5d2
      Dan Carpenter authored
      commit 3189ef02 upstream.
      
      We introduced a couple new error paths which are missing unlocks.
      Fixes: 7760e148 ('[media] af9035: Don't use dynamic static allocation')
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: default avatarAntti Palosaari <crope@iki.fi>
      Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      89e6d5d2
    • Antti Palosaari's avatar
      media: af9035: add [0413:6a05] Leadtek WinFast DTV Dongle Dual · 53ef7579
      Antti Palosaari authored
      commit 0c413d10 upstream.
      
      It is IT9135 dual design.
      Thanks to Michael Piko for reporting that!
      Reported-by: default avatarMichael Piko <michael@piko.com.au>
      Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
      Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      53ef7579