OSDN Git Service

uclinux-h8/linux.git
13 years agobtrfs: don't mess with i_nlink of unlocked inode in rename()
Al Viro [Fri, 4 Mar 2011 17:14:37 +0000 (17:14 +0000)]
btrfs: don't mess with i_nlink of unlocked inode in rename()

old_inode is not locked; it's not safe to play with its link
count.  Instead of bumping it and calling btrfs_unlink_inode(),
add a variant of the latter that does not do btrfs_drop_nlink()/
btrfs_update_inode(), call it instead of btrfs_inc_nlink()/
btrfs_unlink_inode() and do btrfs_update_inode() ourselves.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: check return value of btrfs_alloc_path()
Tsutomu Itoh [Tue, 1 Mar 2011 06:48:31 +0000 (06:48 +0000)]
Btrfs: check return value of btrfs_alloc_path()

Adding the check on the return value of btrfs_alloc_path() to several places.
And, some of callers are modified by this change.

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: fix OOPS of empty filesystem after balance
liubo [Mon, 7 Mar 2011 02:13:14 +0000 (02:13 +0000)]
Btrfs: fix OOPS of empty filesystem after balance

btrfs will remove unused block groups after balance.
When a empty filesystem is balanced, the block group with tag "DATA" may be
dropped, and after umount and mount again, it will not find "DATA" space_info
and lead to OOPS.
So we initial the necessary space_infos(DATA, SYSTEM, METADATA) to avoid OOPS.

Reported-by: Daniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: fix memory leak of empty filesystem after balance
liubo [Mon, 7 Mar 2011 02:13:33 +0000 (02:13 +0000)]
Btrfs: fix memory leak of empty filesystem after balance

After Josef's patch(commit 3c14874acc71180553fb5aba528e3cf57c5b958b),
btrfs will exclude super bytes when reading block groups(by marking a extent
state UPTODATE).  However, these bytes do not get freed while balance remove
unused block groups, and we won't process those removed ones any more, when
we do umount and unload the btrfs module,  btrfs hits a memory leak.

This patch add the missing free operation.

Reproduce steps:
$ mkfs.btrfs disk
$ mount disk /mnt/btrfs -o loop
$ btrfs filesystem balance /mnt/btrfs
$ umount /mnt/btrfs
$ rmmod btrfs

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: fix return value of setflags ioctl
liubo [Thu, 24 Feb 2011 09:38:16 +0000 (09:38 +0000)]
Btrfs: fix return value of setflags ioctl

setflags ioctl should return error when any checks fail.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: fix uncheck memory allocations
Yoshinori Sano [Tue, 15 Feb 2011 12:01:42 +0000 (12:01 +0000)]
Btrfs: fix uncheck memory allocations

To make Btrfs code more robust, several return value checks where memory
allocation can fail are introduced. I use BUG_ON where I don't know how
to handle the error properly, which increases the number of using the
notorious BUG_ON, though.

Signed-off-by: Yoshinori Sano <yoshinori.sano@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agobtrfs: make inode ref log recovery faster
liubo [Sat, 26 Mar 2011 12:01:12 +0000 (08:01 -0400)]
btrfs: make inode ref log recovery faster

When we recover from crash via write-ahead log tree and process
the inode refs, for each btrfs_inode_ref item, we will
1) check if we already have a perfect match in fs/file tree, if
   we have, then we're done.
2) search the corresponding back reference in fs/file tree, and
   check all the names in this back reference to see if they are
   also in the log to avoid conflict corners.
3) recover the logged inode refs to fs/file tree.

In current btrfs, however,
- for 2)'s check, once is enough, since the checked back reference
  will remain unchanged after processing all the inode refs belonged
  to the key.
- it has no need to do another 1) between 2) and 3).

I've made a small test to show how it improves,

$dd if=/dev/zero of=foobar bs=4K count=1
$sync
$make 100 hard links continuously, like ln foobar link_i
$fsync foobar
$echo b > /proc/sysrq-trigger
after reboot
$time mount DEV PATH

without patch:
real    0m0.285s
user    0m0.001s
sys     0m0.009s

with patch:
real    0m0.123s
user    0m0.000s
sys     0m0.010s

Changelog v1->v2:
- fix double free - pointed by David Sterba
Changelog v2->v3:
- adjust free order

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: add btrfs_trim_fs() to handle FITRIM
Li Dongyang [Thu, 24 Mar 2011 10:24:28 +0000 (10:24 +0000)]
Btrfs: add btrfs_trim_fs() to handle FITRIM

We take an free extent out from allocator, trim it, then put it back,
but before we trim the block group, we should make sure the block group is
cached, so plus a little change to make cache_block_group() run without a
transaction.

Signed-off-by: Li Dongyang <lidongyang@novell.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: adjust btrfs_discard_extent() return errors and trimmed bytes
Li Dongyang [Thu, 24 Mar 2011 10:24:27 +0000 (10:24 +0000)]
Btrfs: adjust btrfs_discard_extent() return errors and trimmed bytes

Callers of btrfs_discard_extent() should check if we are mounted with -o discard,
as we want to make fitrim to work even the fs is not mounted with -o discard.
Also we should use REQ_DISCARD to map the free extent to get a full mapping,
last we only return errors if
1. the error is not a EOPNOTSUPP
2. no device supports discard

Signed-off-by: Li Dongyang <lidongyang@novell.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: make btrfs_map_block() return entire free extent for each device of RAID0...
Li Dongyang [Thu, 24 Mar 2011 10:24:26 +0000 (10:24 +0000)]
Btrfs: make btrfs_map_block() return entire free extent for each device of RAID0/1/10/DUP

btrfs_map_block() will only return a single stripe length, but we want the
full extent be mapped to each disk when we are trimming the extent,
so we add length to btrfs_bio_stripe and fill it if we are mapping for REQ_DISCARD.

Signed-off-by: Li Dongyang <lidongyang@novell.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: make update_reserved_bytes() public
Li Dongyang [Thu, 24 Mar 2011 10:24:25 +0000 (10:24 +0000)]
Btrfs: make update_reserved_bytes() public

Make the function public as we should update the reserved extents calculations
after taking out an extent for trimming.

Signed-off-by: Li Dongyang <lidongyang@novell.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agobtrfs: return EXDEV when linking from different subvolumes
Mark Fasheh [Tue, 22 Mar 2011 17:20:26 +0000 (17:20 +0000)]
btrfs: return EXDEV when linking from different subvolumes

btrfs_link returns EPERM if a cross-subvolume link is attempted.

However, in this case I believe EXDEV to be the more appropriate value.
>From the link(2) man page:

EXDEV  oldpath and newpath are not on the same mounted file system.  (Linux
       permits a file system to be mounted at multiple points, but link()
       does not work across different mount points, even if the same file
       system is mounted on both.)

This matters because an application may have different behaviors based on
return codes.

Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: Per file/directory controls for COW and compression
Liu Bo [Tue, 22 Mar 2011 10:12:20 +0000 (10:12 +0000)]
Btrfs: Per file/directory controls for COW and compression

Data compression and data cow are controlled across the entire FS by mount
options right now.  ioctls are needed to set this on a per file or per
directory basis.  This has been proposed previously, but VFS developers
wanted us to use generic ioctls rather than btrfs-specific ones.

According to Chris's comment, there should be just one true compression
method(probably LZO) stored in the super.  However, before this, we would
wait for that one method is stable enough to be adopted into the super.
So I list it as a long term goal, and just store it in ram today.

After applying this patch, we can use the generic "FS_IOC_SETFLAGS" ioctl to
control file and directory's datacow and compression attribute.

NOTE:
 - The compression type is selected by such rules:
   If we mount btrfs with compress options, ie, zlib/lzo, the type is it.
   Otherwise, we'll use the default compress type (zlib today).

v1->v2:
- rebase to the latest btrfs.
v2->v3:
- fix a problem, i.e. when a file is set NOCOW via mount option, then this NOCOW
  will be screwed by inheritance from parent directory.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: add datacow flag in inode flag
liubo [Mon, 21 Mar 2011 08:54:27 +0000 (08:54 +0000)]
Btrfs: add datacow flag in inode flag

For datacow control, the corresponding inode flags are needed.
This is for btrfs use.

v1->v2:
Change FS_COW_FL to another bit due to conflict with the upstream e2fsprogs

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agobtrfs: use GFP_NOFS instead of GFP_KERNEL
Miao Xie [Thu, 24 Mar 2011 11:41:21 +0000 (11:41 +0000)]
btrfs: use GFP_NOFS instead of GFP_KERNEL

In the filesystem context, we must allocate memory by GFP_NOFS,
or we may start another filesystem operation and make kswap thread hang up.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: check return value of read_tree_block()
Tsutomu Itoh [Thu, 24 Mar 2011 06:33:21 +0000 (06:33 +0000)]
Btrfs: check return value of read_tree_block()

This patch is checking return value of read_tree_block(),
and if it is NULL, error processing.

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agobtrfs: properly access unaligned checksum buffer
David Sterba [Fri, 18 Mar 2011 22:56:43 +0000 (22:56 +0000)]
btrfs: properly access unaligned checksum buffer

On Fri, Mar 18, 2011 at 11:56:53AM -0400, Chris Mason wrote:
> Thanks for fielding this one.  Does put_unaligned_le32 optimize away on
> platforms with efficient access?  It would be great if we didn't need
> the #ifdef.

(quicktest: assembly output is same for put_unaligned_le32 and direct
assignment on my x86_64)
I was originally following examples in
Documentation/unaligned-memory-access.txt. From other code it seems to me that
the define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is intended for larger
portions of code. Macros/wrappers for {put,get}_unaligned* are chosen via
arch/<arch>/include/asm/unaligned.h accordingly, therefore it's safe to use
put_unaligned_le32 without the ifdef.

dave

Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: cleanup some BUG_ON()
Tsutomu Itoh [Wed, 23 Mar 2011 08:14:16 +0000 (08:14 +0000)]
Btrfs: cleanup some BUG_ON()

This patch changes some BUG_ON() to the error return.
(but, most callers still use BUG_ON())

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: add initial tracepoint support for btrfs
liubo [Thu, 24 Mar 2011 11:18:59 +0000 (11:18 +0000)]
Btrfs: add initial tracepoint support for btrfs

Tracepoints can provide insight into why btrfs hits bugs and be greatly
helpful for debugging, e.g
              dd-7822  [000]  2121.641088: btrfs_inode_request: root = 5(FS_TREE), gen = 4, ino = 256, blocks = 8, disk_i_size = 0, last_trans = 8, logged_trans = 0
              dd-7822  [000]  2121.641100: btrfs_inode_new: root = 5(FS_TREE), gen = 8, ino = 257, blocks = 0, disk_i_size = 0, last_trans = 0, logged_trans = 0
 btrfs-transacti-7804  [001]  2146.935420: btrfs_cow_block: root = 2(EXTENT_TREE), refs = 2, orig_buf = 29368320 (orig_level = 0), cow_buf = 29388800 (cow_level = 0)
 btrfs-transacti-7804  [001]  2146.935473: btrfs_cow_block: root = 1(ROOT_TREE), refs = 2, orig_buf = 29364224 (orig_level = 0), cow_buf = 29392896 (cow_level = 0)
 btrfs-transacti-7804  [001]  2146.972221: btrfs_transaction_commit: root = 1(ROOT_TREE), gen = 8
   flush-btrfs-2-7821  [001]  2155.824210: btrfs_chunk_alloc: root = 3(CHUNK_TREE), offset = 1103101952, size = 1073741824, num_stripes = 1, sub_stripes = 0, type = DATA
   flush-btrfs-2-7821  [001]  2155.824241: btrfs_cow_block: root = 2(EXTENT_TREE), refs = 2, orig_buf = 29388800 (orig_level = 0), cow_buf = 29396992 (cow_level = 0)
   flush-btrfs-2-7821  [001]  2155.824255: btrfs_cow_block: root = 4(DEV_TREE), refs = 2, orig_buf = 29372416 (orig_level = 0), cow_buf = 29401088 (cow_level = 0)
   flush-btrfs-2-7821  [000]  2155.824329: btrfs_cow_block: root = 3(CHUNK_TREE), refs = 2, orig_buf = 20971520 (orig_level = 0), cow_buf = 20975616 (cow_level = 0)
 btrfs-endio-wri-7800  [001]  2155.898019: btrfs_cow_block: root = 5(FS_TREE), refs = 2, orig_buf = 29384704 (orig_level = 0), cow_buf = 29405184 (cow_level = 0)
 btrfs-endio-wri-7800  [001]  2155.898043: btrfs_cow_block: root = 7(CSUM_TREE), refs = 2, orig_buf = 29376512 (orig_level = 0), cow_buf = 29409280 (cow_level = 0)

Here is what I have added:

1) ordere_extent:
        btrfs_ordered_extent_add
        btrfs_ordered_extent_remove
        btrfs_ordered_extent_start
        btrfs_ordered_extent_put

These provide critical information to understand how ordered_extents are
updated.

2) extent_map:
        btrfs_get_extent

extent_map is used in both read and write cases, and it is useful for tracking
how btrfs specific IO is running.

3) writepage:
        __extent_writepage
        btrfs_writepage_end_io_hook

Pages are cirtical resourses and produce a lot of corner cases during writeback,
so it is valuable to know how page is written to disk.

4) inode:
        btrfs_inode_new
        btrfs_inode_request
        btrfs_inode_evict

These can show where and when a inode is created, when a inode is evicted.

5) sync:
        btrfs_sync_file
        btrfs_sync_fs

These show sync arguments.

6) transaction:
        btrfs_transaction_commit

In transaction based filesystem, it will be useful to know the generation and
who does commit.

7) back reference and cow:
btrfs_delayed_tree_ref
btrfs_delayed_data_ref
btrfs_delayed_ref_head
btrfs_cow_block

Btrfs natively supports back references, these tracepoints are helpful on
understanding btrfs's COW mechanism.

8) chunk:
btrfs_chunk_alloc
btrfs_chunk_free

Chunk is a link between physical offset and logical offset, and stands for space
infomation in btrfs, and these are helpful on tracing space things.

9) reserved_extent:
btrfs_reserved_extent_alloc
btrfs_reserved_extent_free

These can show how btrfs uses its space.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: use RCU instead of a spinlock to protect the root node
Chris Mason [Wed, 23 Mar 2011 18:54:42 +0000 (14:54 -0400)]
Btrfs: use RCU instead of a spinlock to protect the root node

The pointer to the extent buffer for the root of each tree
is protected by a spinlock so that we can safely read the pointer
and take a reference on the extent buffer.

But now that the extent buffers are freed via RCU, we can safely
use rcu_read_lock instead.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoARM: Suspend: Fix dependency of ARCH_SUSPEND_POSSIBLE
Kukjin Kim [Fri, 25 Mar 2011 11:09:26 +0000 (20:09 +0900)]
ARM: Suspend: Fix dependency of ARCH_SUSPEND_POSSIBLE

The current mainline codes of ARCH_S5P64X0 and ARCH_S5P6442
can not support suspend to ram. So needs this for preventing
build error on them.

Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Len Brown <len.brown@intel.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
13 years agoARM: SAMSUNG: Fix CPU idmask
Kukjin Kim [Wed, 23 Mar 2011 05:45:29 +0000 (14:45 +0900)]
ARM: SAMSUNG: Fix CPU idmask

This patch fixes CPU idmask of S5P64X0 and EXYNOS4210
and its comparison method because just want to use CPU
id for it.

Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
13 years agoARM: EXYNOS4: Fix addruart macro
Thomas Abraham [Fri, 25 Mar 2011 07:18:18 +0000 (16:18 +0900)]
ARM: EXYNOS4: Fix addruart macro

Fix incorrect conditional execution of ldr instructions in
addruart macro.

Signed-off-by: Thomas Abraham <thomas.abraham@samsung.com>
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
13 years agoARM: EXYNOS4: Fix smsc9215 irq polarity on SMDKC210
Jeongtae Park [Fri, 25 Mar 2011 06:48:15 +0000 (15:48 +0900)]
ARM: EXYNOS4: Fix smsc9215 irq polarity on SMDKC210

This patch fixes smsc9215 irq ploarity configuration of SMDKC210.
We can change type of EINT(5) as HIGH, but it's better to change
IRQ output of smsc9215 as an active low because smsc's IRQ line
has been pull-up.

Signed-off-by: Jeongtae Park <jtp.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
13 years agoARM: EXYNOS4: Fix smsc9215 irq polarity on SMDKV310
Jeongtae Park [Fri, 25 Mar 2011 06:48:15 +0000 (15:48 +0900)]
ARM: EXYNOS4: Fix smsc9215 irq polarity on SMDKV310

This patch fixes smsc9215 irq ploarity configuration of SMDKV310.
We can change type of EINT(5) as HIGH, but it's better to change
IRQ output of smsc9215 as an active low because smsc's IRQ line
has been pull-up.

Signed-off-by: Jeongtae Park <jtp.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
13 years agoARM: EXYNOS4: Fix build warning on regarding SATA_AHCI_PLATFORM
Kukjin Kim [Fri, 25 Mar 2011 01:46:16 +0000 (10:46 +0900)]
ARM: EXYNOS4: Fix build warning on regarding SATA_AHCI_PLATFORM

This patch fixes following build warnings.

warning: (MACH_ARMLEX4210) selects SATA_AHCI_PLATFORM
          which has unmet direct dependencies (ATA)

And adds EXYNOX4_DEV_AHCI for building machines which are
not suppoort for AHCI feature on board.

Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
13 years agoARM: S5PV210: Remove duplicated inclusion
Huang Weiyi [Wed, 23 Mar 2011 06:29:32 +0000 (15:29 +0900)]
ARM: S5PV210: Remove duplicated inclusion

Remove duplicated #include('s) in
  arch/arm/mach-s5pv210/mach-smdkv210.c

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
13 years agoARM: S5PV210: Fix security engine interrupt names
Vladimir Zapolskiy [Wed, 23 Mar 2011 06:08:17 +0000 (15:08 +0900)]
ARM: S5PV210: Fix security engine interrupt names

This change is intended to correct security subsystem interrupt names
for Samsung S5PV210 and S5PC110 SoCs.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
13 years agoARM: S5P64X0: Fix iodesc array size for S5P6450
Banajit Goswami [Fri, 18 Mar 2011 11:45:22 +0000 (17:15 +0530)]
ARM: S5P64X0: Fix iodesc array size for S5P6450

The array size parameter of iotable_init for S5P6450 is incorrect.
Fix this by passing the correct length of s5p6450_iodesc table.

Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
13 years agomach-ux500: configure board for the TPS61052 regulator v2
Linus Walleij [Mon, 7 Mar 2011 10:48:15 +0000 (11:48 +0100)]
mach-ux500: configure board for the TPS61052 regulator v2

This registers the TPS61052 regulator to the ux500 MOP/HREF boards.

Cc: Samuel Ortiz <samuel.ortiz@intel.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Ola Lilja <ola.o.lilja@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
13 years agoeCryptfs: write lock requested keys
Roberto Sassu [Mon, 21 Mar 2011 15:00:55 +0000 (16:00 +0100)]
eCryptfs: write lock requested keys

A requested key is write locked in order to prevent modifications on the
authentication token while it is being used.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
13 years agoeCryptfs: move ecryptfs_find_auth_tok_for_sig() call before mutex_lock
Roberto Sassu [Mon, 21 Mar 2011 15:00:54 +0000 (16:00 +0100)]
eCryptfs: move ecryptfs_find_auth_tok_for_sig() call before mutex_lock

The ecryptfs_find_auth_tok_for_sig() call is moved before the
mutex_lock(s->tfm_mutex) instruction in order to avoid possible deadlocks
that may occur by holding the lock on the two semaphores 'key->sem' and
's->tfm_mutex' in reverse order.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
13 years agoeCryptfs: verify authentication tokens before their use
Roberto Sassu [Mon, 21 Mar 2011 15:00:53 +0000 (16:00 +0100)]
eCryptfs: verify authentication tokens before their use

Authentication tokens content may change if another requestor calls the
update() method of the corresponding key. The new function
ecryptfs_verify_auth_tok_from_key() retrieves the authentication token from
the provided key and verifies if it is still valid before being used to
encrypt or decrypt an eCryptfs file.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
[tyhicks: Minor formatting changes]
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
13 years agoeCryptfs: modified size of keysig in the ecryptfs_key_sig structure
Roberto Sassu [Mon, 21 Mar 2011 15:00:52 +0000 (16:00 +0100)]
eCryptfs: modified size of keysig in the ecryptfs_key_sig structure

The size of the 'keysig' array is incremented of one byte in order to make
room for the NULL character. The 'keysig' variable is used, in the function
ecryptfs_generate_key_packet_set(), to find an authentication token with
the given signature and is printed a debug message if it cannot be
retrieved.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
13 years agoeCryptfs: removed num_global_auth_toks from ecryptfs_mount_crypt_stat
Roberto Sassu [Mon, 21 Mar 2011 15:00:51 +0000 (16:00 +0100)]
eCryptfs: removed num_global_auth_toks from ecryptfs_mount_crypt_stat

This patch removes the 'num_global_auth_toks' field of the
ecryptfs_mount_crypt_stat structure, used to count the number of items in
the 'global_auth_tok_list' list. This variable is not needed because there
are no checks based upon it.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
13 years agoeCryptfs: ecryptfs_keyring_auth_tok_for_sig() bug fix
Roberto Sassu [Thu, 17 Mar 2011 11:48:50 +0000 (12:48 +0100)]
eCryptfs: ecryptfs_keyring_auth_tok_for_sig() bug fix

The pointer '(*auth_tok_key)' is set to NULL in case request_key()
fails, in order to prevent its use by functions calling
ecryptfs_keyring_auth_tok_for_sig().

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Cc: <stable@kernel.org>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
13 years agoeCryptfs: Unlock page in write_begin error path
Tyler Hicks [Wed, 9 Mar 2011 17:49:13 +0000 (11:49 -0600)]
eCryptfs: Unlock page in write_begin error path

Unlock the page in error path of ecryptfs_write_begin(). This may
happen, for example, if decryption fails while bring the page
up-to-date.

Cc: <stable@kernel.org>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
13 years agoecryptfs: modify write path to encrypt page in writepage
Thieu Le [Wed, 9 Mar 2011 00:26:03 +0000 (16:26 -0800)]
ecryptfs: modify write path to encrypt page in writepage

Change the write path to encrypt the data only when the page is written to
disk in ecryptfs_writepage. Previously, ecryptfs encrypts the page in
ecryptfs_write_end which means that if there are multiple write requests to
the same page, ecryptfs ends up re-encrypting that page over and over again.
This patch minimizes the number of encryptions needed.

Signed-off-by: Thieu Le <thieule@chromium.org>
[tyhicks: Changed NULL .drop_inode sop pointer to generic_drop_inode]
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
13 years agoeCryptfs: Remove ECRYPTFS_NEW_FILE crypt stat flag
Tyler Hicks [Wed, 23 Feb 2011 06:54:20 +0000 (00:54 -0600)]
eCryptfs: Remove ECRYPTFS_NEW_FILE crypt stat flag

Now that grow_file() is not called in the ecryptfs_create() path, the
ECRYPTFS_NEW_FILE flag is no longer needed. It helped
ecryptfs_readpage() know not to decrypt zeroes that were read from the
lower file in the grow_file() path.

Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
13 years agoeCryptfs: Remove unnecessary grow_file() function
Tyler Hicks [Wed, 23 Feb 2011 06:14:19 +0000 (00:14 -0600)]
eCryptfs: Remove unnecessary grow_file() function

When creating a new eCryptfs file, the crypto metadata is written out
and then the lower file was being "grown" with 4 kB of encrypted zeroes.
I suspect that growing the encrypted file was to prevent an information
leak that the unencrypted file was empty. However, the unencrypted file
size is stored, in plaintext, in the metadata so growing the file is
unnecessary.

Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
13 years agomach-ux500: provide ab8500 init vector
Bengt Jonsson [Wed, 9 Mar 2011 12:34:17 +0000 (13:34 +0100)]
mach-ux500: provide ab8500 init vector

This adds an ab8500 regulator initialization vector for the
HREF/MOP500 series of boards. This also sets the display
regulator to be on at boot so we don't loose our splash
screen when the board comes up.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
13 years agomach-ux500: board support for AB8500 GPIO driver
Bibek Basu [Tue, 15 Feb 2011 07:26:16 +0000 (12:56 +0530)]
mach-ux500: board support for AB8500 GPIO driver

This is the board support patch for ab8500 gpio driver
on mach-ux500.Patch implements 16 virtual
IRQ mapped to 16 interrupt capable AB8500 GPIOs.

Signed-off-by: Bibek Basu <bibek.basu@stericsson.com>
[Modify for header file placement]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
13 years agogpio: driver for 42 AB8500 GPIO pins
Bibek Basu [Wed, 9 Feb 2011 05:32:35 +0000 (11:02 +0530)]
gpio: driver for 42 AB8500 GPIO pins

To get rid of port expanders, the free GPIOs of ab8500
can be used. There are 42 GPIO pins. Out of which 16
are interrupt capable.This patch implements 16 virtual
IRQ mapped to 16 interrupt capable AB8500 GPIOs.

Signed-off-by: Bibek Basu <bibek.basu@stericsson.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
[Renamed header file as per MFD structure]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
13 years agoscore: Use generic show_interrupts()
Thomas Gleixner [Fri, 25 Mar 2011 14:16:56 +0000 (14:16 +0000)]
score: Use generic show_interrupts()

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Chen Liqin <liqin.chen@sunplusct.com>
13 years agoscore: Convert to new irq function names
Thomas Gleixner [Fri, 25 Mar 2011 14:16:55 +0000 (14:16 +0000)]
score: Convert to new irq function names

Scripted with coccinelle.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Chen Liqin <liqin.chen@sunplusct.com>
13 years agoscore: lost a semicolon in asm/irqflags.h
Chen Liqin [Mon, 28 Mar 2011 04:02:20 +0000 (12:02 +0800)]
score: lost a semicolon in asm/irqflags.h

13 years agoscore: Select GENERIC_HARDIRQS_NO_DEPRECATED
Thomas Gleixner [Sun, 6 Feb 2011 22:23:50 +0000 (22:23 +0000)]
score: Select GENERIC_HARDIRQS_NO_DEPRECATED

All chips converted and proper accessor functions used.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Chen Liqin <liqin.chen@sunplusct.com>
13 years agoscore: Convert irq_chip to new functions
Thomas Gleixner [Sun, 6 Feb 2011 22:23:47 +0000 (22:23 +0000)]
score: Convert irq_chip to new functions

Use the proper accessor functions in show_interrupts() while at it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Chen Liqin <liqin.chen@sunplusct.com>
13 years agoMerge branch 'irq-cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 28 Mar 2011 03:58:56 +0000 (20:58 -0700)]
Merge branch 'irq-cleanup-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'irq-cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  tile: Use generic show_interupts()
  tile: Convert to new irq function names
  dma: Ipu: Convert interupt code

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
Linus Torvalds [Mon, 28 Mar 2011 03:37:50 +0000 (20:37 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/lrg/voltage-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6:
  regulator: Add MODULE_DEVICE_TABLE to max8997 and max8998
  regulator: fix tps6524x section mismatch
  regulator: Remove more wm831x-specific IRQ operations
  regulator: add ab8500 enable and raise time delays
  regulator: provide consumer interface for fall/rise time
  regulator: add set_voltage_time_sel infrastructure
  regulator: initialization for ab8500 regulators
  regulator: add support for USB voltage regulator
  regulator: switch the ab3100 to use enable_time()
  Regulator: add suspend-finish API for regulator core.
  regulator: fix typo in Kconfig
  regulator: Convert WM831x regulators to genirq
  regulator: If we fail when setting up a supply say which supply

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Mon, 28 Mar 2011 03:35:07 +0000 (20:35 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: Fix yet another race in disconnection
  ALSA: asihpi - Update verbose debug print macros
  ALSA: asihpi - Improve non-busmaster adapter operation
  ALSA: asihpi - Support single-rate no-SRC cards
  ALSA: HDA: New AD1984A model for Dell Precision R5500
  ALSA: vmalloc buffers should use normal mmap
  ALSA: hda - Fix SPDIF out regression on ALC889
  ALSA: usb-audio - Support for Boss JS-8 Jam Station
  ALSA: usb-audio: add Cakewalk UM-1G support
  sound/oss/opl3: validate voice and channel indexes
  sound/oss: remove offset from load_patch callbacks

13 years agoMerge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Linus Torvalds [Mon, 28 Mar 2011 03:07:01 +0000 (20:07 -0700)]
Merge branch 'for-next' of git://git./linux/kernel/git/sameo/mfd-2.6

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
  mfd: Clean up max8997 IRQ namespace
  mfd: Fold irq_set_chip/irq_set_handler
  mfd: Cleanup irq namespace
  mfd: twl6030: Cleanup interrupt handling
  mfd: twl4030: Cleanup interrupt handling
  mfd: mx8925: Remove irq_desc leftovers
  mfd: htc-i2cpld: Cleanup interrupt handling
  mfd: htc-egpio: Cleanup interrupt handling
  mfd: ezx-pcap: Remvove open coded irq handling
  mfd: 88pm860x: Remove unused irq_desc leftovers
  mfd: asic3: Cleanup irq handling
  mfd: Select MFD_CORE if TPS6105X driver is configured
  mfd: Add MODULE_DEVICE_TABLE to rdc321x-southbridge
  mfd: Add MAX8997/8966 IRQ control
  mfd: Constify i2c_device_id tables
  mfd: OLPC: Clean up names to match what OLPC actually uses
  mfd: Add mfd_clone_cell(), convert cs5535-mfd/olpc-xo1 to it

13 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
Linus Torvalds [Mon, 28 Mar 2011 03:03:39 +0000 (20:03 -0700)]
Merge branch 'hwmon-for-linus' of git://git./linux/kernel/git/groeck/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging:
  hwmon: (pmbus) Fix temperature limit register access

13 years agoMerge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 28 Mar 2011 03:03:12 +0000 (20:03 -0700)]
Merge branch 'omap-fixes-for-linus' of git://git./linux/kernel/git/tmlind/linux-omap-2.6

* 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6:
  hwspinlock: depend on OMAP4
  ARM: OMAP2+: Fix warnings for GPMC interrupt
  OMAP4: PandaBoard: remove unused power regulators
  arm: mach-omap2: omap_l3_smx: fix irq handler setup
  arm: mach-omap2: devices: fix omap3_l3_init() return value

13 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Mon, 28 Mar 2011 03:02:45 +0000 (20:02 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  staging: Fix bdops->check_events() misconversion in cyasblkdev_block.c
  ide: ensure that we re-run the queue handler

13 years agoMerge branch 'for-2.6.39/drivers' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Mon, 28 Mar 2011 03:02:07 +0000 (20:02 -0700)]
Merge branch 'for-2.6.39/drivers' of git://git.kernel.dk/linux-2.6-block

* 'for-2.6.39/drivers' of git://git.kernel.dk/linux-2.6-block: (122 commits)
  cciss: fix lost command issue
  drbd: need include for bitops functions declarations
  Revert "cciss: Add missing allocation in scsi_cmd_stack_setup and  corresponding deallocation"
  cciss: fix missed command status value CMD_UNABORTABLE
  cciss: remove unnecessary casts
  cciss: Mask off error bits of c->busaddr in cmd_special_free when calling pci_free_consistent
  cciss: Inform controller we are using 32-bit tags.
  cciss: hoist tag masking out of loop
  cciss: Add missing allocation in scsi_cmd_stack_setup and  corresponding deallocation
  cciss: export resettable host attribute
  drbd: drop code present under #ifdef which is relevant to 2.6.28 and below
  drbd: Fixed handling of read errors on a 'VerifyS' node
  drbd: Fixed handling of read errors on a 'VerifyT' node
  drbd: Implemented real timeout checking for request processing time
  drbd: Remove unused function atodb_endio()
  drbd: improve log message if received sector offset exceeds local capacity
  drbd: kill dead code
  drbd: don't BUG_ON, if bio_add_page of a single page to an empty bio fails
  drbd: Removed left over, now wrong comments
  drbd: serialize admin requests for new verify run with pending bitmap io
  ...

13 years agoMerge branch 'docs-next' of git://git.lwn.net/linux-2.6
Linus Torvalds [Mon, 28 Mar 2011 02:46:59 +0000 (19:46 -0700)]
Merge branch 'docs-next' of git://git.lwn.net/linux-2.6

* 'docs-next' of git://git.lwn.net/linux-2.6:
  docs: update the development process document
  docs: fix dev_debug() braino in dynamic-debug-howto.txt

13 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelv...
Linus Torvalds [Mon, 28 Mar 2011 02:42:12 +0000 (19:42 -0700)]
Merge branch 'hwmon-for-linus' of git://git./linux/kernel/git/jdelvare/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  hwmon: (f71882fg) Add support for the F71889A
  hwmon: (f71882fg) Add support for the F81865F
  hwmon: (f71882fg) Document all supported devices
  hwmon: (f71882fg) Per-chip fan/temperature input count tables
  hwmon: (f71882fg) Secure chip property definition arrays

13 years agoMerge branch 'for-linus-1' of git://git.infradead.org/mtd-2.6
Linus Torvalds [Mon, 28 Mar 2011 02:40:56 +0000 (19:40 -0700)]
Merge branch 'for-linus-1' of git://git.infradead.org/mtd-2.6

* 'for-linus-1' of git://git.infradead.org/mtd-2.6: (49 commits)
  mtd: mtdswap: fix compilation warning
  mtdswap: kill strict error handling option
  mtd: nand: enable software BCH ECC in nand simulator
  mtd: nand: add software BCH ECC support
  mtd: fix printf format warnings, mostly lack of %zd for size_t, in mtdswap
  mtd: sm_rtl: check kmalloc return value
  mtd: cfi: add support for AMIC flashes (e.g. A29L160AT)
  lib: add shared BCH ECC library
  mtd: mxc_nand: fix OOB corruption when page size > 2KiB
  mtd: DaVinci: Removed header file that is not required
  mtd: pxa3xx_nand: clean the keep configure code
  mtd: pxa3xx_nand: mtd scan id process could be defined by driver itself
  mtd: pxa3xx_nand: unify prepare command
  mtd: pxa3xx_nand: discard wait_for_event,write_cmd,__readid function
  mtd: pxa3xx_nand: rework irq logic
  mtd: pxa3xx_nand: make scan procedure more clear
  mtd: speedtest: fix integer overflow
  mtd: mxc_nand: fix read past buffer end
  mtd: omap3: nand: report corrected ecc errors
  jffs2: remove a trailing white space in commentaries
  ...

13 years agoapm: orphan the driver
Stephen Rothwell [Sat, 26 Mar 2011 06:22:04 +0000 (17:22 +1100)]
apm: orphan the driver

I no longer have access to any hardware that uses APM and have not
provided real maintenance for several years.  Hopefully someone with the
hardware or energy will step forward if the driver is to be kept.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoum: Add myself as co-maintainer
Richard Weinberger [Sat, 26 Mar 2011 19:48:57 +0000 (20:48 +0100)]
um: Add myself as co-maintainer

Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-and-appreciated-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agodocbook: fix rapidio warning
Randy Dunlap [Sat, 26 Mar 2011 20:27:54 +0000 (13:27 -0700)]
docbook: fix rapidio warning

Fix fsl_rio.c kernel-doc warning: no exported symbols as
requested by !E are found:

  Warning(arch/powerpc/sysdev/fsl_rio.c): no structured comments found

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agodocbook: fix broken media build
Randy Dunlap [Sat, 26 Mar 2011 20:28:00 +0000 (13:28 -0700)]
docbook: fix broken media build

DocBook/v4l/ no longer has any *.png files, so the 'cp' command fails,
breaking the build.  Drop the *.png cp.

  cp: cannot stat `linux-2.6.38-git18/Documentation/DocBook/v4l/*.png': No such file or directory

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agofs: fix inode.c kernel-doc warning
Randy Dunlap [Sat, 26 Mar 2011 20:27:47 +0000 (13:27 -0700)]
fs: fix inode.c kernel-doc warning

Fix inode.c kernel-doc fatal error: 2 comment sections have the same name:

  Error(fs/inode.c:1171): duplicate section name 'Note'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoipc: fix util.c kernel-doc warnings
Randy Dunlap [Sat, 26 Mar 2011 20:27:41 +0000 (13:27 -0700)]
ipc: fix util.c kernel-doc warnings

Fix ipc/util.c kernel-doc warnings:

  Warning(ipc/util.c:336): No description found for parameter 'ns'
  Warning(ipc/util.c:620): No description found for parameter 'ns'
  Warning(ipc/util.c:790): No description found for parameter 'ns'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Reviewed-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agomm: fix memory.c incorrect kernel-doc
Randy Dunlap [Sat, 26 Mar 2011 20:27:01 +0000 (13:27 -0700)]
mm: fix memory.c incorrect kernel-doc

Fix mm/memory.c incorrect kernel-doc function notation:

  Warning(mm/memory.c:3718): Cannot understand  * @access_remote_vm - access another process' address space
   on line 3718 - I thought it was a doc line

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agopercpu: Omit segment prefix in the UP case for cmpxchg_double
Christoph Lameter [Sun, 27 Mar 2011 01:57:18 +0000 (20:57 -0500)]
percpu: Omit segment prefix in the UP case for cmpxchg_double

Omit the segment prefix in the UP case. GS is not used then
and we will generate segfaults if cmpxchg16b is used otherwise.

Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoproc: fix oops on invalid /proc/<pid>/maps access
Linus Torvalds [Mon, 28 Mar 2011 02:09:29 +0000 (19:09 -0700)]
proc: fix oops on invalid /proc/<pid>/maps access

When m_start returns an error, the seq_file logic will still call m_stop
with that error entry, so we'd better make sure that we check it before
using it as a vma.

Introduced by commit ec6fd8a4355c ("report errors in /proc/*/*map*
sanely"), which replaced NULL with various ERR_PTR() cases.

(On ia64, you happen to get a unaligned fault instead of a page fault,
since the address used is generally some random error code like -EPERM)

Reported-by: Anca Emanuel <anca.emanuel@gmail.com>
Reported-by: Tony Luck <tony.luck@intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Américo Wang <xiyou.wangcong@gmail.com>
Cc: Stephen Wilson <wilsons@start.ca>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoNFS: Ensure that rpc_release_resources_task() can be called twice.
OGAWA Hirofumi [Sun, 27 Mar 2011 15:48:57 +0000 (17:48 +0200)]
NFS: Ensure that rpc_release_resources_task() can be called twice.

BUG: atomic_dec_and_test(): -1: atomic counter underflow at:
Pid: 2827, comm: mount.nfs Not tainted 2.6.38 #1
Call Trace:
 [<ffffffffa02223a0>] ? put_rpccred+0x44/0x14e [sunrpc]
 [<ffffffffa021bbe9>] ? rpc_ping+0x4e/0x58 [sunrpc]
 [<ffffffffa021c4a5>] ? rpc_create+0x481/0x4fc [sunrpc]
 [<ffffffffa022298a>] ? rpcauth_lookup_credcache+0xab/0x22d [sunrpc]
 [<ffffffffa028be8c>] ? nfs_create_rpc_client+0xa6/0xeb [nfs]
 [<ffffffffa028c660>] ? nfs4_set_client+0xc2/0x1f9 [nfs]
 [<ffffffffa028cd3c>] ? nfs4_create_server+0xf2/0x2a6 [nfs]
 [<ffffffffa0295d07>] ? nfs4_remote_mount+0x4e/0x14a [nfs]
 [<ffffffff810dd570>] ? vfs_kern_mount+0x6e/0x133
 [<ffffffffa029605a>] ? nfs_do_root_mount+0x76/0x95 [nfs]
 [<ffffffffa029643d>] ? nfs4_try_mount+0x56/0xaf [nfs]
 [<ffffffffa0297434>] ? nfs_get_sb+0x435/0x73c [nfs]
 [<ffffffff810dd59b>] ? vfs_kern_mount+0x99/0x133
 [<ffffffff810dd693>] ? do_kern_mount+0x48/0xd8
 [<ffffffff810f5b75>] ? do_mount+0x6da/0x741
 [<ffffffff810f5c5f>] ? sys_mount+0x83/0xc0
 [<ffffffff8100293b>] ? system_call_fastpath+0x16/0x1b

Well, so, I think this is real bug of nfs codes somewhere. With some
review, the code

rpc_call_sync()
    rpc_run_task
        rpc_execute()
            __rpc_execute()
                rpc_release_task()
                    rpc_release_resources_task()
                        put_rpccred()                <= release cred
    rpc_put_task
        rpc_do_put_task()
            rpc_release_resources_task()
                put_rpccred()                        <= release cred again

seems to be release cred unintendedly.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Don't leak RPC clients in NFSv4 secinfo negotiation
Trond Myklebust [Sat, 26 Mar 2011 06:24:35 +0000 (02:24 -0400)]
NFS: Don't leak RPC clients in NFSv4 secinfo negotiation

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Fix a hang in the writeback path
Trond Myklebust [Fri, 25 Mar 2011 18:15:11 +0000 (14:15 -0400)]
NFS: Fix a hang in the writeback path

Now that the inode scalability patches have been merged, it is no longer
safe to call igrab() under the inode->i_lock.
Now that we no longer call nfs_clear_request() until the nfs_page is
being freed, we know that we are always holding a reference to the
nfs_open_context, which again holds a reference to the path, and so
the inode cannot be freed until the last nfs_page has been removed
from the radix tree and freed.

We can therefore skip the igrab()/iput() altogether.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoregulator: Add MODULE_DEVICE_TABLE to max8997 and max8998
Axel Lin [Sat, 26 Mar 2011 15:28:42 +0000 (23:28 +0800)]
regulator: Add MODULE_DEVICE_TABLE to max8997 and max8998

The device table is required to load modules based on modaliases.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: MyungJoo Ham <myungjoo.ham@smasung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
13 years agocrypto: aesni-intel - fixed problem with packets that are not multiple of 64bytes
Tadeusz Struk [Sun, 13 Mar 2011 08:56:17 +0000 (16:56 +0800)]
crypto: aesni-intel - fixed problem with packets that are not multiple of 64bytes

This patch fixes problem with packets that are not multiple of 64bytes.

Signed-off-by: Adrian Hoban <adrian.hoban@intel.com>
Signed-off-by: Aidan O'Mahony <aidan.o.mahony@intel.com>
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@intel.com>
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
13 years agomfd: Clean up max8997 IRQ namespace
Samuel Ortiz [Fri, 25 Mar 2011 16:56:02 +0000 (17:56 +0100)]
mfd: Clean up max8997 IRQ namespace

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Fold irq_set_chip/irq_set_handler
Thomas Gleixner [Fri, 25 Mar 2011 11:12:35 +0000 (11:12 +0000)]
mfd: Fold irq_set_chip/irq_set_handler

Use the combined irq_set_chip_and_handler() function
instead. Converted with coccinelle.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Cleanup irq namespace
Thomas Gleixner [Fri, 25 Mar 2011 11:12:32 +0000 (11:12 +0000)]
mfd: Cleanup irq namespace

Converted with coccinelle.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: twl6030: Cleanup interrupt handling
Thomas Gleixner [Fri, 25 Mar 2011 11:12:31 +0000 (11:12 +0000)]
mfd: twl6030: Cleanup interrupt handling

irq_desc checking in the interrupt demux routine is totally
pointless. The driver sets those lines up, so that cant go away
magically.

Remove the open coded handler magic and use the proper accessor.

This driver needs to be converted to threaded interrupts and buslock.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: twl4030: Cleanup interrupt handling
Thomas Gleixner [Fri, 25 Mar 2011 11:12:31 +0000 (11:12 +0000)]
mfd: twl4030: Cleanup interrupt handling

irq_desc checking in a function which is called with that irq
descriptor locked, is pointless. Equally pointless as the irq desc
check in the interrupt service routine. The driver sets those lines
up, so that cant go away magically.

Remove the open coded handler magic and use the proper accessor.

No need to fiddle with irq_desc in the type setting function. The
original value is in irq_data and the core code stores the new setting
when the return value is 0.

This driver needs to be converted to threaded interrupts and buslock.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: mx8925: Remove irq_desc leftovers
Thomas Gleixner [Fri, 25 Mar 2011 11:12:30 +0000 (11:12 +0000)]
mfd: mx8925: Remove irq_desc leftovers

Remove unused code.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: htc-i2cpld: Cleanup interrupt handling
Thomas Gleixner [Fri, 25 Mar 2011 11:12:29 +0000 (11:12 +0000)]
mfd: htc-i2cpld: Cleanup interrupt handling

Remove the pointless irq_desc check in set_type. This function is
called with that irq descriptor locked. Also remove the write back of
the flow type as the core code does this already when the return value
is 0.

Also store the flow type in the chip data structure, so there is no
need to fiddle in the irq descriptor.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: htc-egpio: Cleanup interrupt handling
Thomas Gleixner [Fri, 25 Mar 2011 11:12:28 +0000 (11:12 +0000)]
mfd: htc-egpio: Cleanup interrupt handling

Replace the open coded handler call with the prober accessor. Retrieve
the handler data from desc. That avoids a redundant lookup in the
sparse irq case.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: ezx-pcap: Remvove open coded irq handling
Thomas Gleixner [Fri, 25 Mar 2011 11:12:27 +0000 (11:12 +0000)]
mfd: ezx-pcap: Remvove open coded irq handling

There is no point in checking irq_desc here, as it _is_ available. The
driver configured those lines, so they cannot go away.

The home brewn disabled/note_interrupt magic can be removed as well by
adding a irq_disable callback which avoids the lazy disable.

That driver needs to be converted to threaded interrupts.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: 88pm860x: Remove unused irq_desc leftovers
Thomas Gleixner [Fri, 25 Mar 2011 11:12:27 +0000 (11:12 +0000)]
mfd: 88pm860x: Remove unused irq_desc leftovers

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: asic3: Cleanup irq handling
Thomas Gleixner [Fri, 25 Mar 2011 11:12:26 +0000 (11:12 +0000)]
mfd: asic3: Cleanup irq handling

Remove the open coded access to irq_desc and use the proper wrappers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Select MFD_CORE if TPS6105X driver is configured
Guenter Roeck [Thu, 24 Mar 2011 19:12:47 +0000 (12:12 -0700)]
mfd: Select MFD_CORE if TPS6105X driver is configured

The TPS61050/61052 driver uses MFD core code, yet does not specify the
dependency in Kconfig. If it is the only MFD driver configured, compilation
fails with

ERROR: "mfd_add_devices" [drivers/mfd/tps6105x.ko] undefined!
ERROR: "mfd_remove_devices" [drivers/mfd/tps6105x.ko] undefined!

Fix the problem by adding "select MFD_CORE" to the respective Kconfig entry.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Add MODULE_DEVICE_TABLE to rdc321x-southbridge
Axel Lin [Thu, 24 Mar 2011 07:04:53 +0000 (15:04 +0800)]
mfd: Add MODULE_DEVICE_TABLE to rdc321x-southbridge

The device table is required to load modules based on modaliases.
After adding MODULE_DEVICE_TABLE, below entry will be added to modules.pcimap:
rdc321x-southbridge  0x000017f3 0x00006030 0xffffffff 0xffffffff 0x00000000 0x00000000 0x0

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Add MAX8997/8966 IRQ control
MyungJoo Ham [Thu, 24 Mar 2011 06:54:45 +0000 (15:54 +0900)]
mfd: Add MAX8997/8966 IRQ control

This patch enables IRQ handling for MAX8997/8966 chips.

Please note that Fuel-Gauge-related IRQs are not implemented in this
initial release. The fuel gauge module in MAX8997 is identical to
MAX17042, which is already in Linux kernel. In order to use the
already-existing MAX17042 driver for fuel gauge module in MAX8997, the
main interrupt handler of MAX8997 should relay related interrupts to
MAX17042 driver. However, in order to do this, we need to modify
MAX17042 driver as well because MAX17042 driver does not have any
interrupt handlers for now. We are not going to implement this in this
initial release as it is not crucial in basic operations of MAX8997.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Constify i2c_device_id tables
Axel Lin [Wed, 23 Mar 2011 12:54:17 +0000 (20:54 +0800)]
mfd: Constify i2c_device_id tables

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Harald Welte <laforge@gnumonks.org>
Cc: Matti Aaltonen <matti.j.aaltonen@nokia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: OLPC: Clean up names to match what OLPC actually uses
Daniel Drake [Tue, 22 Mar 2011 20:50:39 +0000 (13:50 -0700)]
mfd: OLPC: Clean up names to match what OLPC actually uses

The cs5535-pms cell doesn't actually need to be cloned, so we can drop that
and simply have the olpc-xo1.c driver use "cs5535-pms" directly.

Also, rename the cs5535-acpi clones to what we actually use for the (currently
out-of-tree) SCI driver.  In the process, that fixes a subtle bug in
olpc-xo1.c which broke powerdown on XO-1s.. olpc-xo1-ac-acpi was a typo, not
something that actually existed.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomfd: Add mfd_clone_cell(), convert cs5535-mfd/olpc-xo1 to it
Andres Salomon [Tue, 22 Mar 2011 02:19:35 +0000 (19:19 -0700)]
mfd: Add mfd_clone_cell(), convert cs5535-mfd/olpc-xo1 to it

Replace mfd_shared_platform_driver_register with mfd_clone_cell.  The
former was called by an mfd client, and registered both a platform driver
and device.  The latter is called by an mfd driver, and registers only a
platform device.

The downside of this is that mfd drivers need to be modified whenever
new clients are added that share a cell; the upside is that it fits
Linux's driver model better.  It's also simpler.

This also converts cs5535-mfd/olpc-xo1 from the old API.  cs5535-mfd
now creates the olpc-xo1-{acpi,pms} devices, while olpc-xo1 binds to
them via platform drivers.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agostaging: Fix bdops->check_events() misconversion in cyasblkdev_block.c
Tejun Heo [Sat, 26 Mar 2011 18:52:59 +0000 (19:52 +0100)]
staging: Fix bdops->check_events() misconversion in cyasblkdev_block.c

Commit cafb0bfca1 (staging: Convert to bdops->check_events())
incorrectly set bd->user_disk_0->events while initializing
bd->user_disk_1.  Fix it.

The problem was spotted by Milton's suspect code pattern detector.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years agoide: ensure that we re-run the queue handler
Jens Axboe [Sat, 26 Mar 2011 18:49:54 +0000 (19:49 +0100)]
ide: ensure that we re-run the queue handler

The conversion to blk_delay_queue() missed parts of IDE.
Add a blk_delay_queue() to ensure that the request handler
gets reinvoked when it needs to.

Note that in all but one place the old plug re-run delay of
3 msecs is used, even though it probably could be shorter
for performance reasons in some of those cases.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years agohwmon: (pmbus) Fix temperature limit register access
Guenter Roeck [Tue, 22 Mar 2011 04:31:00 +0000 (21:31 -0700)]
hwmon: (pmbus) Fix temperature limit register access

Commit 8677011 added auto-update to temperature limit registers.
Unfortunately, the update flag is also used to determine if an attribute
is writable, which results in read-only temperature limit registers.
To fix the problem, pass 'readonly' as separate flag to the function used
to add sensor attributes.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
13 years agoregulator: fix tps6524x section mismatch
Randy Dunlap [Thu, 24 Mar 2011 20:30:59 +0000 (13:30 -0700)]
regulator: fix tps6524x section mismatch

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Fix section mismatch that is caused by init code calling exit code:
pmic_remove() cannot be marked as __devexit.

WARNING: drivers/regulator/tps6524x-regulator.o(.devinit.text+0x205): Section mismatch in reference from the function pmic_probe() to the function .devexit.text:pmic_remove()
The function __devinit pmic_probe() references
a function __devexit pmic_remove().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __devexit annotation of
pmic_remove() so it may be used outside an exit section.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
13 years agoregulator: Remove more wm831x-specific IRQ operations
Mark Brown [Fri, 18 Mar 2011 12:43:35 +0000 (12:43 +0000)]
regulator: Remove more wm831x-specific IRQ operations

These are the last users in the tree.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
13 years agoregulator: add ab8500 enable and raise time delays
Linus Walleij [Thu, 17 Mar 2011 12:25:02 +0000 (13:25 +0100)]
regulator: add ab8500 enable and raise time delays

This uses the new infrastructure to provide proper delays when
enabling or setting the voltage of one specific regulator.

Cc: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
13 years agoregulator: provide consumer interface for fall/rise time
Linus Walleij [Thu, 17 Mar 2011 12:24:52 +0000 (13:24 +0100)]
regulator: provide consumer interface for fall/rise time

This exposes the functionality for rise/fall fime when setting
voltage to the consumers.

Cc: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
13 years agoregulator: add set_voltage_time_sel infrastructure
Linus Walleij [Thu, 17 Mar 2011 12:24:36 +0000 (13:24 +0100)]
regulator: add set_voltage_time_sel infrastructure

This makes it possible to set the stabilization time for voltage
regulators in the same manner as enable_time(). The interface
only supports regulators that implements fixed selectors.

Cc: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
13 years agoregulator: initialization for ab8500 regulators
Bengt Jonsson [Fri, 11 Mar 2011 10:54:46 +0000 (11:54 +0100)]
regulator: initialization for ab8500 regulators

The regulators on the AB8500 have a lot of custom
hardware control settings pertaining to 8 external
signals, settings which are board-specific and need
be provided from the platform at startup.

Initialization added for regulators Vana, VextSupply1,
VextSupply2, VextSupply3, Vaux1, Vaux2, Vaux3, VTVout,
Vintcore12, Vaudio, Vdmic, Vamic1, Vamic2, VrefDDR.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Reviewed-by: Rickard Andersson <rickard.andersson@stericsson.com>
Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
13 years agoregulator: add support for USB voltage regulator
Bengt Jonsson [Thu, 10 Mar 2011 13:43:31 +0000 (14:43 +0100)]
regulator: add support for USB voltage regulator

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>