unionfs-2.6.25.y.git
16 years agocleanup: every printk should prefix with "unionfs: " consistently
Erez_Zadok [Sat, 24 Mar 2007 22:36:59 +0000 (18:36 -0400)]
cleanup: every printk should prefix with "unionfs: " consistently

16 years agocoding-style: remove unnecessary {braces} around one-line code blocks
Erez_Zadok [Sat, 24 Mar 2007 22:19:49 +0000 (18:19 -0400)]
coding-style: remove unnecessary {braces} around one-line code blocks

16 years agocoding-style: no lines over 80 chars
Erez_Zadok [Sat, 24 Mar 2007 22:11:10 +0000 (18:11 -0400)]
coding-style: no lines over 80 chars

16 years agocoding-style: indent every line properly
Erez_Zadok [Sat, 24 Mar 2007 21:57:56 +0000 (17:57 -0400)]
coding-style: indent every line properly

16 years agocleanup: remove trailing spaces
Erez_Zadok [Sat, 24 Mar 2007 21:41:57 +0000 (17:41 -0400)]
cleanup: remove trailing spaces

16 years agoDocumentation: fix spelling error
Erez_Zadok [Sat, 24 Mar 2007 20:28:59 +0000 (16:28 -0400)]
Documentation: fix spelling error

16 years agoDocumentation: minor typo fixed in incgen remount option
Erez_Zadok [Sat, 24 Mar 2007 20:19:40 +0000 (16:19 -0400)]
Documentation: minor typo fixed in incgen remount option

16 years agoUnionfs: SLAB_CTOR_CONSTRUCTOR has been removed from vanilla
Josef 'Jeff' Sipek [Sat, 19 May 2007 07:14:30 +0000 (03:14 -0400)]
Unionfs: SLAB_CTOR_CONSTRUCTOR has been removed from vanilla

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years ago[PATCH] unionfs: fix slab abuses with krealloc
Pekka Enberg [Sun, 13 May 2007 16:55:44 +0000 (12:55 -0400)]
[PATCH] unionfs: fix slab abuses with krealloc

This changes unionfs to use krealloc() for reallocating memory so that we
don't need to play tricks with slab internals.

Cc: Josef Sipek <jsipek@fsl.cs.sunysb.edu>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years ago[PATCH] fix unionfs compilation
Adrian Bunk [Sat, 5 May 2007 19:28:33 +0000 (15:28 -0400)]
[PATCH] fix unionfs compilation

On Sat, May 05, 2007 at 01:49:55AM -0700, Andrew Morton wrote:
>...
> Changes since 2.6.21-rc7-mm2:
>...
>  git-unionfs.patch
>...
>  git trees
>...

<--  snip  -->

...
  CC      fs/unionfs/super.o
/home/bunk/linux/kernel-2.6/linux-2.6.21-mm1/fs/unionfs/super.c: In function ‘init_once’:
/home/bunk/linux/kernel-2.6/linux-2.6.21-mm1/fs/unionfs/super.c:822: error: ‘SLAB_CTOR_VERIFY’ undeclared (first use in this function)
/home/bunk/linux/kernel-2.6/linux-2.6.21-mm1/fs/unionfs/super.c:822: error: (Each undeclared identifier is reported only once
/home/bunk/linux/kernel-2.6/linux-2.6.21-mm1/fs/unionfs/super.c:822: error: for each function it appears in.)
make[3]: *** [fs/unionfs/super.o] Error 1

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Check remount options for being NULL
Adrian Brunyate [Thu, 26 Apr 2007 22:51:16 +0000 (18:51 -0400)]
Unionfs: Check remount options for being NULL

Signed-off-by: Adrian Brunyate <abrunyate@yahoo.com>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Accept MS_SILENT during remount
Adrian Brunyate [Thu, 26 Apr 2007 22:51:09 +0000 (18:51 -0400)]
Unionfs: Accept MS_SILENT during remount

[jsipek: whitespace cleanup]
Signed-off-by: Adrian Brunyate <abrunyate@yahoo.com>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Don't inline do_remount_{add,del,mode}_option
Erez Zadok [Fri, 23 Mar 2007 17:10:46 +0000 (13:10 -0400)]
Unionfs: Don't inline do_remount_{add,del,mode}_option

gcc4 decided to inline do_remount_{add,del,mode}_option creating an 600 byte
stack abuser on a x86_64 test box.

Reported by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Added several BUG_ONs to assert dentry validity
Erez Zadok [Fri, 23 Mar 2007 17:07:14 +0000 (13:07 -0400)]
Unionfs: Added several BUG_ONs to assert dentry validity

This should help catch races between the VFS and the branch-management code.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Properly handle stale inodes passed to unionfs_permission
Erez Zadok [Fri, 23 Mar 2007 00:17:48 +0000 (20:17 -0400)]
Unionfs: Properly handle stale inodes passed to unionfs_permission

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Pass lowernd to lower ->revalidate function
Erez Zadok [Fri, 23 Mar 2007 00:09:07 +0000 (20:09 -0400)]
Unionfs: Pass lowernd to lower ->revalidate function

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: vfsmount reference counting fixes
Erez Zadok [Fri, 23 Mar 2007 00:08:30 +0000 (20:08 -0400)]
Unionfs: vfsmount reference counting fixes

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: unionfs_create needs to revalidate the dentry
Erez Zadok [Fri, 23 Mar 2007 00:01:56 +0000 (20:01 -0400)]
Unionfs: unionfs_create needs to revalidate the dentry

We have to read-lock the superblock rwsem, and we have to revalidate the
parent dentry and this one.  A branch-management operation could have taken
place, mid-way through a VFS operation that eventually reaches
unionfs_create().  So we have to ensure consistency, just as we do with the
file operations.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Decrement totalopens counter on error in unionfs_open
Erez Zadok [Thu, 22 Mar 2007 23:47:43 +0000 (19:47 -0400)]
Unionfs: Decrement totalopens counter on error in unionfs_open

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Document unionfs_d_release locking
Josef 'Jeff' Sipek [Sun, 18 Mar 2007 20:30:45 +0000 (16:30 -0400)]
Unionfs: Document unionfs_d_release locking

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Remove the older incgen ioctl
Josef 'Jeff' Sipek [Sun, 18 Mar 2007 20:22:03 +0000 (16:22 -0400)]
Unionfs: Remove the older incgen ioctl

The new remount code now has the "incgen" functionality.

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Grab the unionfs sb private data lock around branch info users
Erez Zadok [Thu, 22 Mar 2007 23:32:40 +0000 (19:32 -0400)]
Unionfs: Grab the unionfs sb private data lock around branch info users

Locking/concurrency/race fixes.  Use the unionfs superblock rwsem, and grab
the read lock around every op that uses branch-related information, such as
branch counters.  Grab the write rwsem lock in operations which attempt to
change branch information, such as when adding/deleting branches.  This
will, for example, cause branch-management remount commands (which are
infrequent) to block a bit until all in-progress file operations on open
files are done.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
[jsipek: whitespace fixes & more locks/unlocks]
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Rewrite unionfs_d_revalidate
Erez Zadok [Tue, 20 Mar 2007 01:02:55 +0000 (21:02 -0400)]
Unionfs: Rewrite unionfs_d_revalidate

Rewrite unionfs_d_revalidate code to avoid stack-unfriendly recursion: split
into a call to revalidate just one dentry, and an interative driver function
to revalidate an entire dentry-parent chain.

Fix vfsmount ref leaks which prevented lower f/s from being unmounted after
generation increment, esp. during heavy loads.

Fix one deadlock between revalidation code and VFS.

Better documentation of what the code does.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
[jsipek: compile & whitespace fixes]
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Introduce unionfs_mnt{get,put}
Erez Zadok [Tue, 20 Mar 2007 00:57:49 +0000 (20:57 -0400)]
Unionfs: Introduce unionfs_mnt{get,put}

Helper inline functions to perform Unionfs's mntget/put ops on lower
branches.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
[jsipek: cleanup branching in unionfs_mnt{get,put} and compile fixes]
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Bulk of branch-management remount code
Erez Zadok [Tue, 20 Mar 2007 00:44:12 +0000 (20:44 -0400)]
Unionfs: Bulk of branch-management remount code

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Introduce branch-id code
Erez Zadok [Thu, 22 Mar 2007 23:43:29 +0000 (19:43 -0400)]
Unionfs: Introduce branch-id code

Each branch gets a unique ID, which helps during branch additions,
deletions, and changes, to locate where branches were moved to, and perform
proper reference-counting.  This is useful even if the same directory was
added more than once to union.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Actually verify if dentry's info node is locked
Erez Zadok [Mon, 9 Apr 2007 13:57:51 +0000 (09:57 -0400)]
Unionfs: Actually verify if dentry's info node is locked

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Provide more helpful info on branch leaks during unmount
Erez Zadok [Mon, 19 Mar 2007 07:01:49 +0000 (03:01 -0400)]
Unionfs: Provide more helpful info on branch leaks during unmount

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
[jsipek: no need to take a read lock on the superblock private data]
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Rename unionfs_data sbcount field to more appropriate open_files
Erez Zadok [Mon, 19 Mar 2007 04:46:03 +0000 (00:46 -0400)]
Unionfs: Rename unionfs_data sbcount field to more appropriate open_files

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Proper comment on rwsem field
Josef 'Jeff' Sipek [Sun, 18 Mar 2007 23:37:51 +0000 (19:37 -0400)]
Unionfs: Proper comment on rwsem field

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Documentation updates for branch-management
Erez Zadok [Fri, 23 Mar 2007 21:17:07 +0000 (17:17 -0400)]
Unionfs: Documentation updates for branch-management

Describe dynamic branch-management introduced by subsequent patches.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs: Export drop_pagecache_sb symbol
Erez Zadok [Sun, 18 Mar 2007 23:24:29 +0000 (19:24 -0400)]
fs: Export drop_pagecache_sb symbol

Signed-off-by: Erez Zadok <ezkcs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipekcs.sunysb.edu>
16 years agofs: Introduce path{get,put}
Erez Zadok [Sun, 18 Mar 2007 23:23:52 +0000 (19:23 -0400)]
fs: Introduce path{get,put}

Export drop_pagecache_sb symbol (for branch-management).

Signed-off-by: Erez Zadok <ezkcs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipekcs.sunysb.edu>
16 years ago[PATCH] Unionfs: sioq not __exit
Randy Dunlap [Mon, 19 Mar 2007 23:15:22 +0000 (19:15 -0400)]
[PATCH] Unionfs: sioq not __exit

stop_sioq() is called from both __init and __exit functions, so it
shouldn't be marked __exit.

Reported on the kernelnewbies mailing list, but no patch offered there.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoMAINTAINERS: Unionfs URL update
Josef 'Jeff' Sipek [Sat, 17 Mar 2007 23:42:25 +0000 (19:42 -0400)]
MAINTAINERS: Unionfs URL update

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Fix unlocking in error paths
Erez Zadok [Sun, 4 Mar 2007 23:02:11 +0000 (18:02 -0500)]
fs/unionfs/: Fix unlocking in error paths

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Fix dentry leak in copyup_named_dentry
Erez Zadok [Sun, 4 Mar 2007 20:21:14 +0000 (15:21 -0500)]
fs/unionfs/: Fix dentry leak in copyup_named_dentry

When we chmod a directory on a readonly branch, and have to copy it up, we
forget to dput(). If this was a file, it gets dput indirectly through other
functions we call, but not if it was a directory.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: mntput in __cleanup_dentry
Erez Zadok [Fri, 2 Mar 2007 18:10:56 +0000 (13:10 -0500)]
fs/unionfs/: mntput in __cleanup_dentry

This fixes a mnt refleak which occured during copyup when directory
hierarchy was recreated on a writable branch.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Fix copyup_deleted_file dentry leak
Erez Zadok [Sun, 4 Mar 2007 05:41:51 +0000 (00:41 -0500)]
fs/unionfs/: Fix copyup_deleted_file dentry leak

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Miscellaneous coding style fixes
Josef 'Jeff' Sipek [Fri, 2 Mar 2007 18:14:01 +0000 (13:14 -0500)]
fs/unionfs/: Miscellaneous coding style fixes

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Check return value of d_path
Josef 'Jeff' Sipek [Tue, 27 Feb 2007 19:27:25 +0000 (14:27 -0500)]
fs/unionfs/: Check return value of d_path

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Use SEEK_{SET,CUR} instead of hardcoded values
Josef 'Jeff' Sipek [Sun, 25 Feb 2007 22:32:46 +0000 (17:32 -0500)]
fs/unionfs/: Use SEEK_{SET,CUR} instead of hardcoded values

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Remove alloc_filldir_node
Josef 'Jeff' Sipek [Sun, 25 Feb 2007 22:30:34 +0000 (17:30 -0500)]
fs/unionfs/: Remove alloc_filldir_node

alloc_filldir_node was used only once. Additionally, all the arguments
passed to it were ignored wasting stack space for no reason whatsoever.

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Rename unionfs_d_revalidate_wrap
Josef 'Jeff' Sipek [Sat, 24 Feb 2007 21:47:45 +0000 (16:47 -0500)]
fs/unionfs/: Rename unionfs_d_revalidate_wrap

Follow the convention of "foo" calling "__foo".

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Several small cleanups in unionfs_interpose
Josef 'Jeff' Sipek [Sat, 24 Feb 2007 21:46:08 +0000 (16:46 -0500)]
fs/unionfs/: Several small cleanups in unionfs_interpose

1) No need to lock the inode - lockdep was complaining about potential
circular dependency

2) No need to use temporary variable for iunique() inode number

3) Removed unneeded comment

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Don't grab dentry private data mutex in unionfs_d_release
Josef 'Jeff' Sipek [Fri, 23 Feb 2007 06:04:09 +0000 (01:04 -0500)]
fs/unionfs/: Don't grab dentry private data mutex in unionfs_d_release

Grabbing the UNIONFS_D(dentry)->lock is completely unnecessary and there are
no other references; we are about to free the object anyway. Additionally,
grabbing the mutex produces warning when the slab object is reused - as it
was freed while there still was a reference to it.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Fix a memory leak in unionfs_read_super
Erez Zadok [Fri, 2 Mar 2007 18:35:33 +0000 (13:35 -0500)]
fs/unionfs/: Fix a memory leak in unionfs_read_super

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs: Fix a memory leak & null pointer dereference
Erez Zadok [Fri, 2 Mar 2007 18:00:57 +0000 (13:00 -0500)]
fs/unionfs: Fix a memory leak & null pointer dereference

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years ago[PATCH] UNION_FS must depend on SLAB
Adrian Bunk [Wed, 21 Feb 2007 06:30:10 +0000 (01:30 -0500)]
[PATCH] UNION_FS must depend on SLAB

On Sat, Feb 17, 2007 at 09:51:46PM -0800, Andrew Morton wrote:
>...
> Changes since 2.6.20-mm1:
>...
>  git-unionfs.patch
>...
>  git trees
>...

<--  snip  -->

...
  CC      fs/unionfs/copyup.o
/home/bunk/linux/kernel-2.6/linux-2.6.20-mm2/fs/unionfs/copyup.c: In function 'create_parents_named':
/home/bunk/linux/kernel-2.6/linux-2.6.20-mm2/fs/unionfs/copyup.c:620: error: 'malloc_sizes' undeclared (first use in this function)
/home/bunk/linux/kernel-2.6/linux-2.6.20-mm2/fs/unionfs/copyup.c:620: error: (Each undeclared identifier is reported only once
/home/bunk/linux/kernel-2.6/linux-2.6.20-mm2/fs/unionfs/copyup.c:620: error: for each function it appears in.)
make[3]: *** [fs/unionfs/copyup.o] Error 1

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Remove unused structure members & macros
Josef 'Jeff' Sipek [Sat, 17 Feb 2007 08:25:15 +0000 (03:25 -0500)]
fs/unionfs/: Remove unused structure members & macros

This patch removes:
- hidden_mnt pointer from struct unionfs_data
- mount_flag from struct unionfs_sb_info
- mount_flag related macros

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoeCryptfs: convert lookup_one_len() to lookup_one_len_nd()
Michael Halcrow [Fri, 16 Feb 2007 19:09:25 +0000 (14:09 -0500)]
eCryptfs: convert lookup_one_len() to lookup_one_len_nd()

Call the new lookup_one_len_nd() rather than lookup_one_len().  This fixes an
oops when stacked on NFS.

Note that there are still some issues with eCryptfs on NFS having to do with
directory deletion (I'm not getting an oops, just an -EBUSY).

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Documentation update
Erez Zadok [Mon, 12 Feb 2007 17:36:38 +0000 (12:36 -0500)]
Unionfs: Documentation update

Be little gentler & updated the URLs

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/: Move eCryptfs & Unionfs config options into a sub-menu
Josef 'Jeff' Sipek [Tue, 20 Feb 2007 04:35:32 +0000 (23:35 -0500)]
fs/: Move eCryptfs & Unionfs config options into a sub-menu

Using The Misc filesystems sub-menu for layered/stackable filesystems only
makes it harder for users to find eCryptfs/Unionfs.

Additionally, the menu can be easily turned into a menuconfig, which could
be used to turn on any VFS/VM functionality required by layered filesystems
(there is none at the moment).

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
16 years agofs/unionfs/: Use __roundup_pow_of_two instead of custom rounding code
Josef 'Jeff' Sipek [Thu, 1 Feb 2007 17:14:03 +0000 (12:14 -0500)]
fs/unionfs/: Use __roundup_pow_of_two instead of custom rounding code

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Don't duplicate the struct nameidata
Josef 'Jeff' Sipek [Sun, 28 Jan 2007 19:20:19 +0000 (14:20 -0500)]
fs/unionfs/: Don't duplicate the struct nameidata

The only fields that we have to watch out for are the dentry and vfsmount.
Additionally, this makes Unionfs gentler on the stack as nameidata is rather
large.

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Andrew Morton's comments
Josef 'Jeff' Sipek [Sun, 28 Jan 2007 19:20:49 +0000 (14:20 -0500)]
fs/unionfs/: Andrew Morton's comments

- rename {,un}lock_dentry to unionfs_{,un}lock_dentry
- few minor coding style fixes
- removed prototypes from .c files
- replaced dbstart macros etc with static inlines
- replaced UNIONFS_D(d)->sem semaphore with a mutex
- renamed sioq struct workqueue to superio_workqueue
- made unionfs_get_nlinks and alloc_whname not inlined

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: possible cleanups
Adrian Bunk [Thu, 25 Jan 2007 08:15:59 +0000 (03:15 -0500)]
fs/unionfs/: possible cleanups

This patch contains the following possible cleanups:
- every function should #include the headers containing the prototypes
  of it's global functions
- static functions in C files shouldn't be marked "inline", gcc should
  know best when to inline them
- make needlessly global code static
- #if 0 the following unused global function:
  - stale_inode.c: is_stale_inode()

Signed-off-by: Adrian Bunk <bunk@stusta.de>
[removed stale inode related fixes as stale_inode.c is gone]
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agofs/unionfs/: Remove stale_inode.c
Josef 'Jeff' Sipek [Sun, 28 Jan 2007 20:52:43 +0000 (15:52 -0500)]
fs/unionfs/: Remove stale_inode.c

The stale inode operations were heavily based on bad inode operations. This
patch removes stale_inode.c and converts all users of stale_inode_ops to
bad_inode_ops as there seems to be no reason to return ESTALE instead of
EIO.

This is the more appropriate than porting the bad_inode.c fix (commit
be6aab0e9fa6d3c6d75aa1e38ac972d8b4ee82b8) to stale_inode.c.

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Extended Attributes support
Josef "Jeff" Sipek [Sun, 28 Jan 2007 20:11:23 +0000 (15:11 -0500)]
Unionfs: Extended Attributes support

Extended attribute support.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Kconfig and Makefile
Josef "Jeff" Sipek [Sun, 28 Jan 2007 20:10:20 +0000 (15:10 -0500)]
Unionfs: Kconfig and Makefile

This patch contains the changes to fs Kconfig file, Makefiles, and Maintainers
file for Unionfs.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Unlink
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:47:57 +0000 (18:47 -0500)]
Unionfs: Unlink

This patch provides unlink functionality for Unionfs.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Include file
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:47:43 +0000 (18:47 -0500)]
Unionfs: Include file

Global include file - can be included from userspace by utilities.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Internal include file
Josef "Jeff" Sipek [Sun, 28 Jan 2007 20:05:29 +0000 (15:05 -0500)]
Unionfs: Internal include file

This patch contains an internal Unionfs include file. The include file is
specific to kernel code only, and therefore is separate from
include/linux/unionfs.h.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Helper macros/inlines
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:46:56 +0000 (18:46 -0500)]
Unionfs: Helper macros/inlines

This patch contains many macros and inline functions used thoughout Unionfs.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Handling of stale inodes
Josef "Jeff" Sipek [Sun, 28 Jan 2007 20:05:07 +0000 (15:05 -0500)]
Unionfs: Handling of stale inodes

Provides nicer handling of stale inodes.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Superblock operations
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:46:47 +0000 (18:46 -0500)]
Unionfs: Superblock operations

This patch contains the superblock operations for Unionfs.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Miscellaneous helper functions
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:46:39 +0000 (18:46 -0500)]
Unionfs: Miscellaneous helper functions

This patch contains miscellaneous helper functions used thoughout Unionfs.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Privileged operations workqueue
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:46:11 +0000 (18:46 -0500)]
Unionfs: Privileged operations workqueue

Workqueue & helper functions used to perform privileged operations on
behalf of the user process.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Rename
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:45:56 +0000 (18:45 -0500)]
Unionfs: Rename

This patch provides rename functionality for Unionfs.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Readdir state
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:45:48 +0000 (18:45 -0500)]
Unionfs: Readdir state

This file contains the routines for maintaining readdir state.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Main module functions
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:45:28 +0000 (18:45 -0500)]
Unionfs: Main module functions

Module init & cleanup code, as well as interposition functions.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Lookup helper functions
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:45:13 +0000 (18:45 -0500)]
Unionfs: Lookup helper functions

This patch provides helper functions for the lookup operations in Unionfs.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Inode operations
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:44:54 +0000 (18:44 -0500)]
Unionfs: Inode operations

This patch provides the inode operations for Unionfs.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Directory manipulation helper functions
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:44:35 +0000 (18:44 -0500)]
Unionfs: Directory manipulation helper functions

This patch contains directory manipulation helper functions.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Directory file operations
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:44:24 +0000 (18:44 -0500)]
Unionfs: Directory file operations

This patch provides directory file operations.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: File operations
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:44:05 +0000 (18:44 -0500)]
Unionfs: File operations

This patch provides the file operations for Unionfs.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Dentry operations
Josef "Jeff" Sipek [Sun, 28 Jan 2007 20:05:21 +0000 (15:05 -0500)]
Unionfs: Dentry operations

This patch contains the dentry operations for Unionfs.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Copyup Functionality
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:42:32 +0000 (18:42 -0500)]
Unionfs: Copyup Functionality

This patch contains the functions used to perform copyup operations in unionfs.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Common file operations
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:42:16 +0000 (18:42 -0500)]
Unionfs: Common file operations

This patch contains helper functions used through the rest of the code which
pertains to files.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agoUnionfs: Branch management functionality
Josef "Jeff" Sipek [Sun, 21 Jan 2007 23:42:01 +0000 (18:42 -0500)]
Unionfs: Branch management functionality

This patch contains the ioctls to increase the union generation and to query
which branch a file exists on.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
16 years agolookup_one_len_nd - lookup_one_len with nameidata argument
Josef "Jeff" Sipek [Sun, 29 Apr 2007 19:36:03 +0000 (15:36 -0400)]
lookup_one_len_nd - lookup_one_len with nameidata argument

This patch renames lookup_one_len to lookup_one_len_nd, and adds a nameidata
argument. An inline function, lookup_one_len (which calls lookup_one_len_nd
with nd == NULL) preserves original behavior.

The following Unionfs patches depend on this one.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
16 years agoUnionfs: Documentation
Josef "Jeff" Sipek [Tue, 20 Feb 2007 04:31:35 +0000 (23:31 -0500)]
Unionfs: Documentation

This patch contains documentation for Unionfs. You will find several files
outlining basic unification concepts and rename semantics.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: David Quigley <dquigley@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agoLinux 2.6.25.20 v2.6.25.20
Greg Kroah-Hartman [Mon, 10 Nov 2008 18:50:34 +0000 (10:50 -0800)]
Linux 2.6.25.20

17 years agonetfilter: restore lost ifdef guarding defrag exception
Patrick McHardy [Wed, 22 Oct 2008 17:41:31 +0000 (19:41 +0200)]
netfilter: restore lost ifdef guarding defrag exception

netfilter: restore lost #ifdef guarding defrag exception

Upstream commit 38f7ac3eb:

Nir Tzachar <nir.tzachar@gmail.com> reported a warning when sending
fragments over loopback with NAT:

[ 6658.338121] WARNING: at net/ipv4/netfilter/nf_nat_standalone.c:89 nf_nat_fn+0x33/0x155()

The reason is that defragmentation is skipped for already tracked connections.
This is wrong in combination with NAT and ip_conntrack actually had some ifdefs
to avoid this behaviour when NAT is compiled in.

The entire "optimization" may seem a bit silly, for now simply restoring the
lost #ifdef is the easiest solution until we can come up with something better.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agonetfilter: snmp nat leaks memory in case of failure
Ilpo Järvinen [Wed, 22 Oct 2008 17:41:29 +0000 (19:41 +0200)]
netfilter: snmp nat leaks memory in case of failure

netfilter: snmp nat leaks memory in case of failure

Upstream commit 311670f3e:

Signed-off-by: Ilpo Jarvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years agonetfilter: xt_iprange: fix range inversion match
Alexey Dobriyan [Wed, 22 Oct 2008 17:41:28 +0000 (19:41 +0200)]
netfilter: xt_iprange: fix range inversion match

netfilter: xt_iprange: fix range inversion match

Upstream commit 6def1eb48:

Inverted IPv4 v1 and IPv6 v0 matches don't match anything since 2.6.25-rc1!

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoACPI: video: fix brightness allocation
Julia Jomantaite [Tue, 28 Oct 2008 03:50:57 +0000 (23:50 -0400)]
ACPI: video: fix brightness allocation

Thanks to Arjan for spotting this for .stable:
http://www.kerneloops.org/search.php?search=acpi_video_switch_brightness

upstream commit 469778c1740fcf3113498b6fdf4559bdec25c58f

ACPI: video: fix brightness allocation

Fix use of uninitialized device->brightness.

Signed-off-by: Julia Jomantaite <julia.jomantaite@gmail.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agomath-emu: Fix signalling of underflow and inexact while packing result.
Kumar Gala [Wed, 22 Oct 2008 05:19:00 +0000 (22:19 -0700)]
math-emu: Fix signalling of underflow and inexact while packing result.

[ Upstream commit 930cc144a043ff95e56b6888fa51c618b33f89e7 ]

I'm trying to move the powerpc math-emu code to use the include/math-emu bits.

In doing so I've been using TestFloat to see how good or bad we are
doing.  For the most part the current math-emu code that PPC uses has
a number of issues that the code in include/math-emu seems to solve
(plus bugs we've had for ever that no one every realized).

Anyways, I've come across a case that we are flagging underflow and
inexact because we think we have a denormalized result from a double
precision divide:

000.FFFFFFFFFFFFF / 3FE.FFFFFFFFFFFFE
soft: 001.0000000000000 .....  syst: 001.0000000000000 ...ux

What it looks like is the results out of FP_DIV_D are:

D:
sign:   0
mantissa: 01000000 00000000
exp:  -1023 (0)

The problem seems like we aren't normalizing the result and bumping the exp.

Now that I'm digging into this a bit I'm thinking my issue has to do with
the fix DaveM put in place from back in Aug 2007 (commit
405849610fd96b4f34cd1875c4c033228fea6c0f):

[MATH-EMU]: Fix underflow exception reporting.

    2) we ended up rounding back up to normal (this is the case where
       we set the exponent to 1 and set the fraction to zero), this
       should set inexact too
...

    Another example, "0x0.0000000000001p-1022 / 16.0", should signal both
    inexact and underflow.  The cpu implementations and ieee1754
    literature is very clear about this.  This is case #2 above.

Here is the distilled glibc test case from Jakub Jelinek which prompted that
commit:

--------------------
#include <float.h>
#include <fenv.h>
#include <stdio.h>

volatile double d = DBL_MIN;
volatile double e = 0x0.0000000000001p-1022;
volatile double f = 16.0;
int
main (void)
{
  printf ("%x\n", fetestexcept (FE_UNDERFLOW));
  d /= f;
  printf ("%x\n", fetestexcept (FE_UNDERFLOW));
  e /= f;
  printf ("%x\n", fetestexcept (FE_UNDERFLOW));
  return 0;
}
--------------------

It looks like the case I have we are exact before rounding, but think it
looks like the rounding case since it appears as if "overflow is set".

000.FFFFFFFFFFFFF / 3FE.FFFFFFFFFFFFE = 001.0000000000000

I think the following adds the check for my case and still works for the
issue your commit was trying to resolve.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agosparc64: Fix race in arch/sparc64/kernel/trampoline.S
Andrea Shepard [Mon, 20 Oct 2008 06:33:03 +0000 (23:33 -0700)]
sparc64: Fix race in arch/sparc64/kernel/trampoline.S

[ Upstream commit e0037df3852b4b60edbe01f70f4968e4a9fdb272 ]

Make arch/sparc64/kernel/trampoline.S in 2.6.27.1 lock prom_entry_lock
when calling the PROM.  This prevents a race condition that I observed
causing a hang on startup on a 12-CPU E4500.

I am not subscribed to this list, so please CC me on replies.

Signed-off-by: Andrea Shepard <andrea@persephoneslair.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agonet: Fix netdev_run_todo dead-lock
Herbert Xu [Tue, 7 Oct 2008 22:50:03 +0000 (15:50 -0700)]
net: Fix netdev_run_todo dead-lock

[ Upstream commit 58ec3b4db9eb5a28e3aec5f407a54e28f7039c19 ]

Benjamin Thery tracked down a bug that explains many instances
of the error

unregister_netdevice: waiting for %s to become free. Usage count = %d

It turns out that netdev_run_todo can dead-lock with itself if
a second instance of it is run in a thread that will then free
a reference to the device waited on by the first instance.

The problem is really quite silly.  We were trying to create
parallelism where none was required.  As netdev_run_todo always
follows a RTNL section, and that todo tasks can only be added
with the RTNL held, by definition you should only need to wait
for the very ones that you've added and be done with it.

There is no need for a second mutex or spinlock.

This is exactly what the following patch does.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agotcpv6: fix option space offsets with md5
Ilpo Järvinen [Wed, 8 Oct 2008 21:36:33 +0000 (14:36 -0700)]
tcpv6: fix option space offsets with md5

[ Upstream commit 53b125779fb0b29e5b316bf3dc7d199e6dcea567 ]

More breakage :-), part of timestamps just were previously
overwritten.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoACPI: dock: avoid check _STA method
Shaohua Li [Thu, 6 Nov 2008 19:18:55 +0000 (14:18 -0500)]
ACPI: dock: avoid check _STA method

commit 8b59560a3baf2e7c24e0fb92ea5d09eca92805db upstream.

ACPI: dock: avoid check _STA method

In some BIOSes, every _STA method call will send a notification again,
this cause freeze. And in some BIOSes, it appears _STA should be called
after _DCK. This tries to avoid calls _STA, and still keep the device
present check.

http://bugzilla.kernel.org/show_bug.cgi?id=10431

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoALSA: use correct lock in snd_ctl_dev_disconnect()
Takashi Iwai [Sun, 7 Sep 2008 10:51:13 +0000 (12:51 +0200)]
ALSA: use correct lock in snd_ctl_dev_disconnect()

commit d8009882e9f5e1a76986c741f071edd2ad760c97 upstream

The lock used in snd_ctl_dev_disconnect() should be card->ctl_files_rwlock
for protection of card->ctl_files entries, instead of card->controls_rwsem.

Reported-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: Chris Wedgwood <cw@f00f.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agofile caps: always start with clear bprm->caps_*
Serge Hallyn [Thu, 30 Oct 2008 16:52:23 +0000 (11:52 -0500)]
file caps: always start with clear bprm->caps_*

commit 3318a386e4ca68c76e0294363d29bdc46fcad670 upstream

While Linux doesn't honor setuid on scripts.  However, it mistakenly
behaves differently for file capabilities.

This patch fixes that behavior by making sure that get_file_caps()
begins with empty bprm->caps_*.  That way when a script is loaded,
its bprm->caps_* may be filled when binfmt_misc calls prepare_binprm(),
but they will be cleared again when binfmt_elf calls prepare_binprm()
next to read the interpreter's file capabilities.

Signed-off-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: David Howells <dhowells@redhat.com>
Acked-by: Andrew G. Morgan <morgan@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agolibertas: fix buffer overrun
Johannes Berg [Sun, 2 Nov 2008 19:30:21 +0000 (19:30 +0000)]
libertas: fix buffer overrun

commit 48735d8d8bd701b1e0cd3d49c21e5e385ddcb077 upstream

If somebody sends an invalid beacon/probe response, that can trash the
whole BSS descriptor. The descriptor is, luckily, large enough so that
it cannot scribble past the end of it; it's well above 400 bytes long.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agonet: Fix recursive descent in __scm_destroy().
David Miller [Thu, 6 Nov 2008 08:37:40 +0000 (00:37 -0800)]
net: Fix recursive descent in __scm_destroy().

commit f8d570a4745835f2238a33b537218a1bb03fc671 and
3b53fbf4314594fa04544b02b2fc6e607912da18 upstream (because once wasn't
good enough...)

__scm_destroy() walks the list of file descriptors in the scm_fp_list
pointed to by the scm_cookie argument.

Those, in turn, can close sockets and invoke __scm_destroy() again.

There is nothing which limits how deeply this can occur.

The idea for how to fix this is from Linus.  Basically, we do all of
the fput()s at the top level by collecting all of the scm_fp_list
objects hit by an fput().  Inside of the initial __scm_destroy() we
keep running the list until it is empty.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoedac cell: fix incorrect edac_mode
Benjamin Herrenschmidt [Mon, 20 Oct 2008 16:50:07 +0000 (16:50 +0000)]
edac cell: fix incorrect edac_mode

commit 3b274f44d2ca05f719fe39947b6a5293a2dbd8fd upstream

The cell_edac driver is setting the edac_mode field of the csrow's to an
incorrect value, causing the sysfs show routine for that field to go out
of an array bound and Oopsing the kernel when used.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Doug Thompson <dougthompson@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoext[234]: Avoid printk floods in the face of directory corruption (CVE-2008-3528)
Eric Sandeen [Wed, 22 Oct 2008 15:11:52 +0000 (10:11 -0500)]
ext[234]: Avoid printk floods in the face of directory corruption (CVE-2008-3528)

This is a trivial backport of the following upstream commits:

bd39597cbd42a784105a04010100e27267481c67 (ext2)
cdbf6dba28e8e6268c8420857696309470009fd9 (ext3)
9d9f177572d9e4eba0f2e18523b44f90dd51fe74 (ext4)

This addresses CVE-2008-3528

ext[234]: Avoid printk floods in the face of directory corruption

Note: some people thinks this represents a security bug, since it
might make the system go away while it is printing a large number of
console messages, especially if a serial console is involved.  Hence,
it has been assigned CVE-2008-3528, but it requires that the attacker
either has physical access to your machine to insert a USB disk with a
corrupted filesystem image (at which point why not just hit the power
button), or is otherwise able to convince the system administrator to
mount an arbitrary filesystem image (at which point why not just
include a setuid shell or world-writable hard disk device file or some
such).  Me, I think they're just being silly. --tytso

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org
Cc: Eugene Teo <eugeneteo@kernel.sg>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agogpiolib: fix oops in gpio_get_value_cansleep()
David Brownell [Mon, 20 Oct 2008 16:50:10 +0000 (16:50 +0000)]
gpiolib: fix oops in gpio_get_value_cansleep()

commit 978ccaa8ea5d8c7bf6b676209f2fc126eae6355b upstream

We can get the following oops from gpio_get_value_cansleep() when a GPIO
controller doesn't provide a get() callback:

 Unable to handle kernel paging request for instruction fetch
 Faulting instruction address: 0x00000000
 Oops: Kernel access of bad area, sig: 11 [#1]
 [...]
 NIP [00000000] 0x0
 LR [c0182fb0] gpio_get_value_cansleep+0x40/0x50
 Call Trace:
 [c7b79e80] [c0183f28] gpio_value_show+0x5c/0x94
 [c7b79ea0] [c01a584c] dev_attr_show+0x30/0x7c
 [c7b79eb0] [c00d6b48] fill_read_buffer+0x68/0xe0
 [c7b79ed0] [c00d6c54] sysfs_read_file+0x94/0xbc
 [c7b79ef0] [c008f24c] vfs_read+0xb4/0x16c
 [c7b79f10] [c008f580] sys_read+0x4c/0x90
 [c7b79f40] [c0013a14] ret_from_syscall+0x0/0x38

It's OK to request the value of *any* GPIO; most GPIOs are bidirectional,
so configuring them as outputs just enables an output driver and doesn't
disable the input logic.

So the problem is that gpio_get_value_cansleep() isn't making the same
sanity check that gpio_get_value() does: making sure this GPIO isn't one
of the atypical "no input logic" cases.

Reported-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoLinux 2.6.25.19 v2.6.25.19
Greg Kroah-Hartman [Wed, 22 Oct 2008 21:19:25 +0000 (14:19 -0700)]
Linux 2.6.25.19