]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
13 years agoMerge remote-tracking branch 'sound/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 02:03:53 +0000 (12:03 +1000)]
Merge remote-tracking branch 'sound/for-next'

13 years agoMerge remote-tracking branch 'l2-mtd/master'
Stephen Rothwell [Thu, 28 Jul 2011 02:02:25 +0000 (12:02 +1000)]
Merge remote-tracking branch 'l2-mtd/master'

Conflicts:
drivers/mtd/maps/pxa2xx-flash.c

13 years agoMerge remote-tracking branch 'bluetooth/master'
Stephen Rothwell [Thu, 28 Jul 2011 02:01:01 +0000 (12:01 +1000)]
Merge remote-tracking branch 'bluetooth/master'

13 years agoMerge remote-tracking branch 'wireless/master'
Stephen Rothwell [Thu, 28 Jul 2011 01:59:39 +0000 (11:59 +1000)]
Merge remote-tracking branch 'wireless/master'

13 years agoMerge remote-tracking branch 'async_tx/next'
Stephen Rothwell [Thu, 28 Jul 2011 01:56:42 +0000 (11:56 +1000)]
Merge remote-tracking branch 'async_tx/next'

13 years agoMerge remote-tracking branch 'slave-dma/next'
Stephen Rothwell [Thu, 28 Jul 2011 01:55:15 +0000 (11:55 +1000)]
Merge remote-tracking branch 'slave-dma/next'

Conflicts:
drivers/dma/mv_xor.c

13 years agoMerge remote-tracking branch 'iscsi-target/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:53:57 +0000 (11:53 +1000)]
Merge remote-tracking branch 'iscsi-target/for-next'

13 years agoMerge remote-tracking branch 'scsi/master'
Stephen Rothwell [Thu, 28 Jul 2011 01:52:30 +0000 (11:52 +1000)]
Merge remote-tracking branch 'scsi/master'

13 years agoMerge remote-tracking branch 'ibft/master'
Stephen Rothwell [Thu, 28 Jul 2011 01:52:26 +0000 (11:52 +1000)]
Merge remote-tracking branch 'ibft/master'

13 years agoMerge remote-tracking branch 'swiotlb/master'
Stephen Rothwell [Thu, 28 Jul 2011 01:52:21 +0000 (11:52 +1000)]
Merge remote-tracking branch 'swiotlb/master'

13 years agoMerge remote-tracking branch 'cpupowerutils/master'
Stephen Rothwell [Thu, 28 Jul 2011 01:50:47 +0000 (11:50 +1000)]
Merge remote-tracking branch 'cpupowerutils/master'

13 years agoMerge remote-tracking branch 'powertools/tools-test'
Stephen Rothwell [Thu, 28 Jul 2011 01:49:29 +0000 (11:49 +1000)]
Merge remote-tracking branch 'powertools/tools-test'

13 years agoMerge remote-tracking branch 'idle-test/idle-test'
Stephen Rothwell [Thu, 28 Jul 2011 01:48:11 +0000 (11:48 +1000)]
Merge remote-tracking branch 'idle-test/idle-test'

13 years agoMerge remote-tracking branch 'acpi/test'
Stephen Rothwell [Thu, 28 Jul 2011 01:41:54 +0000 (11:41 +1000)]
Merge remote-tracking branch 'acpi/test'

Conflicts:
arch/ia64/Kconfig
arch/powerpc/Kconfig
arch/x86/Kconfig
lib/Kconfig
lib/Makefile

13 years agoMerge remote-tracking branch 'kconfig/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:41:39 +0000 (11:41 +1000)]
Merge remote-tracking branch 'kconfig/for-next'

13 years agoMerge remote-tracking branch 'kbuild/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:40:07 +0000 (11:40 +1000)]
Merge remote-tracking branch 'kbuild/for-next'

13 years agoMerge remote-tracking branch 'v4l-dvb/master'
Stephen Rothwell [Thu, 28 Jul 2011 01:38:20 +0000 (11:38 +1000)]
Merge remote-tracking branch 'v4l-dvb/master'

Conflicts:
Documentation/feature-removal-schedule.txt
drivers/staging/tm6000/tm6000-alsa.c

13 years agoMerge branch 'quilt/kernel-doc'
Stephen Rothwell [Thu, 28 Jul 2011 01:37:01 +0000 (11:37 +1000)]
Merge branch 'quilt/kernel-doc'

13 years agoMerge remote-tracking branch 'hwmon-staging/hwmon-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:35:45 +0000 (11:35 +1000)]
Merge remote-tracking branch 'hwmon-staging/hwmon-next'

13 years agoMerge remote-tracking branch 'hid/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:35:34 +0000 (11:35 +1000)]
Merge remote-tracking branch 'hid/for-next'

13 years agoMerge remote-tracking branch 'pci/linux-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:32:31 +0000 (11:32 +1000)]
Merge remote-tracking branch 'pci/linux-next'

13 years agoMerge remote-tracking branch 'vfs/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:31:15 +0000 (11:31 +1000)]
Merge remote-tracking branch 'vfs/for-next'

13 years agoMerge remote-tracking branch 'xfs/master'
Stephen Rothwell [Thu, 28 Jul 2011 01:29:52 +0000 (11:29 +1000)]
Merge remote-tracking branch 'xfs/master'

13 years agoMerge remote-tracking branch 'ocfs2/linux-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:28:25 +0000 (11:28 +1000)]
Merge remote-tracking branch 'ocfs2/linux-next'

13 years agoMerge remote-tracking branch 'logfs/master'
Stephen Rothwell [Thu, 28 Jul 2011 01:28:15 +0000 (11:28 +1000)]
Merge remote-tracking branch 'logfs/master'

Conflicts:
fs/logfs/logfs.h

13 years agoMerge remote-tracking branch 'gfs2/master'
Stephen Rothwell [Thu, 28 Jul 2011 01:26:35 +0000 (11:26 +1000)]
Merge remote-tracking branch 'gfs2/master'

13 years agoMerge remote-tracking branch 'ext4/dev'
Stephen Rothwell [Thu, 28 Jul 2011 01:25:05 +0000 (11:25 +1000)]
Merge remote-tracking branch 'ext4/dev'

Conflicts:
fs/ext4/inode.c

13 years agoMerge remote-tracking branch 'ecryptfs/next'
Stephen Rothwell [Thu, 28 Jul 2011 01:24:55 +0000 (11:24 +1000)]
Merge remote-tracking branch 'ecryptfs/next'

13 years agoMerge remote-tracking branch 'ceph/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:24:47 +0000 (11:24 +1000)]
Merge remote-tracking branch 'ceph/for-next'

Conflicts:
fs/ceph/export.c

13 years agoMerge remote-tracking branch 'xtensa/master'
Stephen Rothwell [Thu, 28 Jul 2011 01:23:23 +0000 (11:23 +1000)]
Merge remote-tracking branch 'xtensa/master'

Conflicts:
arch/xtensa/configs/iss_defconfig

13 years agoMerge remote-tracking branch 'unicore32/unicore32'
Stephen Rothwell [Thu, 28 Jul 2011 01:21:43 +0000 (11:21 +1000)]
Merge remote-tracking branch 'unicore32/unicore32'

13 years agoMerge remote-tracking branch 'tile/master'
Stephen Rothwell [Thu, 28 Jul 2011 01:20:30 +0000 (11:20 +1000)]
Merge remote-tracking branch 'tile/master'

13 years agoMerge remote-tracking branch 'rmobile/rmobile-latest'
Stephen Rothwell [Thu, 28 Jul 2011 01:19:16 +0000 (11:19 +1000)]
Merge remote-tracking branch 'rmobile/rmobile-latest'

13 years agoMerge remote-tracking branch 'sh/sh-latest'
Stephen Rothwell [Thu, 28 Jul 2011 01:17:52 +0000 (11:17 +1000)]
Merge remote-tracking branch 'sh/sh-latest'

13 years agoMerge remote-tracking branch 's390/features'
Stephen Rothwell [Thu, 28 Jul 2011 01:16:39 +0000 (11:16 +1000)]
Merge remote-tracking branch 's390/features'

13 years agoMerge remote-tracking branch '52xx-and-virtex/powerpc/next'
Stephen Rothwell [Thu, 28 Jul 2011 01:15:20 +0000 (11:15 +1000)]
Merge remote-tracking branch '52xx-and-virtex/powerpc/next'

13 years agoMerge remote-tracking branch 'parisc/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:14:02 +0000 (11:14 +1000)]
Merge remote-tracking branch 'parisc/for-next'

13 years agoMerge remote-tracking branch 'm68knommu/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:13:56 +0000 (11:13 +1000)]
Merge remote-tracking branch 'm68knommu/for-next'

13 years agoMerge remote-tracking branch 'm68k/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:07:49 +0000 (11:07 +1000)]
Merge remote-tracking branch 'm68k/for-next'

13 years agoMerge remote-tracking branch 'ia64/test'
Stephen Rothwell [Thu, 28 Jul 2011 01:06:24 +0000 (11:06 +1000)]
Merge remote-tracking branch 'ia64/test'

13 years agoMerge remote-tracking branch 'cris/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:05:01 +0000 (11:05 +1000)]
Merge remote-tracking branch 'cris/for-next'

13 years agoMerge remote-tracking branch 'ux500-core/ux500-core'
Stephen Rothwell [Thu, 28 Jul 2011 01:04:56 +0000 (11:04 +1000)]
Merge remote-tracking branch 'ux500-core/ux500-core'

13 years agoMerge remote-tracking branch 's5p/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:03:43 +0000 (11:03 +1000)]
Merge remote-tracking branch 's5p/for-next'

Conflicts:
arch/arm/mach-exynos4/Kconfig
arch/arm/mach-exynos4/mach-smdkc210.c

13 years agoMerge remote-tracking branch 'msm/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:02:13 +0000 (11:02 +1000)]
Merge remote-tracking branch 'msm/for-next'

13 years agoMerge remote-tracking branch 'i.MX/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:02:08 +0000 (11:02 +1000)]
Merge remote-tracking branch 'i.MX/for-next'

Conflicts:
arch/arm/mach-imx/mach-mx27_3ds.c
arch/arm/mach-imx/mm-imx1.c
arch/arm/mach-imx/mm-imx21.c
arch/arm/mach-imx/mm-imx25.c
arch/arm/mach-imx/mm-imx27.c
arch/arm/mach-imx/mm-imx31.c
arch/arm/mach-imx/mm-imx35.c
arch/arm/mach-mx5/mm.c

13 years agoMerge remote-tracking branch 'arm-soc/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 01:02:00 +0000 (11:02 +1000)]
Merge remote-tracking branch 'arm-soc/for-next'

Conflicts:
arch/arm/mach-exynos4/pm.c
arch/arm/mach-omap2/cm-regbits-44xx.h

13 years agoMerge remote-tracking branch 'arm-lpae/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 00:55:45 +0000 (10:55 +1000)]
Merge remote-tracking branch 'arm-lpae/for-next'

Conflicts:
arch/arm/include/asm/pgalloc.h
arch/arm/include/asm/pgtable.h
arch/arm/include/asm/proc-fns.h
arch/arm/include/asm/tlb.h
arch/arm/mm/context.c
arch/arm/mm/proc-v7.S

13 years agoMerge remote-tracking branch 'arm/for-next'
Stephen Rothwell [Thu, 28 Jul 2011 00:54:27 +0000 (10:54 +1000)]
Merge remote-tracking branch 'arm/for-next'

13 years agoMerge remote-tracking branch 'devicetree-current/devicetree/merge'
Stephen Rothwell [Thu, 28 Jul 2011 00:51:21 +0000 (10:51 +1000)]
Merge remote-tracking branch 'devicetree-current/devicetree/merge'

13 years agoMerge remote-tracking branch 'fbdev-current/fbdev-fixes-for-linus'
Stephen Rothwell [Thu, 28 Jul 2011 00:51:18 +0000 (10:51 +1000)]
Merge remote-tracking branch 'fbdev-current/fbdev-fixes-for-linus'

13 years agoMerge remote-tracking branch 'net-current/master'
Stephen Rothwell [Thu, 28 Jul 2011 00:50:55 +0000 (10:50 +1000)]
Merge remote-tracking branch 'net-current/master'

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs...
Linus Torvalds [Wed, 27 Jul 2011 23:43:52 +0000 (16:43 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: make sure reserve_metadata_bytes doesn't leak out strange errors
  Btrfs: use the commit_root for reading free_space_inode crcs
  Btrfs: reduce extent_state lock contention for metadata
  Btrfs: remove lockdep magic from btrfs_next_leaf
  Btrfs: make a lockdep class for each root
  Btrfs: switch the btrfs tree locks to reader/writer
  Btrfs: fix deadlock when throttling transactions
  Btrfs: stop using highmem for extent_buffers
  Btrfs: fix BUG_ON() caused by ENOSPC when relocating space
  Btrfs: tag pages for writeback in sync
  Btrfs: fix enospc problems with delalloc
  Btrfs: don't flush delalloc arbitrarily
  Btrfs: use find_or_create_page instead of grab_cache_page
  Btrfs: use a worker thread to do caching
  Btrfs: fix how we merge extent states and deal with cached states
  Btrfs: use the normal checksumming infrastructure for free space cache
  Btrfs: serialize flushers in reserve_metadata_bytes
  Btrfs: do transaction space reservation before joining the transaction
  Btrfs: try to only do one btrfs_search_slot in do_setxattr

13 years agoMerge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Wed, 27 Jul 2011 20:41:51 +0000 (13:41 -0700)]
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: optimize the negative xattr caching
  xfs: prevent against ioend livelocks in xfs_file_fsync
  xfs: flag all buffers as metadata
  xfs: encapsulate a block of debug code

13 years agoMAINTAINERS: Add target-devel list for drivers/target/
Nicholas Bellinger [Wed, 27 Jul 2011 20:21:15 +0000 (20:21 +0000)]
MAINTAINERS: Add target-devel list for drivers/target/

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agoiscsi-target: Fix CONFIG_SMP=n and CONFIG_MODULES=n build failure
Nicholas Bellinger [Wed, 27 Jul 2011 20:13:22 +0000 (20:13 +0000)]
iscsi-target: Fix CONFIG_SMP=n and CONFIG_MODULES=n build failure

This patch fixes the following CONFIG_SMP=n and CONFIG_MODULES=n build
failure, because iscsit_thread_get_cpumask() is defined as a macro in
iscsi_target.c, but needed by iscsi_target_login.c

drivers/built-in.o: In function `iscsi_post_login_handler':
iscsi_target_login.c:(.text+0x13a315): undefined reference to `iscsit_thread_get_cpumask'
iscsi_target_login.c:(.text+0x13a4b4): undefined reference to `iscsit_thread_get_cpumask'
make: *** [.tmp_vmlinux1] Error 1

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agoiscsi-target: Fix snprintf usage with MAX_PORTAL_LEN
Nicholas Bellinger [Wed, 27 Jul 2011 19:37:03 +0000 (12:37 -0700)]
iscsi-target: Fix snprintf usage with MAX_PORTAL_LEN

This patch makes lio_target_call_addnptotpg() use sprintf() with
MAX_PORTAL_LEN + 1 to address the following smatch warning:

drivers/target/iscsi/iscsi_target_configfs.c +184 lio_target_call_addnptotpg(21)
        error: snprintf() chops off the last chars of 'name': 257 vs 256

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agoiscsi-target: Fix uninitialized usage of cmd->pad_bytes
Nicholas Bellinger [Wed, 27 Jul 2011 19:16:22 +0000 (12:16 -0700)]
iscsi-target: Fix uninitialized usage of cmd->pad_bytes

This patch fixes an uninitialized usage of cmd->pad_bytes inside of
iscsit_handle_text_cmd() introduced during a v4.1 change to use cmd
members instead of local pad_bytes variables.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agoiscsi-target: strlen() doesn't count the terminator
Dan Carpenter [Wed, 27 Jul 2011 11:11:43 +0000 (14:11 +0300)]
iscsi-target: strlen() doesn't count the terminator

This patch fixes an off by one check in iscsit_add_tiqn() because the
NULL terminator isn't taken into consideration.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agoiscsi-target: Fix NULL dereference on allocation failure
Dan Carpenter [Wed, 27 Jul 2011 09:58:17 +0000 (12:58 +0300)]
iscsi-target: Fix NULL dereference on allocation failure

This patch fixes a bug in iscsi_target_init_negotiation() where
the "goto out" path dereferences "login" which is NULL upon a
memory allocation failure.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agoMerge branch 'nfs-for-3.1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Linus Torvalds [Wed, 27 Jul 2011 20:23:02 +0000 (13:23 -0700)]
Merge branch 'nfs-for-3.1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

* 'nfs-for-3.1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (44 commits)
  NFSv4: Don't use the delegation->inode in nfs_mark_return_delegation()
  nfs: don't use d_move in nfs_async_rename_done
  RDMA: Increasing RPCRDMA_MAX_DATA_SEGS
  SUNRPC: Replace xprt->resend and xprt->sending with a priority queue
  SUNRPC: Allow caller of rpc_sleep_on() to select priority levels
  SUNRPC: Support dynamic slot allocation for TCP connections
  SUNRPC: Clean up the slot table allocation
  SUNRPC: Initalise the struct xprt upon allocation
  SUNRPC: Ensure that we grab the XPRT_LOCK before calling xprt_alloc_slot
  pnfs: simplify pnfs files module autoloading
  nfs: document nfsv4 sillyrename issues
  NFS: Convert nfs4_set_ds_client to EXPORT_SYMBOL_GPL
  SUNRPC: Convert the backchannel exports to EXPORT_SYMBOL_GPL
  SUNRPC: sunrpc should not explicitly depend on NFS config options
  NFS: Clean up - simplify the switch to read/write-through-MDS
  NFS: Move the pnfs write code into pnfs.c
  NFS: Move the pnfs read code into pnfs.c
  NFS: Allow the nfs_pageio_descriptor to signal that a re-coalesce is needed
  NFS: Use the nfs_pageio_descriptor->pg_bsize in the read/write request
  NFS: Cache rpc_ops in struct nfs_pageio_descriptor
  ...

13 years agoMerge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target...
Linus Torvalds [Wed, 27 Jul 2011 20:21:40 +0000 (13:21 -0700)]
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  target: Convert to DIV_ROUND_UP_SECTOR_T usage for sectors / dev_max_sectors
  kernel.h: Add DIV_ROUND_UP_ULL and DIV_ROUND_UP_SECTOR_T macro usage
  iscsi-target: Add iSCSI fabric support for target v4.1
  iscsi: Add Serial Number Arithmetic LT and GT into iscsi_proto.h
  iscsi: Use struct scsi_lun in iscsi structs instead of u8[8]
  iscsi: Resolve iscsi_proto.h naming conflicts with drivers/target/iscsi

13 years agoMerge branch 'integration' into for-linus
Chris Mason [Wed, 27 Jul 2011 20:13:10 +0000 (16:13 -0400)]
Merge branch 'integration' into for-linus

13 years agoBtrfs: make sure reserve_metadata_bytes doesn't leak out strange errors
Chris Mason [Wed, 27 Jul 2011 19:57:44 +0000 (15:57 -0400)]
Btrfs: make sure reserve_metadata_bytes doesn't leak out strange errors

The btrfs transaction code will return any errors that come from
reserve_metadata_bytes.  We need to make sure we don't return funny
things like 1 or EAGAIN.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoGFS2: Split data write & wait in fsync
Steven Whitehouse [Wed, 27 Jul 2011 09:58:48 +0000 (10:58 +0100)]
GFS2: Split data write & wait in fsync

Now that the data writing is part of fsync proper, we can split
the waiting part out and do it later on. This reduces the
number of waits that we do during fsync on average.

There is also no need to take the i_mutex unless we are flushing
metadata to disk, so we can move that to within the metadata
flushing code.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
13 years agoGFS2: Clean up dir hash table reading
Steven Whitehouse [Tue, 26 Jul 2011 08:17:28 +0000 (09:17 +0100)]
GFS2: Clean up dir hash table reading

Since there is now only a single caller to gfs2_dir_read_data()
and it has a number of constant arguments, we can factor
those out. Also some tests relating to the inode size were
being done twice.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
13 years agosignals: sys_ssetmask/sys_rt_sigsuspend should use set_current_blocked()
Oleg Nesterov [Wed, 27 Jul 2011 19:49:44 +0000 (12:49 -0700)]
signals: sys_ssetmask/sys_rt_sigsuspend should use set_current_blocked()

sys_ssetmask(), sys_rt_sigsuspend() and compat_sys_rt_sigsuspend()
change ->blocked directly.  This is not correct, see the changelog in
e6fa16ab "signal: sigprocmask() should do retarget_shared_pending()"

Change them to use set_current_blocked().

Another change is that now we are doing ->saved_sigmask = ->blocked
lockless, it doesn't make any sense to do this under ->siglock.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Matt Fleming <matt.fleming@linux.intel.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agosparc: rename atomic_add_unless
Stephen Rothwell [Wed, 27 Jul 2011 19:49:44 +0000 (12:49 -0700)]
sparc: rename atomic_add_unless

Should have been done in commit 1af08a1407f4 ("This is in preparation
for more generic atomic").

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Arun Sharma <asharma@fb.com>
Cc: David Miller <davem@davemloft.net>
Cc: "Hans-Christian Egtvedt" <hans-christian.egtvedt@atmel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoproc: make struct proc_dir_entry::name a terminal array rather than a pointer
David Howells [Wed, 27 Jul 2011 18:47:03 +0000 (21:47 +0300)]
proc: make struct proc_dir_entry::name a terminal array rather than a pointer

Since __proc_create() appends the name it is given to the end of the PDE
structure that it allocates, there isn't a need to store a name pointer.
Instead we can just replace the name pointer with a terminal char array of
_unspecified_ length.  The compiler will simply append the string to statically
defined variables of PDE type overlapping any hole at the end of the structure
and, unlike specifying an explicitly _zero_ length array, won't give a warning
if you try to statically initialise it with a string of more than zero length.

Also, whilst we're at it:

 (1) Move namelen to end just prior to name and reduce it to a single byte
     (name shouldn't be longer than NAME_MAX).

 (2) Move pde_unload_lock two places further on so that if it's four bytes in
     size on a 64-bit machine, it won't cause an unused hole in the PDE struct.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge branch 'fix/misc' into for-next
Takashi Iwai [Wed, 27 Jul 2011 17:16:30 +0000 (19:16 +0200)]
Merge branch 'fix/misc' into for-next

13 years agosound: oss: rename local change_bits to avoid powerpc bitsops.h definition
Andy Whitcroft [Wed, 27 Jul 2011 16:48:41 +0000 (17:48 +0100)]
sound: oss: rename local change_bits to avoid powerpc bitsops.h definition

This collides with powerpc exported functions from bitops.h.  Rename the
local copy in the oss soundblaster mixer and ad1848 driver.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoBtrfs: use the commit_root for reading free_space_inode crcs
Chris Mason [Tue, 26 Jul 2011 19:35:09 +0000 (15:35 -0400)]
Btrfs: use the commit_root for reading free_space_inode crcs

Now that we are using regular file crcs for the free space cache,
we can deadlock if we try to read the free_space_inode while we are
updating the crc tree.

This commit fixes things by using the commit_root to read the crcs.  This is
safe because we the free space cache file would already be loaded if
that block group had been changed in the current transaction.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: reduce extent_state lock contention for metadata
Chris Mason [Mon, 25 Jul 2011 10:50:50 +0000 (06:50 -0400)]
Btrfs: reduce extent_state lock contention for metadata

For metadata buffers that don't straddle pages (all of them), btrfs
can safely use the page uptodate bits and extent_buffer uptodate bit
instead of needing to use the extent_state tree.

This greatly reduces contention on the state tree lock.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: remove lockdep magic from btrfs_next_leaf
Chris Mason [Tue, 26 Jul 2011 20:01:59 +0000 (16:01 -0400)]
Btrfs: remove lockdep magic from btrfs_next_leaf

Before the reader/writer locks, btrfs_next_leaf needed to keep
the path blocking to avoid making lockdep upset.

Now that btrfs_next_leaf only takes read locks, this isn't required.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: make a lockdep class for each root
Chris Mason [Tue, 26 Jul 2011 20:11:19 +0000 (16:11 -0400)]
Btrfs: make a lockdep class for each root

This patch was originally from Tejun Heo.  lockdep complains about the btrfs
locking because we sometimes take btree locks from two different trees at the
same time.  The current classes are based only on level in the btree, which
isn't enough information for lockdep to figure out if the lock is safe.

This patch makes a class for each type of tree, and lumps all the FS trees that
actually have files and directories into the same class.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: switch the btrfs tree locks to reader/writer
Chris Mason [Sat, 16 Jul 2011 19:23:14 +0000 (15:23 -0400)]
Btrfs: switch the btrfs tree locks to reader/writer

The btrfs metadata btree is the source of significant
lock contention, especially in the root node.   This
commit changes our locking to use a reader/writer
lock.

The lock is built on top of rw spinlocks, and it
extends the lock tracking to remember if we have a
read lock or a write lock when we go to blocking.  Atomics
count the number of blocking readers or writers at any
given time.

It removes all of the adaptive spinning from the old code
and uses only the spinning/blocking hints inside of btrfs
to decide when it should continue spinning.

In read heavy workloads this is dramatically faster.  In write
heavy workloads we're still faster because of less contention
on the root node lock.

We suffer slightly in dbench because we schedule more often
during write locks, but all other benchmarks so far are improved.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: fix deadlock when throttling transactions
Josef Bacik [Sun, 24 Jul 2011 19:45:34 +0000 (15:45 -0400)]
Btrfs: fix deadlock when throttling transactions

Hit this nice little deadlock.  What happens is this

__btrfs_end_transaction with throttle set, --use_count so it equals 0
  btrfs_commit_transaction
    <somebody else actually manages to start the commit>
    btrfs_end_transaction --use_count so now its -1 <== BAD
      we just return and wait on the transaction

This is bad because we just return after our use_count is -1 and don't let go
of our num_writer count on the transaction, so the guy committing the
transaction just sits there forever.  Fix this by inc'ing our use_count if we're
going to call commit_transaction so that if we call btrfs_end_transaction it's
valid.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: stop using highmem for extent_buffers
Chris Mason [Tue, 19 Jul 2011 16:04:14 +0000 (12:04 -0400)]
Btrfs: stop using highmem for extent_buffers

The extent_buffers have a very complex interface where
we use HIGHMEM for metadata and try to cache a kmap mapping
to access the memory.

The next commit adds reader/writer locks, and concurrent use
of this kmap cache would make it even more complex.

This commit drops the ability to use HIGHMEM with extent buffers,
and rips out all of the related code.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: fix BUG_ON() caused by ENOSPC when relocating space
Miao Xie [Fri, 15 Jul 2011 10:34:36 +0000 (10:34 +0000)]
Btrfs: fix BUG_ON() caused by ENOSPC when relocating space

When we balanced the chunks across the devices, BUG_ON() in
__finish_chunk_alloc() was triggered.

------------[ cut here ]------------
kernel BUG at fs/btrfs/volumes.c:2568!
[SNIP]
Call Trace:
 [<ffffffffa049525e>] btrfs_alloc_chunk+0x8e/0xa0 [btrfs]
 [<ffffffffa04546b0>] do_chunk_alloc+0x330/0x3a0 [btrfs]
 [<ffffffffa045c654>] btrfs_reserve_extent+0xb4/0x1f0 [btrfs]
 [<ffffffffa045c86b>] btrfs_alloc_free_block+0xdb/0x350 [btrfs]
 [<ffffffffa048a8d8>] ? read_extent_buffer+0xd8/0x1d0 [btrfs]
 [<ffffffffa04476fd>] __btrfs_cow_block+0x14d/0x5e0 [btrfs]
 [<ffffffffa044660d>] ? read_block_for_search+0x14d/0x4d0 [btrfs]
 [<ffffffffa0447c9b>] btrfs_cow_block+0x10b/0x240 [btrfs]
 [<ffffffffa044dd5e>] btrfs_search_slot+0x49e/0x7a0 [btrfs]
 [<ffffffffa044f07d>] btrfs_insert_empty_items+0x8d/0xf0 [btrfs]
 [<ffffffffa045e973>] insert_with_overflow+0x43/0x110 [btrfs]
 [<ffffffffa045eb0d>] btrfs_insert_dir_item+0xcd/0x1f0 [btrfs]
 [<ffffffffa0489bd0>] ? map_extent_buffer+0xb0/0xc0 [btrfs]
 [<ffffffff812276ad>] ? rb_insert_color+0x9d/0x160
 [<ffffffffa046cc40>] ? inode_tree_add+0xf0/0x150 [btrfs]
 [<ffffffffa0474801>] btrfs_add_link+0xc1/0x1c0 [btrfs]
 [<ffffffff811dacac>] ? security_inode_init_security+0x1c/0x30
 [<ffffffffa04a28aa>] ? btrfs_init_acl+0x4a/0x180 [btrfs]
 [<ffffffffa047492f>] btrfs_add_nondir+0x2f/0x70 [btrfs]
 [<ffffffffa046af16>] ? btrfs_init_inode_security+0x46/0x60 [btrfs]
 [<ffffffffa0474ac0>] btrfs_create+0x150/0x1d0 [btrfs]
 [<ffffffff81159c63>] ? generic_permission+0x23/0xb0
 [<ffffffff8115b415>] vfs_create+0xa5/0xc0
 [<ffffffff8115ce6e>] do_last+0x5fe/0x880
 [<ffffffff8115dc0d>] path_openat+0xcd/0x3d0
 [<ffffffff8115e029>] do_filp_open+0x49/0xa0
 [<ffffffff8116a965>] ? alloc_fd+0x95/0x160
 [<ffffffff8114f0c7>] do_sys_open+0x107/0x1e0
 [<ffffffff810bcc3f>] ? audit_syscall_entry+0x1bf/0x1f0
 [<ffffffff8114f1e0>] sys_open+0x20/0x30
 [<ffffffff81484ec2>] system_call_fastpath+0x16/0x1b
[SNIP]
RIP  [<ffffffffa049444a>] __finish_chunk_alloc+0x20a/0x220 [btrfs]

The reason is:
Task1 Space balance task
do_chunk_alloc()
  __finish_chunk_alloc()
    update device info
    in the chunk tree
      alloc system metadata block
relocate system metadata block group
  set system metadata block group
  readonly, This block group is the
  only one that can allocate space. So
  there is no free space that can be
  allocated now.
        find no space and don't try
        to alloc new chunk, and then
        return ENOSPC
  BUG_ON() in __finish_chunk_alloc()
  was triggered.

Fix this bug by allocating a new system metadata chunk before relocating the
old one if we find there is no free space which can be allocated after setting
the old block group to be read-only.

Reported-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Tested-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: tag pages for writeback in sync
Josef Bacik [Fri, 15 Jul 2011 21:26:38 +0000 (21:26 +0000)]
Btrfs: tag pages for writeback in sync

Everybody else does this, we need to do it too.  If we're syncing, we need to
tag the pages we're going to write for writeback so we don't end up writing the
same stuff over and over again if somebody is constantly redirtying our file.
This will keep us from having latencies with heavy sync workloads.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: fix enospc problems with delalloc
Josef Bacik [Fri, 15 Jul 2011 15:16:44 +0000 (15:16 +0000)]
Btrfs: fix enospc problems with delalloc

So I had this brilliant idea to use atomic counters for outstanding and reserved
extents, but this turned out to be a bad idea.  Consider this where we have 1
outstanding extent and 1 reserved extent

Reserver Releaser
atomic_dec(outstanding) now 0
atomic_read(outstanding)+1 get 1
atomic_read(reserved) get 1
don't actually reserve anything because
they are the same
atomic_cmpxchg(reserved, 1, 0)
atomic_inc(outstanding)
atomic_add(0, reserved)
free reserved space for 1 extent

Then the reserver now has no actual space reserved for it, and when it goes to
finish the ordered IO it won't have enough space to do it's allocation and you
get those lovely warnings.

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: don't flush delalloc arbitrarily
Josef Bacik [Fri, 15 Jul 2011 16:01:03 +0000 (16:01 +0000)]
Btrfs: don't flush delalloc arbitrarily

Kill the check to see if we have 512mb of reserved space in delalloc and
shrink_delalloc if we do.  This causes unexpected latencies and we have other
logic to see if we need to throttle.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: use find_or_create_page instead of grab_cache_page
Josef Bacik [Mon, 11 Jul 2011 14:47:06 +0000 (10:47 -0400)]
Btrfs: use find_or_create_page instead of grab_cache_page

grab_cache_page will use mapping_gfp_mask(), which for all inodes is set to
GFP_HIGHUSER_MOVABLE.  So instead use find_or_create_page in all cases where we
need GFP_NOFS so we don't deadlock.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
13 years agoBtrfs: use a worker thread to do caching
Josef Bacik [Thu, 30 Jun 2011 18:42:28 +0000 (14:42 -0400)]
Btrfs: use a worker thread to do caching

A user reported a deadlock when copying a bunch of files.  This is because they
were low on memory and kthreadd got hung up trying to migrate pages for an
allocation when starting the caching kthread.  The page was locked by the person
starting the caching kthread.  To fix this we just need to use the async thread
stuff so that the threads are already created and we don't have to worry about
deadlocks.  Thanks,

Reported-by: Roman Mamedov <rm@romanrm.ru>
Signed-off-by: Josef Bacik <josef@redhat.com>
13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
Linus Torvalds [Wed, 27 Jul 2011 16:26:39 +0000 (09:26 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
  jfs: clean up some compiler warnings

13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes
Linus Torvalds [Wed, 27 Jul 2011 16:26:22 +0000 (09:26 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes

* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes:
  GFS2: Fix mount hang caused by certain access pattern to sysfs files

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Wed, 27 Jul 2011 16:25:15 +0000 (09:25 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (22 commits)
  ALSA: hda - Cirrus Logic CS421x support
  ALSA: Make pcm.h self-contained
  ALSA: hda - Allow codec-specific set_power_state ops
  ALSA: hda - Add post_suspend patch ops
  ALSA: hda - Make CONFIG_SND_HDA_POWER_SAVE depending on CONFIG_PM
  ALSA: hda - Make sure mute led reflects master mute state
  ALSA: hda - Fix invalid mute led state on resume of IDT codecs
  ASoC: Revert "ASoC: SAMSUNG: Add I2S0 internal dma driver"
  ALSA: hda - Add support of the 4 internal speakers on certain HP laptops
  ALSA: Make snd_pcm_debug_name usable outside pcm_lib
  ALSA: hda - Fix DAC filling for multi-connection pins in Realtek parser
  ASoC: dapm - Add methods to retrieve snd_card and soc_card from dapm context.
  ASoC: SAMSUNG: Add I2S0 internal dma driver
  ASoC: SAMSUNG: Modify I2S driver to support idma
  ASoC: davinci: add missing break statement
  ASoC: davinci: fix codec start and stop functions
  ASoC: dapm - add DAPM macro for external enum widgets
  ASoC: Acknowledge WM8962 interrupts before acting on them
  ASoC: sgtl5000: guide user when regulator support is needed
  ASoC: sgtl5000: refactor registering internal ldo
  ...

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Wed, 27 Jul 2011 16:24:56 +0000 (09:24 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (53 commits)
  Input: synaptics - fix reporting of min coordinates
  Input: tegra-kbc - enable key autorepeat
  Input: kxtj9 - fix locking typo in kxtj9_set_poll()
  Input: kxtj9 - fix bug in probe()
  Input: intel-mid-touch - remove pointless checking for variable 'found'
  Input: hp_sdc - staticize hp_sdc_kicker()
  Input: pmic8xxx-keypad - fix a leak of the IRQ during init failure
  Input: cy8ctmg110_ts - set reset_pin and irq_pin from platform data
  Input: cy8ctmg110_ts - constify i2c_device_id table
  Input: cy8ctmg110_ts - fix checking return value of i2c_master_send
  Input: lifebook - make dmi callback functions return 1
  Input: atkbd - make dmi callback functions return 1
  Input: gpio_keys - switch to using SIMPLE_DEV_PM_OPS
  Input: gpio_keys - add support for device-tree platform data
  Input: aiptek - remove double define
  Input: synaptics - set minimum coordinates as reported by firmware
  Input: synaptics - process button bits in AGM packets
  Input: synaptics - rename set_slot to be more descriptive
  Input: synaptics - fuzz position for touchpad with reduced filtering
  Input: synaptics - set resolution for MT_POSITION_X/Y axes
  ...

13 years agoMerge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
Linus Torvalds [Wed, 27 Jul 2011 16:24:20 +0000 (09:24 -0700)]
Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze

* 'next' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: Do not show error message for 32 interrupt lines
  Revert "microblaze: PCI fix typo fault in of_node pointer moving into pci_bus"
  microblaze: PCI fix typo fault in of_node pointer moving into pci_bus
  microblaze: Add support for early console on mdm
  microblaze: Simplify early console binding from DT
  microblaze: Get early printk console earlier
  microblaze: Standardise cpuinfo output for cache policy
  microblaze: Unprivileged stream instruction awareness
  microblaze: trivial: Fix typo fault
  microblaze: exec: Remove redundant set_fs(USER_DS)
  microblaze: Remove duplicated prototype of start_thread()
  microblaze: Fix unaligned value saving to the stack for system with MMU
  microblaze/irqs: Do not trace arch_local_{*,irq_*} functions

13 years agostaging: brcm80211: Fix double include introduced by bad merge
Daniel Morsing [Wed, 27 Jul 2011 11:53:28 +0000 (13:53 +0200)]
staging: brcm80211: Fix double include introduced by bad merge

A merge with Linus' tree added a double include of linux/interrupt.h.
Fix by removing one of the includes.

Signed-off-by: Daniel Morsing <daniel.morsing@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge branch 'fix/hda' into for-next
Takashi Iwai [Wed, 27 Jul 2011 15:51:31 +0000 (17:51 +0200)]
Merge branch 'fix/hda' into for-next

13 years agoMerge branch 'next' into for-linus-3.0
Vinod Koul [Wed, 27 Jul 2011 15:13:21 +0000 (20:43 +0530)]
Merge branch 'next' into for-linus-3.0

13 years agoImprove slave/cyclic DMA engine documentation
Russell King - ARM Linux [Tue, 26 Jul 2011 13:25:10 +0000 (14:25 +0100)]
Improve slave/cyclic DMA engine documentation

Improve the documentation for the slave and cyclic DMA engine support
reformatting it for easier reading, adding further APIs, splitting it
into five steps, and including references to the documentation in
dmaengine.h.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
[Fixed the index title to reflect new changes]
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
13 years agoALSA: hda - Fix duplicated DAC assignments for Realtek
Takashi Iwai [Wed, 27 Jul 2011 14:41:57 +0000 (16:41 +0200)]
ALSA: hda - Fix duplicated DAC assignments for Realtek

Copying hp_pins and speaker_pins from line_out_pins may confuse the
parser, and it can lead to duplicated initializations for the same pin
with a wrong DAC assignment.  The problem appears in 3.0 kernel code.

Cc: <stable@kernel.org> (for 3.0)
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'fix/misc' into for-next
Takashi Iwai [Wed, 27 Jul 2011 14:07:23 +0000 (16:07 +0200)]
Merge branch 'fix/misc' into for-next

13 years agoALSA: asihpi - off by one in asihpi_hpi_ioctl()
Dan Carpenter [Wed, 27 Jul 2011 12:02:26 +0000 (15:02 +0300)]
ALSA: asihpi - off by one in asihpi_hpi_ioctl()

"adapter" is used as an array index in the adapters[] array so
the off by one would make us read past the end.

1c073b67979 "ALSA: asihpi - Remove spurious adapter index check"
reverted Dan Rosenberg's check that would have prevented the
overflow here.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: hda - Fix Oops with Realtek quirks with NULL adc_nids
Takashi Iwai [Wed, 27 Jul 2011 12:01:24 +0000 (14:01 +0200)]
ALSA: hda - Fix Oops with Realtek quirks with NULL adc_nids

Somce quirk models don't set adc_nids but let the parser filling it.
But the recent code has unnecessary NULL-checks of spec->input_mux,
and it resulted in NULL dereferences.
This patch fixes that regression.

Reported-and-tested-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years ago[SCSI] ipr: reorder error handling code to include iounmap
Julia Lawall [Mon, 11 Jul 2011 21:08:25 +0000 (14:08 -0700)]
[SCSI] ipr: reorder error handling code to include iounmap

The out_msi_disable label should be before cleanup_nomem to additionally
benefit from the call to iounmap.  Subsequent gotos are adjusted to go to
out_msi_disable instead of cleanup_nomem, which now follows it.  This is
safe because pci_disable_msi does nothing if pci_enable_msi was not called.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r@
expression e1,e2;
statement S;
@@

e1 = pci_ioremap_bar(...);
... when != e1 = e2
    when != iounmap(e1)
    when any
(
 if (<+...e1...+>) S
|
 if(...) { ... return 0; }
|
 if (...) { ... when != iounmap(e1)
                when != if (...) { ... iounmap(e1) ... }
* return ...;
 } else S
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] pmcraid: reject negative request size
Dan Rosenberg [Mon, 11 Jul 2011 21:08:23 +0000 (14:08 -0700)]
[SCSI] pmcraid: reject negative request size

There's a code path in pmcraid that can be reached via device ioctl that
causes all sorts of ugliness, including heap corruption or triggering the
OOM killer due to consecutive allocation of large numbers of pages.

First, the user can call pmcraid_chr_ioctl(), with a type
PMCRAID_PASSTHROUGH_IOCTL.  This calls through to
pmcraid_ioctl_passthrough().  Next, a pmcraid_passthrough_ioctl_buffer
is copied in, and the request_size variable is set to
buffer->ioarcb.data_transfer_length, which is an arbitrary 32-bit
signed value provided by the user.  If a negative value is provided
here, bad things can happen.  For example,
pmcraid_build_passthrough_ioadls() is called with this request_size,
which immediately calls pmcraid_alloc_sglist() with a negative size.
The resulting math on allocating a scatter list can result in an
overflow in the kzalloc() call (if num_elem is 0, the sglist will be
smaller than expected), or if num_elem is unexpectedly large the
subsequent loop will call alloc_pages() repeatedly, a high number of
pages will be allocated and the OOM killer might be invoked.

It looks like preventing this value from being negative in
pmcraid_ioctl_passthrough() would be sufficient.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agogro: Only reset frag0 when skb can be pulled
Herbert Xu [Wed, 27 Jul 2011 13:16:28 +0000 (06:16 -0700)]
gro: Only reset frag0 when skb can be pulled

Currently skb_gro_header_slow unconditionally resets frag0 and
frag0_len.  However, when we can't pull on the skb this leaves
the GRO fields in an inconsistent state.

This patch fixes this by only resetting those fields after the
pskb_may_pull test.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years ago[SCSI] libsas: remove expander from dev list on error
Luben Tuikov [Wed, 27 Jul 2011 06:10:48 +0000 (23:10 -0700)]
[SCSI] libsas: remove expander from dev list on error

If expander discovery fails (sas_discover_expander()), remove the
expander from the port device list (sas_ex_discover_expander()),
before freeing it. Else the list is corrupted and, e.g., when we
attempt to send SMP commands to other devices, the kernel oopses.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Cc: stable@kernel.org
Reviewed-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>