3.2.40-stable review
Subsystems (90)
PATCH 147/153 kmod: introduce call_modprobe() helper
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit 3e63a93b987685f02421e18b2aa452d20553a88b upstream.
No functional changes. Move the call_usermodehelper code from __request_module() into the new simple helper, call_modprobe().
--- kernel/kmod.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-)
kernel/kmod.c +16 -8
@@ -58,6 +58,21 @@ static DEFINE_SPINLOCK(umh_sysctl_lock);*/ char modprobe_path[KMOD_PATH_LEN ] ="/sbin/modprobe" ; +static int call_modprobe (char *module_name,int wait) +{ +static char *envp[] = { +"HOME=/" , +"TERM=linux" , +"PATH=/sbin:/usr/sbin:/bin:/usr/bin" , +NULL + }; + +char *argv[] = { modprobe_path,"-q" ,"--" , module_name,NULL }; + +return call_usermodehelper_fns (modprobe_path, argv, envp, + wait,NULL ,NULL ,NULL ); +} +/** * __request_module - try to load a kernel module * @wait: wait (or not) for the operation to complete
@@ -79,11 +94,6 @@ int __request_module(bool wait, const chchar module_name[MODULE_NAME_LEN ];unsigned int max_modprobes;int ret; -char *argv[] = { modprobe_path,"-q" ,"--" , module_name,NULL }; -static char *envp[] = {"HOME=/" , -"TERM=linux" , -"PATH=/sbin:/usr/sbin:/bin:/usr/bin" , -NULL };static atomic_t kmod_concurrent =ATOMIC_INIT (0 );#define MAX_KMOD_CONCURRENT 50/* Completely arbitrary value - KAO */ static int kmod_loop_msg;
@@ -126,9 +136,7 @@ int __request_module(bool wait, const chtrace_module_request (module_name, wait, _RET_IP_); - ret =call_usermodehelper_fns (modprobe_path, argv, envp, - wait ?UMH_WAIT_PROC :UMH_WAIT_EXEC , -NULL ,NULL ,NULL ); + ret =call_modprobe (module_name, wait ?UMH_WAIT_PROC :UMH_WAIT_EXEC );atomic_dec (&kmod_concurrent);return ret;
PATCH 148/153 kmod: make __request_module() killable
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit 1cc684ab75123efe7ff446eb821d44375ba8fa30 upstream.
As Tetsuo Handa pointed out, request_module() can stress the system while the oom-killed caller sleeps in TASK_UNINTERRUPTIBLE.
The task T uses "almost all" memory, then it does something which triggers request_module(). Say, it can simply call sys_socket(). This in turn needs more memory and leads to OOM. oom-killer correctly chooses T and kills it, but this can't help because it sleeps in TASK_UNINTERRUPTIBLE and after that oom-killer becomes "disabled" by the TIF_MEMDIE task T.
Make __request_module() killable. The only necessary change is that call_modprobe() should kmalloc argv and module_name, they can't live in the stack if we use UMH_KILLABLE. This memory is freed via call_usermodehelper_freeinfo()->cleanup.
--- kernel/kmod.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-)
kernel/kmod.c +24 -2
@@ -58,6 +58,12 @@ static DEFINE_SPINLOCK(umh_sysctl_lock);*/ char modprobe_path[KMOD_PATH_LEN ] ="/sbin/modprobe" ; +static void free_modprobe_argv (struct subprocess_info *info) +{ +kfree (info->argv[3 ]);/* check call_modprobe() */ +kfree (info->argv); +} +static int call_modprobe (char *module_name,int wait) {static char *envp[] = {
@@ -67,10 +73,26 @@ static int call_modprobe(char *module_na NULL }; -char *argv[] = { modprobe_path,"-q" ,"--" , module_name,NULL }; +char **argv =kmalloc (sizeof (char *[5 ]),GFP_KERNEL ); +if (!argv) + goto out; + + module_name =kstrdup (module_name,GFP_KERNEL ); +if (!module_name) + goto free_argv; + + argv[0 ] = modprobe_path; + argv[1 ] ="-q" ; + argv[2 ] ="--" ; + argv[3 ] = module_name;/* check free_modprobe_argv() */ + argv[4 ] =NULL ;return call_usermodehelper_fns (modprobe_path, argv, envp, - wait,NULL ,NULL ,NULL ); + wait |UMH_KILLABLE ,NULL , free_modprobe_argv,NULL ); +free_argv: +kfree (argv); +out: +return -ENOMEM ; }/**
PATCH 149/153 exec: use -ELOOP for max recursion depth
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
commit d740269867021faf4ce38a449353d2b986c34a67 upstream.
To avoid an explosion of request_module calls on a chain of abusive scripts, fail maximum recursion with -ELOOP instead of -ENOEXEC. As soon as maximum recursion depth is hit, the error will fail all the way back up the chain, aborting immediately.
This also has the side-effect of stopping the user's shell from attempting to reexecute the top-level file as a shell script. As seen in the dash source:
if (cmd != path_bshell && errno == ENOEXEC) {
*argv-- = cmd;
*argv = cmd = path_bshell;
goto repeat;
}The above logic was designed for running scripts automatically that lacked the "#!" header, not to re-try failed recursion. On a legitimate -ENOEXEC, things continue to behave as the shell expects.
Additionally, when tracking recursion, the binfmt handlers should not be involved. The recursion being tracked is the depth of calls through search_binary_handler(), so that function should be exclusively responsible for tracking the depth.
--- fs/binfmt_em86.c | 1 - fs/binfmt_misc.c | 6 ------ fs/binfmt_script.c | 4 +--- fs/exec.c | 10 +++++----- include/linux/binfmts.h | 2 -- 5 files changed, 6 insertions(+), 17 deletions(-)
fs/binfmt_em86.c +0 -1
@@ -42,7 +42,6 @@ static int load_em86(struct linux_binprmreturn -ENOEXEC ; } - bprm->recursion_depth++;/* Well, the bang-shell is implicit... */ allow_write_access (bprm->file);fput (bprm->file); bprm->file =NULL ;
fs/binfmt_misc.c +0 -6
@@ -116,10 +116,6 @@ static int load_misc_binary(struct linuxif (!enabled) goto _ret; - retval = -ENOEXEC ; -if (bprm->recursion_depth >BINPRM_MAX_RECURSION ) - goto _ret; -/* to keep locking time low, we copy the interpreter string */ read_lock (&entries_lock); fmt =check_file (bprm);
@@ -199,8 +195,6 @@ static int load_misc_binary(struct linuxif (retval <0 ) goto _error; - bprm->recursion_depth++; - retval =search_binary_handler (bprm, regs);if (retval <0 ) goto _error;
fs/binfmt_script.c +1 -3
@@ -22,15 +22,13 @@ static int load_script(struct linux_binpchar interp[BINPRM_BUF_SIZE ];int retval; -if ((bprm->buf[0 ] !='#' ) || (bprm->buf[1 ] !='!' ) || - (bprm->recursion_depth >BINPRM_MAX_RECURSION )) +if ((bprm->buf[0 ] !='#' ) || (bprm->buf[1 ] !='!' ))return -ENOEXEC ;/* * This section does the #! interpretation. * Sorta complicated, but hopefully it will work. -TYT */ - bprm->recursion_depth++;allow_write_access (bprm->file);fput (bprm->file); bprm->file =NULL ;
fs/exec.c +5 -5
@@ -1385,6 +1385,10 @@ int search_binary_handler(struct linux_bstruct linux_binfmt *fmt;pid_t old_pid; +/* This allows 4 levels of binfmt rewrites before failing hard. */ +if (depth >5 ) +return -ELOOP ; + retval =security_bprm_check (bprm);if (retval)return retval;
@@ -1408,12 +1412,8 @@ int search_binary_handler(struct linux_bif (!try_module_get (fmt->module))continue ;read_unlock (&binfmt_lock); + bprm->recursion_depth = depth +1 ; retval =fn (bprm, regs); -/* -* Restore the depth counter to its starting value -* in this call, so we don't have to rely on every -* load_binary function to restore it on return. -*/ bprm->recursion_depth = depth;if (retval >=0 ) {if (depth ==0 )
include/linux/binfmts.h +0 -2
@@ -67,8 +67,6 @@ struct linux_binprm {#define BINPRM_FLAGS_EXECFD_BIT 1#define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT) -#define BINPRM_MAX_RECURSION 4 -/* Function parameter for binfmt->coredump */ struct coredump_params {long signr;
PATCH 150/153 fs: cachefiles: add support for large files in filesystem caching
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Lecher <[email protected]>
commit 98c350cda2c14a343d34ea01a3d9c24fea5ec66d upstream.
Support the caching of large files.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=31182
[bwh: Backported to 3.2:
- Adjust context
- dentry_open() takes dentry and vfsmount pointers, not a path pointer]
---
fs/cachefiles/rdwr.c +1 -1
@@ -918,7 +918,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)* own time */ dget (object->backer);mntget (cache->mnt); - file =dentry_open (object->backer, cache->mnt,O_RDWR , + file =dentry_open (object->backer, cache->mnt,O_RDWR |O_LARGEFILE , cache->cache_cred);if (IS_ERR (file)) { ret =PTR_ERR (file);
PATCH 151/153 ext4: rewrite punch hole to use ext4_ext_remove_space()
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Czerner <[email protected]>
commit 5f95d21fb6f2aaa52830e5b7fb405f6c71d3ab85 upstream.
This commit rewrites ext4 punch hole implementation to use ext4_ext_remove_space() instead of its home gown way of doing this via ext4_ext_map_blocks(). There are several reasons for changing this.
Firstly it is quite non obvious that punching hole needs to ext4_ext_map_blocks() to punch a hole, especially given that this function should map blocks, not unmap it. It also required a lot of new code in ext4_ext_map_blocks().
Secondly the design of it is not very effective. The reason is that we are trying to punch out blocks in ext4_ext_punch_hole() in opposite direction than in ext4_ext_rm_leaf() which causes the ext4_ext_rm_leaf() to iterate through the whole tree from the end to the start to find the requested extent for every extent we are going to punch out.
And finally the current implementation does not use the existing code, but bring a lot of new code, which is IMO unnecessary since there already is some infrastructure we can use. Specifically ext4_ext_remove_space().
This commit changes ext4_ext_remove_space() to accept 'end' parameter so we can not only truncate to the end of file, but also remove the space in the middle of the file (punch a hole). Moreover, because the last block to punch out, might be in the middle of the extent, we have to split the extent at 'end + 1' so ext4_ext_rm_leaf() can easily either remove the whole fist part of split extent, or change its size.
ext4_ext_remove_space() is then used to actually remove the space (extents) from within the hole, instead of ext4_ext_map_blocks().
Note that this also fix the issue with punch hole, where we would forget to remove empty index blocks from the extent tree, resulting in double free block error and file system corruption. This is simply because we now use different code path, where this problem does not exist.
This has been tested with fsx running for several days and xfstests, plus xfstest #251 with '-o discard' run on the loop image (which converts discard requestes into punch hole to the backing file). All of it on 1K and 4K file system block size.
[bwh: Backported to 3.2.y: move EXT4_EXT_DATA_VALID{1,2} along with the
other extent splitting flags]
--- fs/ext4/extents.c | 170 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 88 insertions(+), 82 deletions(-)
fs/ext4/extents.c +91 -85
@@ -45,6 +45,17 @@#include <trace/events/ext4.h> +/* +* used by extent splitting. +*/ +#define EXT4_EXT_MAY_ZEROOUT 0x1/* safe to zeroout if split fails \ +due to ENOSPC */ +#define EXT4_EXT_MARK_UNINIT1 0x2/* mark first half uninitialized */ +#define EXT4_EXT_MARK_UNINIT2 0x4/* mark second half uninitialized */ + +#define EXT4_EXT_DATA_VALID1 0x8/* first half contains valid data */ +#define EXT4_EXT_DATA_VALID2 0x10/* second half contains valid data */ + static int ext4_split_extent(handle_t *handle, struct inode *inode, struct ext4_ext_path *path,
@@ -52,6 +63,13 @@ static int ext4_split_extent(handle_t *hint split_flag, int flags); +static int ext4_split_extent_at (handle_t *handle, +struct inode *inode, +struct ext4_ext_path *path, +ext4_lblk_t split, +int split_flag, +int flags); +static int ext4_ext_truncate_extend_restart (handle_t *handle,struct inode *inode,int needed)
@@ -2324,7 +2342,7 @@ ext4_ext_rm_leaf(handle_t *handle, strucstruct ext4_extent *ex;/* the header must be checked already in ext4_ext_remove_space() */ -ext_debug ("truncate since %u in leaf\n" , start); +ext_debug ("truncate since %u in leaf to %u\n" , start, end);if (!path[depth].p_hdr) path[depth].p_hdr =ext_block_hdr (path[depth].p_bh); eh = path[depth].p_hdr;
@@ -2359,7 +2377,7 @@ ext4_ext_rm_leaf(handle_t *handle, strucext_debug (" border %u:%u\n" , a, b);/* If this extent is beyond the end of the hole, skip it */ -if (end <= ex_ee_block) { +if (end < ex_ee_block) { ex--; ex_ee_block =le32_to_cpu (ex->ee_block); ex_ee_len =ext4_ext_get_actual_len (ex);
@@ -2498,7 +2516,8 @@ ext4_ext_more_to_rm(struct ext4_ext_pathreturn 1 ; } -static int ext4_ext_remove_space (struct inode *inode,ext4_lblk_t start) +static int ext4_ext_remove_space (struct inode *inode,ext4_lblk_t start, +ext4_lblk_t end) {struct super_block *sb = inode->i_sb;int depth =ext_depth (inode);
@@ -2507,7 +2526,7 @@ static int ext4_ext_remove_space(structhandle_t *handle;int i, err; -ext_debug ("truncate since %u\n" , start); +ext_debug ("truncate since %u to %u\n" , start, end);/* probably first extent we're gonna free will be last in block */ handle =ext4_journal_start (inode, depth +1 );
@@ -2520,6 +2539,61 @@ again:trace_ext4_ext_remove_space (inode, start, depth);/* +* Check if we are removing extents inside the extent tree. If that +* is the case, we are going to punch a hole inside the extent tree +* so we have to check whether we need to split the extent covering +* the last block to remove so we can easily remove the part of it +* in ext4_ext_rm_leaf(). +*/ +if (end <EXT_MAX_BLOCKS -1 ) { +struct ext4_extent *ex; +ext4_lblk_t ee_block; + +/* find extent for this block */ + path =ext4_ext_find_extent (inode, end,NULL ); +if (IS_ERR (path)) { +ext4_journal_stop (handle); +return PTR_ERR (path); + } + depth =ext_depth (inode); + ex = path[depth].p_ext; +if (!ex) + goto cont; + + ee_block =le32_to_cpu (ex->ee_block); + +/* +* See if the last block is inside the extent, if so split +* the extent at 'end' block so we can easily remove the +* tail of the first part of the split extent in +* ext4_ext_rm_leaf(). +*/ +if (end >= ee_block && + end < ee_block +ext4_ext_get_actual_len (ex) -1 ) { +int split_flag =0 ; + +if (ext4_ext_is_uninitialized (ex)) + split_flag =EXT4_EXT_MARK_UNINIT1 | +EXT4_EXT_MARK_UNINIT2 ; + +/* +* Split the extent in two so that 'end' is the last +* block in the first new extent +*/ + err =ext4_split_extent_at (handle, inode, path, + end +1 , split_flag, +EXT4_GET_BLOCKS_PRE_IO | +EXT4_GET_BLOCKS_PUNCH_OUT_EXT ); + +if (err <0 ) + goto out; + } +ext4_ext_drop_refs (path); +kfree (path); + } +cont: + +/* * We start scanning from right side, freeing all the blocks * after i_size and walking into the tree depth-wise. */
@@ -2531,6 +2605,7 @@ again: } path[0 ].p_depth = depth; path[0 ].p_hdr =ext_inode_hdr (inode); +if (ext4_ext_check (inode, path[0 ].p_hdr, depth)) { err = -EIO ; goto out;
@@ -2542,7 +2617,7 @@ again:/* this is leaf block */ err =ext4_ext_rm_leaf (handle, inode, path, &partial_cluster, start, -EXT_MAX_BLOCKS -1 ); + end);/* root level has p_bh == NULL, brelse() eats this */ brelse (path[i].p_bh); path[i].p_bh =NULL ;
@@ -2725,17 +2800,6 @@ static int ext4_ext_zeroout(struct inode }/* -* used by extent splitting. -*/ -#define EXT4_EXT_MAY_ZEROOUT 0x1/* safe to zeroout if split fails \ -due to ENOSPC */ -#define EXT4_EXT_MARK_UNINIT1 0x2/* mark first half uninitialized */ -#define EXT4_EXT_MARK_UNINIT2 0x4/* mark second half uninitialized */ - -#define EXT4_EXT_DATA_VALID1 0x8/* first half contains valid data */ -#define EXT4_EXT_DATA_VALID2 0x10/* second half contains valid data */ - -/* * ext4_split_extent_at() splits an extent at given block. * * @handle: the journal handle
@@ -4277,7 +4341,7 @@ void ext4_ext_truncate(struct inode *ino last_block = (inode->i_size + sb->s_blocksize -1 ) >>EXT4_BLOCK_SIZE_BITS (sb); - err =ext4_ext_remove_space (inode, last_block); + err =ext4_ext_remove_space (inode, last_block,EXT_MAX_BLOCKS -1 );/* In a multi-transaction truncate, we only make the final * transaction synchronous.
@@ -4754,14 +4818,12 @@ int ext4_ext_punch_hole(struct file *fil {struct inode *inode = file->f_path.dentry->d_inode;struct super_block *sb = inode->i_sb; -struct ext4_ext_cache cache_ex; -ext4_lblk_t first_block, last_block, num_blocks, iblock, max_blocks; +ext4_lblk_t first_block, stop_block;struct address_space *mapping = inode->i_mapping; -struct ext4_map_blocks map;handle_t *handle;loff_t first_page, last_page, page_len;loff_t first_page_offset, last_page_offset; -int ret, credits, blocks_released, err =0 ; +int credits, err =0 ;/* No need to punch hole beyond i_size */ if (offset >= inode->i_size)
@@ -4777,10 +4839,6 @@ int ext4_ext_punch_hole(struct file *fil offset; } - first_block = (offset + sb->s_blocksize -1 ) >> -EXT4_BLOCK_SIZE_BITS (sb); - last_block = (offset + length) >>EXT4_BLOCK_SIZE_BITS (sb); - first_page = (offset +PAGE_CACHE_SIZE -1 ) >>PAGE_CACHE_SHIFT ; last_page = (offset + length) >>PAGE_CACHE_SHIFT ;
@@ -4859,7 +4917,6 @@ int ext4_ext_punch_hole(struct file *fil } } -/* * If i_size is contained in the last page, we need to * unmap and zero the partial page after i_size
@@ -4879,73 +4936,22 @@ int ext4_ext_punch_hole(struct file *fil } } + first_block = (offset + sb->s_blocksize -1 ) >> +EXT4_BLOCK_SIZE_BITS (sb); + stop_block = (offset + length) >>EXT4_BLOCK_SIZE_BITS (sb); +/* If there are no blocks to remove, return now */ -if (first_block >= last_block) +if (first_block >= stop_block) goto out;down_write (&EXT4_I (inode)->i_data_sem);ext4_ext_invalidate_cache (inode);ext4_discard_preallocations (inode); -/* -* Loop over all the blocks and identify blocks -* that need to be punched out -*/ - iblock = first_block; - blocks_released =0 ; -while (iblock < last_block) { - max_blocks = last_block - iblock; - num_blocks =1 ; -memset (&map,0 ,sizeof (map)); - map.m_lblk = iblock; - map.m_len = max_blocks; - ret =ext4_ext_map_blocks (handle, inode, &map, -EXT4_GET_BLOCKS_PUNCH_OUT_EXT ); - -if (ret >0 ) { - blocks_released += ret; - num_blocks = ret; - }else if (ret ==0 ) { -/* -* If map blocks could not find the block, -* then it is in a hole. If the hole was -* not already cached, then map blocks should -* put it in the cache. So we can get the hole -* out of the cache -*/ -memset (&cache_ex,0 ,sizeof (cache_ex)); -if ((ext4_ext_check_cache (inode, iblock, &cache_ex)) && - !cache_ex.ec_start) { - -/* The hole is cached */ - num_blocks = cache_ex.ec_block + - cache_ex.ec_len - iblock; - - }else { -/* The block could not be identified */ - err = -EIO ; -break ; - } - }else { -/* Map blocks error */ - err = ret; -break ; - } + err =ext4_ext_remove_space (inode, first_block, stop_block -1 ); -if (num_blocks ==0 ) { -/* This condition should never happen */ -ext_debug ("Block lookup failed" ); - err = -EIO ; -break ; - } - - iblock += num_blocks; - } - -if (blocks_released >0 ) { -ext4_ext_invalidate_cache (inode); -ext4_discard_preallocations (inode); - } +ext4_ext_invalidate_cache (inode); +ext4_discard_preallocations (inode);if (IS_SYNC (inode))ext4_handle_sync (handle);
PATCH 152/153 ext4: fix hole punch failure when depth is greater than 0
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ashish Sangwan <[email protected]>
commit 968dee77220768a5f52cf8b21d0bdb73486febef upstream.
Whether to continue removing extents or not is decided by the return value of function ext4_ext_more_to_rm() which checks 2 conditions:
a) if there are no more indexes to process.
b) if the number of entries are decreased in the header of "depth -1".
In case of hole punch, if the last block to be removed is not part of the last extent index than this index will not be deleted, hence the number of valid entries in the extent header of "depth - 1" will remain as it is and ext4_ext_more_to_rm will return 0 although the required blocks are not yet removed.
This patch fixes the above mentioned problem as instead of removing the extents from the end of file, it starts removing the blocks from the particular extent from which removing blocks is actually required and continue backward until done.
--- fs/ext4/extents.c | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-)
fs/ext4/extents.c +30 -18
@@ -2521,10 +2521,10 @@ static int ext4_ext_remove_space(struct {struct super_block *sb = inode->i_sb;int depth =ext_depth (inode); -struct ext4_ext_path *path; +struct ext4_ext_path *path =NULL ;ext4_fsblk_t partial_cluster =0 ;handle_t *handle; -int i, err; +int i =0 , err;ext_debug ("truncate since %u to %u\n" , start, end);
@@ -2557,8 +2557,12 @@ again: } depth =ext_depth (inode); ex = path[depth].p_ext; -if (!ex) +if (!ex) { +ext4_ext_drop_refs (path); +kfree (path); + path =NULL ; goto cont; + } ee_block =le32_to_cpu (ex->ee_block);
@@ -2588,8 +2592,6 @@ again:if (err <0 ) goto out; } -ext4_ext_drop_refs (path); -kfree (path); } cont:
@@ -2598,19 +2600,27 @@ cont:* after i_size and walking into the tree depth-wise. */ depth =ext_depth (inode); - path =kzalloc (sizeof (struct ext4_ext_path ) * (depth +1 ),GFP_NOFS ); -if (path ==NULL ) { -ext4_journal_stop (handle); -return -ENOMEM ; - } - path[0 ].p_depth = depth; - path[0 ].p_hdr =ext_inode_hdr (inode); - -if (ext4_ext_check (inode, path[0 ].p_hdr, depth)) { - err = -EIO ; - goto out; +if (path) { +int k = i = depth; +while (--k >0 ) + path[k].p_block = +le16_to_cpu (path[k].p_hdr->eh_entries)+1 ; + }else { + path =kzalloc (sizeof (struct ext4_ext_path ) * (depth +1 ), +GFP_NOFS ); +if (path ==NULL ) { +ext4_journal_stop (handle); +return -ENOMEM ; + } + path[0 ].p_depth = depth; + path[0 ].p_hdr =ext_inode_hdr (inode); + +if (ext4_ext_check (inode, path[0 ].p_hdr, depth)) { + err = -EIO ; + goto out; + } } - i = err =0 ; + err =0 ;while (i >=0 && err ==0 ) {if (i == depth) {
@@ -2724,8 +2734,10 @@ cont: out:ext4_ext_drop_refs (path);kfree (path); -if (err == -EAGAIN ) +if (err == -EAGAIN ) { + path =NULL ; goto again; + }ext4_journal_stop (handle);return err;
PATCH 153/153 ext4: fix kernel BUG on large-scale rm -rf commands
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
commit 89a4e48f8479f8145eca9698f39fe188c982212f upstream.
Commit 968dee7722: "ext4: fix hole punch failure when depth is greater than 0" introduced a regression in v3.5.1/v3.6-rc1 which caused kernel crashes when users ran run "rm -rf" on large directory hierarchy on ext4 filesystems on RAID devices:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
Process rm (pid: 18229, threadinfo ffff8801276bc000, task ffff880123631710)
Call Trace:
[<ffffffff81236483>] ? __ext4_handle_dirty_metadata+0x83/0x110
[<ffffffff812353d3>] ext4_ext_truncate+0x193/0x1d0
[<ffffffff8120a8cf>] ? ext4_mark_inode_dirty+0x7f/0x1f0
[<ffffffff81207e05>] ext4_truncate+0xf5/0x100
[<ffffffff8120cd51>] ext4_evict_inode+0x461/0x490
[<ffffffff811a1312>] evict+0xa2/0x1a0
[<ffffffff811a1513>] iput+0x103/0x1f0
[<ffffffff81196d84>] do_unlinkat+0x154/0x1c0
[<ffffffff8118cc3a>] ? sys_newfstatat+0x2a/0x40
[<ffffffff81197b0b>] sys_unlinkat+0x1b/0x50
[<ffffffff816135e9>] system_call_fastpath+0x16/0x1b
Code: 8b 4d 20 0f b7 41 02 48 8d 04 40 48 8d 04 81 49 89 45 18 0f b7 49 02 48 83 c1 01 49 89 4d 00 e9 ae f8 ff ff 0f 1f 00 49 8b 45 28 <48> 8b 40 28 49 89 45 20 e9 85 f8 ff ff 0f 1f 80 00 00 00
RIP [<ffffffff81233164>] ext4_ext_remove_space+0xa34/0xdf0This could be reproduced as follows:
The problem in commit 968dee7722 was that caused the variable 'i' to be left uninitialized if the truncate required more space than was available in the journal. This resulted in the function ext4_ext_truncate_extend_restart() returning -EAGAIN, which caused ext4_ext_remove_space() to restart the truncate operation after starting a new jbd2 handle.
--- fs/ext4/extents.c | 1 + 1 file changed, 1 insertion(+)
fs/ext4/extents.c +1 -0
@@ -2614,6 +2614,7 @@ cont: } path[0 ].p_depth = depth; path[0 ].p_hdr =ext_inode_hdr (inode); + i =0 ;if (ext4_ext_check (inode, path[0 ].p_hdr, depth)) { err = -EIO ;
This is the combined patch for 3.2.40-rc1 relative to 3.2.39.
Ben.
Signature · 3 lines
Ben Hutchings Always try to do things in chronological order; it's less confusing that way.
Documentation/kernel-parameters.txt +5 -0
@@ -552,6 +552,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. UART at the specified I/O port or MMIO address, switching to the matching ttyS device later. The options are the same as for ttyS, above. + hvc<n> Use the hypervisor console device <n>. This is for + both Xen and PowerPC hypervisors. If the device connected to the port is not a TTY but a braille device, prepend "brl," before the device type, for instance
@@ -703,6 +705,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted. earlyprintk= [X86,SH,BLACKFIN] earlyprintk=vga + earlyprintk=xen earlyprintk=serial[,ttySn[,baudrate]] earlyprintk=ttySn[,baudrate] earlyprintk=dbgp[debugController#]
@@ -720,6 +723,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. The VGA output is eventually overwritten by the real console. + The xen output can only be used by Xen PV guests. + ekgdboc= [X86,KGDB] Allow early kernel console debugging ekgdboc=kbd
Makefile +2 -2
@@ -1,7 +1,7 @@ VERSION = 3 PATCHLEVEL = 2 -SUBLEVEL = 39 -EXTRAVERSION = +SUBLEVEL = 40 +EXTRAVERSION = -rc1 NAME = Saber-toothed Squirrel # *DOCUMENTATION*
arch/arm/mach-pxa/include/mach/smemc.h +1 -0
@@ -37,6 +37,7 @@#define CSADRCFG1 (SMEMC_VIRT + 0x84)/* Address Configuration Register for CS1 */ #define CSADRCFG2 (SMEMC_VIRT + 0x88)/* Address Configuration Register for CS2 */ #define CSADRCFG3 (SMEMC_VIRT + 0x8C)/* Address Configuration Register for CS3 */ +#define CSMSADRCFG (SMEMC_VIRT + 0xA0)/* Chip Select Configuration Register */ /* * More handy macros for PCMCIA
arch/arm/mach-pxa/smemc.c +14 -1
@@ -40,6 +40,8 @@ static void pxa3xx_smemc_resume(void)__raw_writel (csadrcfg[1 ],CSADRCFG1 );__raw_writel (csadrcfg[2 ],CSADRCFG2 );__raw_writel (csadrcfg[3 ],CSADRCFG3 ); +/* CSMSADRCFG wakes up in its default state (0), so we need to set it */ +__raw_writel (0x2 ,CSMSADRCFG ); }static struct syscore_ops smemc_syscore_ops = {
@@ -49,8 +51,19 @@ static struct syscore_ops smemc_syscore_ops = {static int __init smemc_init (void ) { -if (cpu_is_pxa3xx ()) +if (cpu_is_pxa3xx ()) { +/* +* The only documentation we have on the +* Chip Select Configuration Register (CSMSADRCFG) is that +* it must be programmed to 0x2. +* Moreover, in the bit definitions, the second bit +* (CSMSADRCFG[1]) is called "SETALWAYS". +* Other bits are reserved in this register. +*/ +__raw_writel (0x2 ,CSMSADRCFG ); +register_syscore_ops (&smemc_syscore_ops); + }return 0 ; }
arch/arm/mach-s3c2410/include/mach/debug-macro.S +6 -6
@@ -40,17 +40,17 @@ addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) bic \rd, \rd, #0xff000 - ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] + ldr \rd, [\rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0)] and \rd, \rd, #0x00ff0000 teq \rd, #0x00440000 @ is it 2440? 1004: - ldr \rd, [ \rx, # S3C2410_UFSTAT ] + ldr \rd, [\rx, # S3C2410_UFSTAT] moveq \rd, \rd, lsr #SHIFT_2440TXF tst \rd, #S3C2410_UFSTAT_TXFULL .endm .macro fifo_full_s3c2410 rd, rx - ldr \rd, [ \rx, # S3C2410_UFSTAT ] + ldr \rd, [\rx, # S3C2410_UFSTAT] tst \rd, #S3C2410_UFSTAT_TXFULL .endm
@@ -68,18 +68,18 @@ addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) bic \rd, \rd, #0xff000 - ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] + ldr \rd, [\rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0)] and \rd, \rd, #0x00ff0000 teq \rd, #0x00440000 @ is it 2440? 10000: - ldr \rd, [ \rx, # S3C2410_UFSTAT ] + ldr \rd, [\rx, # S3C2410_UFSTAT] andne \rd, \rd, #S3C2410_UFSTAT_TXMASK andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK .endm .macro fifo_level_s3c2410 rd, rx - ldr \rd, [ \rx, # S3C2410_UFSTAT ] + ldr \rd, [\rx, # S3C2410_UFSTAT] and \rd, \rd, #S3C2410_UFSTAT_TXMASK .endm
arch/arm/mach-s3c2410/include/mach/entry-macro.S +2 -2
@@ -34,10 +34,10 @@ @@ try the interrupt offset register, since it is there - ldr \irqstat, [ \base, #INTPND ] + ldr \irqstat, [\base, #INTPND ] teq \irqstat, #0 beq 1002f - ldr \irqnr, [ \base, #INTOFFSET ] + ldr \irqnr, [\base, #INTOFFSET ] mov \tmp, #1 tst \irqstat, \tmp, lsl \irqnr bne 1001f
arch/arm/mach-s3c2410/pm-h1940.S +1 -1
@@ -30,4 +30,4 @@ h1940_pm_return: mov r0, #S3C2410_PA_GPIO - ldr pc, [ r0, #S3C2410_GSTATUS3 - S3C24XX_VA_GPIO ] + ldr pc, [r0, #S3C2410_GSTATUS3 - S3C24XX_VA_GPIO]
arch/arm/mach-s3c2410/sleep.S +6 -6
@@ -45,9 +45,9 @@ ENTRY(s3c2410_cpu_suspend) ldr r4, =S3C2410_REFRESH ldr r5, =S3C24XX_MISCCR ldr r6, =S3C2410_CLKCON - ldr r7, [ r4 ] @ get REFRESH (and ensure in TLB) - ldr r8, [ r5 ] @ get MISCCR (and ensure in TLB) - ldr r9, [ r6 ] @ get CLKCON (and ensure in TLB) + ldr r7, [r4] @ get REFRESH (and ensure in TLB) + ldr r8, [r5] @ get MISCCR (and ensure in TLB) + ldr r9, [r6] @ get CLKCON (and ensure in TLB) orr r7, r7, #S3C2410_REFRESH_SELF @ SDRAM sleep command orr r8, r8, #S3C2410_MISCCR_SDSLEEP @ SDRAM power-down signals
@@ -61,8 +61,8 @@ ENTRY(s3c2410_cpu_suspend) @@ align next bit of code to cache line .align 5 s3c2410_do_sleep: - streq r7, [ r4 ] @ SDRAM sleep command - streq r8, [ r5 ] @ SDRAM power-down config - streq r9, [ r6 ] @ CPU sleep + streq r7, [r4] @ SDRAM sleep command + streq r8, [r5] @ SDRAM power-down config + streq r9, [r6] @ CPU sleep 1: beq 1b mov pc, r14
arch/arm/mach-s3c2412/sleep.S +6 -6
@@ -57,12 +57,12 @@ s3c2412_sleep_enter1: * retry, as simply returning causes the system to lock. */ - ldrne r9, [ r1 ] - strne r9, [ r1 ] - ldrne r9, [ r2 ] - strne r9, [ r2 ] - ldrne r9, [ r3 ] - strne r9, [ r3 ] + ldrne r9, [r1] + strne r9, [r1] + ldrne r9, [r2] + strne r9, [r2] + ldrne r9, [r3] + strne r9, [r3] bne s3c2412_sleep_enter1 mov pc, r14
arch/arm/mach-w90x900/include/mach/entry-macro.S +2 -2
@@ -22,8 +22,8 @@ mov \base, #AIC_BA - ldr \irqnr, [ \base, #AIC_IPER] - ldr \irqnr, [ \base, #AIC_ISNR] + ldr \irqnr, [\base, #AIC_IPER] + ldr \irqnr, [\base, #AIC_ISNR] cmp \irqnr, #0 .endm
arch/arm/plat-samsung/include/plat/debug-macro.S +9 -9
@@ -14,12 +14,12 @@ /* The S5PV210/S5PC110 implementations are as belows. */ .macro fifo_level_s5pv210 rd, rx - ldr \rd, [ \rx, # S3C2410_UFSTAT ] + ldr \rd, [\rx, # S3C2410_UFSTAT] and \rd, \rd, #S5PV210_UFSTAT_TXMASK .endm .macro fifo_full_s5pv210 rd, rx - ldr \rd, [ \rx, # S3C2410_UFSTAT ] + ldr \rd, [\rx, # S3C2410_UFSTAT] tst \rd, #S5PV210_UFSTAT_TXFULL .endm
@@ -27,7 +27,7 @@ * most widely re-used */ .macro fifo_level_s3c2440 rd, rx - ldr \rd, [ \rx, # S3C2410_UFSTAT ] + ldr \rd, [\rx, # S3C2410_UFSTAT] and \rd, \rd, #S3C2440_UFSTAT_TXMASK .endm
@@ -36,7 +36,7 @@ #endif .macro fifo_full_s3c2440 rd, rx - ldr \rd, [ \rx, # S3C2410_UFSTAT ] + ldr \rd, [\rx, # S3C2410_UFSTAT] tst \rd, #S3C2440_UFSTAT_TXFULL .endm
@@ -45,11 +45,11 @@ #endif .macro senduart,rd,rx - strb \rd, [\rx, # S3C2410_UTXH ] + strb \rd, [\rx, # S3C2410_UTXH] .endm .macro busyuart, rd, rx - ldr \rd, [ \rx, # S3C2410_UFCON ] + ldr \rd, [\rx, # S3C2410_UFCON] tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? beq 1001f @ @ FIFO enabled...
@@ -60,7 +60,7 @@ 1001: @ busy waiting for non fifo - ldr \rd, [ \rx, # S3C2410_UTRSTAT ] + ldr \rd, [\rx, # S3C2410_UTRSTAT] tst \rd, #S3C2410_UTRSTAT_TXFE beq 1001b
@@ -68,7 +68,7 @@ .endm .macro waituart,rd,rx - ldr \rd, [ \rx, # S3C2410_UFCON ] + ldr \rd, [\rx, # S3C2410_UFCON] tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? beq 1001f @ @ FIFO enabled...
@@ -79,7 +79,7 @@ b 1002f 1001: @ idle waiting for non fifo - ldr \rd, [ \rx, # S3C2410_UTRSTAT ] + ldr \rd, [\rx, # S3C2410_UTRSTAT] tst \rd, #S3C2410_UTRSTAT_TXFE beq 1001b
arch/parisc/include/asm/pgtable.h +10 -3
@@ -12,11 +12,10 @@#include <linux/bitops.h> #include <linux/spinlock.h> +#include <linux/mm_types.h> #include <asm/processor.h> #include <asm/cache.h> -struct vm_area_struct ; -/* * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel * memory. For the return value to be meaningful, ADDR must be >=
@@ -40,7 +39,14 @@ struct vm_area_struct;do { \ *(pteptr) = (pteval); \ } while(0) -#define set_pte_at (mm,addr,ptep,pteval) set_pte(ptep,pteval) + +extern void purge_tlb_entries (struct mm_struct *,unsigned long ); + +#define set_pte_at (mm, addr, ptep, pteval) \ + do { \ + set_pte(ptep, pteval); \ + purge_tlb_entries(mm, addr); \ + } while (0)#endif /* !__ASSEMBLY__ */
@@ -464,6 +470,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, old =pte_val (*ptep); new = pte_val(pte_wrprotect(__pte (old))); }while (cmpxchg ((unsigned long *) ptep, old, new) != old); +purge_tlb_entries (mm, addr);#else pte_t old_pte = *ptep;set_pte_at (mm, addr, ptep,pte_wrprotect (old_pte));
arch/parisc/kernel/cache.c +18 -0
@@ -421,6 +421,24 @@ void kunmap_parisc(void *addr)EXPORT_SYMBOL (kunmap_parisc);#endif +void purge_tlb_entries (struct mm_struct *mm,unsigned long addr) +{ +unsigned long flags; + +/* Note: purge_tlb_entries can be called at startup with +no context. */ + +/* Disable preemption while we play with %sr1. */ +preempt_disable (); +mtsp (mm->context,1 ); +purge_tlb_start (flags); +pdtlb (addr); +pitlb (addr); +purge_tlb_end (flags); +preempt_enable (); +} +EXPORT_SYMBOL (purge_tlb_entries); +void __flush_tlb_range (unsigned long sid,unsigned long start,unsigned long end) {
arch/powerpc/include/asm/eeh.h +3 -0
@@ -61,6 +61,7 @@ void __init pci_addr_cache_build(void);*/ void eeh_add_device_tree_early (struct device_node *);void eeh_add_device_tree_late (struct pci_bus *); +void eeh_add_sysfs_files (struct pci_bus *);/** * eeh_remove_device_recursive - undo EEH for device & children.
@@ -105,6 +106,8 @@ static inline void eeh_add_device_tree_early(struct device_node *dn) { }static inline void eeh_add_device_tree_late (struct pci_bus *bus) { } +static inline void eeh_add_sysfs_files (struct pci_bus *bus) { } +static inline void eeh_remove_bus_device (struct pci_dev *dev) { }#define EEH_POSSIBLE_ERROR (val, type) (0)#define EEH_IO_ERROR_VALUE (size) (-1UL)
arch/powerpc/kernel/machine_kexec_64.c +5 -0
@@ -162,6 +162,8 @@ static int kexec_all_irq_disabled = 0;static void kexec_smp_down (void *arg) {local_irq_disable (); +hard_irq_disable (); +mb ();/* make sure our irqs are disabled before we say they are */ get_paca ()->kexec_state =KEXEC_STATE_IRQS_OFF ;while (kexec_all_irq_disabled ==0 )
@@ -244,6 +246,8 @@ static void kexec_prepare_cpus(void)wake_offline_cpus ();smp_call_function (kexec_smp_down,NULL ,/* wait */ 0 );local_irq_disable (); +hard_irq_disable (); +mb ();/* make sure IRQs are disabled before we say they are */ get_paca ()->kexec_state =KEXEC_STATE_IRQS_OFF ;
@@ -281,6 +285,7 @@ static void kexec_prepare_cpus(void)if (ppc_md.kexec_cpu_down) ppc_md.kexec_cpu_down (0 ,0 );local_irq_disable (); + hard_irq_disable(); }#endif /* SMP */
arch/powerpc/kernel/of_platform.c +3 -0
@@ -91,6 +91,9 @@ static int __devinit of_pci_phb_probe(struct platform_device *dev)/* Add probed PCI devices to the device model */ pci_bus_add_devices (phb->bus); +/* sysfs files should only be added after devices are added */ +eeh_add_sysfs_files (phb->bus); +return 0 ; }
arch/powerpc/kernel/pci-common.c +5 -2
@@ -1536,11 +1536,14 @@ void pcibios_finish_adding_to_bus(struct pci_bus *bus)pcibios_allocate_bus_resources (bus);pcibios_claim_one_bus (bus); +/* Fixup EEH */ +eeh_add_device_tree_late (bus); +/* Add new devices to global lists. Register in proc, sysfs. */ pci_bus_add_devices (bus); -/* Fixup EEH */ -eeh_add_device_tree_late (bus); +/* sysfs files should only be added after devices are added */ +eeh_add_sysfs_files (bus); }EXPORT_SYMBOL_GPL (pcibios_finish_adding_to_bus);
arch/powerpc/platforms/pseries/eeh.c +23 -1
@@ -1238,7 +1238,6 @@ static void eeh_add_device_late(struct pci_dev *dev) pdn->pcidev = dev;pci_addr_cache_insert_device (dev); -eeh_sysfs_add_device (dev); }void eeh_add_device_tree_late (struct pci_bus *bus)
@@ -1257,6 +1256,29 @@ void eeh_add_device_tree_late(struct pci_bus *bus)EXPORT_SYMBOL_GPL (eeh_add_device_tree_late);/** +* eeh_add_sysfs_files - Add EEH sysfs files for the indicated PCI bus +* @bus: PCI bus +* +* This routine must be used to add EEH sysfs files for PCI +* devices which are attached to the indicated PCI bus. The PCI bus +* is added after system boot through hotplug or dlpar. +*/ +void eeh_add_sysfs_files (struct pci_bus *bus) +{ +struct pci_dev *dev; + +list_for_each_entry (dev, &bus->devices, bus_list) { +eeh_sysfs_add_device (dev); +if (dev->hdr_type ==PCI_HEADER_TYPE_BRIDGE ) { +struct pci_bus *subbus = dev->subordinate; +if (subbus) +eeh_add_sysfs_files (subbus); + } + } +} +EXPORT_SYMBOL_GPL (eeh_add_sysfs_files); + +/** * eeh_remove_device - undo EEH setup for the indicated pci device * @dev: pci device to be removed *
arch/s390/kernel/time.c +3 -0
@@ -121,6 +121,9 @@ static int s390_next_ktime(ktime_t expires, nsecs =ktime_to_ns (ktime_add (timespec_to_ktime (ts), expires));do_div (nsecs,125 ); S390_lowcore.clock_comparator = sched_clock_base_cc + (nsecs <<9 ); +/* Program the maximum value if we have an overflow (== year 2042) */ +if (unlikely (S390_lowcore.clock_comparator < sched_clock_base_cc)) + S390_lowcore.clock_comparator =-1ULL ;set_clock_comparator (S390_lowcore.clock_comparator);return 0 ; }
arch/s390/kvm/kvm-s390.c +8 -0
@@ -597,6 +597,14 @@ int kvm_s390_vcpu_store_status(struct kvm_vcpu *vcpu, unsigned long addr) }else prefix =0 ; +/* +* The guest FPRS and ACRS are in the host FPRS/ACRS due to the lazy +* copying in vcpu load/put. Lets update our copies before we save +* it into the save area +*/ +save_fp_regs (&vcpu->arch.guest_fpregs); +save_access_regs (vcpu->arch.guest_acrs); +if (__guestcopy (vcpu, addr + offsetof(struct save_area , fp_regs), vcpu->arch.guest_fpregs.fprs,128 , prefix))return -EFAULT ;
arch/x86/Kconfig +1 -1
@@ -1150,7 +1150,7 @@ config DIRECT_GBPAGES config NUMA bool "Numa Memory Allocation and Scheduler Support" depends on SMP - depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || X86_BIGSMP || X86_SUMMIT && ACPI) && EXPERIMENTAL) + depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || X86_BIGSMP || X86_SUMMIT && ACPI) && BROKEN) default y if (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP) ---help--- Enable NUMA (Non Uniform Memory Access) support.
arch/x86/include/asm/pgtable.h +5 -0
@@ -142,6 +142,11 @@ static inline unsigned long pmd_pfn(pmd_t pmd)return (pmd_val (pmd) &PTE_PFN_MASK ) >>PAGE_SHIFT ; } +static inline unsigned long pud_pfn (pud_t pud) +{ +return (pud_val (pud) &PTE_PFN_MASK ) >>PAGE_SHIFT ; +} +#define pte_page (pte) pfn_to_page(pte_pfn(pte))static inline int pmd_large (pmd_t pte)
arch/x86/kernel/apic/x2apic_phys.c +12 -5
@@ -20,12 +20,19 @@ static int set_x2apic_phys_mode(char *arg) }early_param ("x2apic_phys" , set_x2apic_phys_mode); +static bool x2apic_fadt_phys (void ) +{ +if ((acpi_gbl_FADT.header.revision >=FADT2_REVISION_ID ) && + (acpi_gbl_FADT.flags &ACPI_FADT_APIC_PHYSICAL )) { +printk (KERN_DEBUG "System requires x2apic physical mode\n" ); +return true; + } +return false; +} +static int x2apic_acpi_madt_oem_check (char *oem_id,char *oem_table_id) { -if (x2apic_phys) -return x2apic_enabled (); -else -return 0 ; +return x2apic_enabled () && (x2apic_phys ||x2apic_fadt_phys ()); } static void
@@ -108,7 +115,7 @@ static void init_x2apic_ldr(void)static int x2apic_phys_probe (void ) { -if (x2apic_mode && x2apic_phys) +if (x2apic_mode && (x2apic_phys ||x2apic_fadt_phys ()))return 1 ;return apic == &apic_x2apic_phys;
arch/x86/kernel/cpu/mshyperv.c +2 -1
@@ -68,7 +68,8 @@ static void __init ms_hyperv_init_platform(void)printk (KERN_INFO "HyperV: features 0x%x, hints 0x%x\n" , ms_hyperv.features, ms_hyperv.hints); -clocksource_register_hz (&hyperv_cs,NSEC_PER_SEC /100 ); +if (ms_hyperv.features &HV_X64_MSR_TIME_REF_COUNT_AVAILABLE ) +clocksource_register_hz (&hyperv_cs,NSEC_PER_SEC /100 ); }const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = {
arch/x86/kernel/head.c +34 -19
78 lines not on this page · raw message
arch/x86/mm/fault.c +5 -3
@@ -738,13 +738,15 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, return; }#endif +/* Kernel addresses are always protection faults: */ +if (address >=TASK_SIZE ) + error_code |=PF_PROT ; -if (unlikely (show_unhandled_signals)) +if (likely (show_unhandled_signals))show_signal_msg (regs, error_code, address, tsk); -/* Kernel addresses are always protection faults: */ tsk->thread.cr2 = address; - tsk->thread.error_code = error_code | (address >=TASK_SIZE ); + tsk->thread.error_code = error_code; tsk->thread.trap_no =14 ;force_sig_info_fault (SIGSEGV , si_code, address, tsk,0 );
arch/x86/mm/init_64.c +3 -0
@@ -831,6 +831,9 @@ int kern_addr_valid(unsigned long addr)if (pud_none (*pud))return 0 ; +if (pud_large (*pud)) +return pfn_valid (pud_pfn (*pud)); + pmd =pmd_offset (pud, addr);if (pmd_none (*pmd))return 0 ;
arch/x86/platform/efi/efi.c +31 -28
75 lines not on this page · raw message
arch/x86/xen/spinlock.c +0 -1
@@ -328,7 +328,6 @@ static noinline void xen_spin_unlock_slow(struct xen_spinlock *xl)if (per_cpu (lock_spinners, cpu) == xl) {ADD_STATS (released_slow_kicked,1 );xen_send_IPI_one (cpu,XEN_SPIN_UNLOCK_VECTOR ); -break ; } } }
block/genhd.c +8 -7
@@ -26,7 +26,7 @@ static DEFINE_MUTEX(block_class_lock);struct kobject *block_depr;/* for extended dynamic devt allocation, currently only one major is used */ -#define MAX_EXT_DEVT (1 << MINORBITS) +#define NR_EXT_DEVT (1 << MINORBITS)/* For extended devt allocation. ext_devt_mutex prevents look up * results from going away underneath its user.
@@ -421,17 +421,18 @@ int blk_alloc_devt(struct hd_struct *part, dev_t *devt)do {if (!idr_pre_get (&ext_devt_idr,GFP_KERNEL ))return -ENOMEM ; +mutex_lock (&ext_devt_mutex); rc =idr_get_new (&ext_devt_idr, part, &idx); +if (!rc && idx >=NR_EXT_DEVT ) { +idr_remove (&ext_devt_idr, idx); + rc = -EBUSY ; + } +mutex_unlock (&ext_devt_mutex); }while (rc == -EAGAIN );if (rc)return rc; -if (idx >MAX_EXT_DEVT ) { -idr_remove (&ext_devt_idr, idx); -return -EBUSY ; - } - *devt =MKDEV (BLOCK_EXT_MAJOR ,blk_mangle_minor (idx));return 0 ; }
@@ -645,7 +646,6 @@ void del_gendisk(struct gendisk *disk)disk_part_iter_exit (&piter);invalidate_partition (disk,0 ); -blk_free_devt (disk_to_dev (disk)->devt);set_capacity (disk,0 ); disk->flags &= ~GENHD_FL_UP ;
@@ -663,6 +663,7 @@ void del_gendisk(struct gendisk *disk)if (!sysfs_deprecated)sysfs_remove_link (block_depr,dev_name (disk_to_dev (disk)));device_del (disk_to_dev (disk)); +blk_free_devt (disk_to_dev (disk)->devt); }EXPORT_SYMBOL (del_gendisk);
drivers/acpi/sleep.c +8 -0
@@ -156,6 +156,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { }, { .callback = init_nvs_nosave, + .ident = "Sony Vaio VGN-FW41E_H", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Sony Corporation" ), + DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW41E_H"), + }, + }, + { + .callback = init_nvs_nosave, .ident = "Sony Vaio VGN-FW21E", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
drivers/ata/ata_piix.c +35 -0
@@ -321,6 +321,41 @@ static const struct pci_device_id piix_pci_tbl[] = { { 0x8086, 0x1e08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },/* SATA Controller IDE (Panther Point) */ { 0x8086, 0x1e09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, +/* SATA Controller IDE (Lynx Point) */ + { 0x8086, 0x8c00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, +/* SATA Controller IDE (Lynx Point) */ + { 0x8086, 0x8c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, +/* SATA Controller IDE (Lynx Point) */ + { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, +/* SATA Controller IDE (Lynx Point) */ + { 0x8086, 0x8c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, +/* SATA Controller IDE (Lynx Point-LP) */ + { 0x8086, 0x9c00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, +/* SATA Controller IDE (Lynx Point-LP) */ + { 0x8086, 0x9c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, +/* SATA Controller IDE (Lynx Point-LP) */ + { 0x8086, 0x9c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, +/* SATA Controller IDE (Lynx Point-LP) */ + { 0x8086, 0x9c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, +/* SATA Controller IDE (DH89xxCC) */ + { 0x8086, 0x2326, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, +/* SATA Controller IDE (Avoton) */ + { 0x8086, 0x1f20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, +/* SATA Controller IDE (Avoton) */ + { 0x8086, 0x1f21, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, +/* SATA Controller IDE (Avoton) */ + { 0x8086, 0x1f30, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, +/* SATA Controller IDE (Avoton) */ + { 0x8086, 0x1f31, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, +/* SATA Controller IDE (Wellsburg) */ + { 0x8086, 0x8d00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, +/* SATA Controller IDE (Wellsburg) */ + { 0x8086, 0x8d08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, +/* SATA Controller IDE (Wellsburg) */ + { 0x8086, 0x8d60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, +/* SATA Controller IDE (Wellsburg) */ + { 0x8086, 0x8d68, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, + { } /* terminate list */ };
drivers/base/bus.c +2 -2
@@ -289,7 +289,7 @@ int bus_for_each_dev(struct bus_type *bus, struct device *start,struct device *dev;int error =0 ; -if (!bus) +if (!bus || !bus->p)return -EINVAL ; klist_iter_init_node(&bus->p->klist_devices, &i,
@@ -323,7 +323,7 @@ struct device *bus_find_device(struct bus_type *bus,struct klist_iter i;struct device *dev; -if (!bus) +if (!bus || !bus->p)return NULL ; klist_iter_init_node(&bus->p->klist_devices, &i,
drivers/block/nbd.c +10 -0
@@ -584,12 +584,20 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *lo,struct request sreq;dev_info (disk_to_dev (lo->disk),"NBD_DISCONNECT\n" ); +if (!lo->sock) +return -EINVAL ; +mutex_unlock (&lo->tx_lock); +fsync_bdev (bdev); +mutex_lock (&lo->tx_lock);blk_rq_init (NULL , &sreq); sreq.cmd_type =REQ_TYPE_SPECIAL ;nbd_cmd (&sreq) =NBD_CMD_DISC ; + +/* Check again after getting mutex back. */ if (!lo->sock)return -EINVAL ; +nbd_send_req (lo, &sreq);return 0 ; }
@@ -603,6 +611,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *lo,nbd_clear_que (lo);BUG_ON (!list_empty (&lo->queue_head));BUG_ON (!list_empty (&lo->waiting_queue)); +kill_bdev (bdev);if (file)fput (file);return 0 ;
@@ -683,6 +692,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *lo, lo->file =NULL ;nbd_clear_que (lo);dev_warn (disk_to_dev (lo->disk),"queue cleared\n" ); +kill_bdev (bdev);if (file)fput (file); lo->bytesize =0 ;
drivers/block/sunvdc.c +1 -1
@@ -461,7 +461,7 @@ static int generic_request(struct vdc_port *port, u8 op, void *buf, int len)int op_len, err;void *req_buf; -if (!(((u64 )1 << ((u64 )op -1 )) & port->operations)) +if (!(((u64 )1 << (u64 )op) & port->operations))return -EOPNOTSUPP ;switch (op) {
drivers/block/xen-blkback/xenbus.c +24 -25
82 lines not on this page · raw message
drivers/dca/dca-core.c +5 -0
@@ -420,6 +420,11 @@ void unregister_dca_provider(struct dca_provider *dca, struct device *dev)raw_spin_lock_irqsave (&dca_lock, flags); +if (list_empty (&dca_domains)) { +raw_spin_unlock_irqrestore (&dca_lock, flags); +return ; + } +list_del (&dca->node); pci_rc =dca_pci_rc_from_dev (dev);
drivers/firewire/core-device.c +4 -0
@@ -995,6 +995,10 @@ static void fw_device_init(struct work_struct *work) ret =idr_pre_get (&fw_device_idr,GFP_KERNEL ) ?idr_get_new (&fw_device_idr, device, &minor) : -ENOMEM ; +if (minor >=1 <<MINORBITS ) { +idr_remove (&fw_device_idr, minor); + minor = -ENOSPC ; + }up_write (&fw_device_rwsem);if (ret <0 )
drivers/gpu/drm/drm_edid.c +2 -4
@@ -87,9 +87,6 @@ static struct edid_quirk {int product_id;u32 quirks; } edid_quirk_list[] = { -/* ASUS VW222S */ - { "ACI", 0x22a2, EDID_QUIRK_FORCE_REDUCED_BLANKING }, -/* Acer AL1706 */ { "ACR", 44358, EDID_QUIRK_PREFER_LARGE_60 },/* Acer F51 */
@@ -1743,7 +1740,8 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) num_modes +=add_cvt_modes (connector, edid); num_modes +=add_standard_modes (connector, edid); num_modes +=add_established_modes (connector, edid); - num_modes +=add_inferred_modes (connector, edid); +if (edid->features &DRM_EDID_FEATURE_DEFAULT_GTF ) + num_modes +=add_inferred_modes (connector, edid);if (quirks & (EDID_QUIRK_PREFER_LARGE_60 |EDID_QUIRK_PREFER_LARGE_75 ))edid_fixup_preferred (connector, quirks);
drivers/gpu/drm/drm_usb.c +1 -1
@@ -19,7 +19,7 @@ int drm_get_usb_dev(struct usb_interface *interface, usbdev =interface_to_usbdev (interface); dev->usbdev = usbdev; - dev->dev = &usbdev->dev; + dev->dev = &interface->dev;mutex_lock (&drm_global_mutex);
drivers/gpu/drm/i915/i915_debugfs.c +1 -1
@@ -756,7 +756,7 @@ static int i915_error_state(struct seq_file *m, void *unused)seq_printf (m,"Time: %ld s %ld us\n" , error->time.tv_sec, error->time.tv_usec); -seq_printf (m,"Kernel: " UTS_RELEASE ); +seq_printf (m,"Kernel: " UTS_RELEASE "\n" );seq_printf (m,"PCI ID: 0x%04x\n" , dev->pci_device);seq_printf (m,"EIR: 0x%08x\n" , error->eir);seq_printf (m,"PGTBL_ER: 0x%08x\n" , error->pgtbl_er);
drivers/gpu/drm/i915/intel_display.c +10 -2
@@ -138,8 +138,8 @@ static const intel_limit_t intel_limits_i9xx_sdvo = { .vco = { .min = 1400000, .max = 2800000 }, .n = { .min = 1, .max = 6 }, .m = { .min = 70, .max = 120 }, - .m1 = { .min = 10, .max = 22 }, - .m2 = { .min = 5, .max = 9 }, + .m1 = { .min = 8, .max = 18 }, + .m2 = { .min = 3, .max = 7 }, .p = { .min = 5, .max = 80 }, .p1 = { .min = 1, .max = 8 }, .p2 = { .dot_limit = 200000,
@@ -3242,6 +3242,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)struct intel_crtc *intel_crtc =to_intel_crtc (crtc);int pipe = intel_crtc->pipe;int plane = intel_crtc->plane; +u32 pctl;if (!intel_crtc->active)return ;
@@ -3257,6 +3258,13 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)intel_disable_plane (dev_priv, plane, pipe);intel_disable_pipe (dev_priv, pipe); + +/* Disable pannel fitter if it is on this pipe. */ + pctl =I915_READ (PFIT_CONTROL ); +if ((pctl &PFIT_ENABLE ) && + ((pctl &PFIT_PIPE_MASK ) >>PFIT_PIPE_SHIFT ) == pipe) +I915_WRITE (PFIT_CONTROL ,0 ); +intel_disable_pll (dev_priv, pipe); intel_crtc->active = false;
drivers/gpu/drm/radeon/evergreen.c +2 -0
@@ -1137,6 +1137,8 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav blackout &= ~BLACKOUT_MODE_MASK ;WREG32 (MC_SHARED_BLACKOUT_CNTL , blackout |1 ); } +/* wait for the MC to settle */ +udelay (100 ); }void evergreen_mc_resume (struct radeon_device *rdev,struct evergreen_mc_save *save)
drivers/hid/hid-core.c +1 -0
@@ -1900,6 +1900,7 @@ static const struct hid_device_id hid_ignore_list[] = { { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HYBRID) }, { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HEATCONTROL) }, { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_BEATPAD) }, + { HID_USB_DEVICE(USB_VENDOR_ID_MASTERKIT, USB_DEVICE_ID_MASTERKIT_MA901RADIO) }, { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS) }, { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS) }, { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT1) },
drivers/hid/hid-ids.h +3 -0
@@ -506,6 +506,9 @@#define USB_VENDOR_ID_MADCATZ 0x0738#define USB_DEVICE_ID_MADCATZ_BEATPAD 0x4540 +#define USB_VENDOR_ID_MASTERKIT 0x16c0 +#define USB_DEVICE_ID_MASTERKIT_MA901RADIO 0x05df +#define USB_VENDOR_ID_MCC 0x09db#define USB_DEVICE_ID_MCC_PMD1024LS 0x0076#define USB_DEVICE_ID_MCC_PMD1208LS 0x007a
drivers/iommu/intel-iommu.c +7 -1
@@ -4140,13 +4140,19 @@ static void __devinit quirk_iommu_rwbf(struct pci_dev *dev) {/* * Mobile 4 Series Chipset neglects to set RWBF capability, -* but needs it: +* but needs it. Same seems to hold for the desktop versions. */ printk (KERN_INFO "DMAR: Forcing write-buffer flush capability\n" ); rwbf_quirk =1 ; }DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2a40 , quirk_iommu_rwbf); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2e00 , quirk_iommu_rwbf); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2e10 , quirk_iommu_rwbf); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2e20 , quirk_iommu_rwbf); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2e30 , quirk_iommu_rwbf); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2e40 , quirk_iommu_rwbf); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2e90 , quirk_iommu_rwbf);#define GGC 0x52#define GGC_MEMORY_SIZE_MASK (0xf << 8)
drivers/media/rc/rc-main.c +4 -1
@@ -774,9 +774,12 @@ static ssize_t show_protocols(struct device *device,if (dev->driver_type ==RC_DRIVER_SCANCODE ) { enabled = dev->rc_map.rc_type; allowed = dev->allowed_protos; - }else { + }else if (dev->raw) { enabled = dev->raw->enabled_protocols; allowed =ir_raw_get_allowed_protocols (); + }else { +mutex_unlock (&dev->lock); +return -ENODEV ; } IR_dprintk(1, "allowed - 0x%llx, enabled - 0x%llx\n",
drivers/media/video/omap/omap_vout.c +7 -5
@@ -206,19 +206,21 @@ static u32 omap_vout_uservirt_to_phys(u32 virtp)struct vm_area_struct *vma;struct mm_struct *mm = current->mm; - vma =find_vma (mm, virtp);/* For kernel direct-mapped memory, take the easy way */ -if (virtp >=PAGE_OFFSET ) { - physp =virt_to_phys ((void *) virtp); - }else if (vma && (vma->vm_flags &VM_IO ) && vma->vm_pgoff) { +if (virtp >=PAGE_OFFSET ) +return virt_to_phys ((void *) virtp); + +down_read (¤t->mm->mmap_sem); + vma =find_vma (mm, virtp); +if (vma && (vma->vm_flags &VM_IO ) && vma->vm_pgoff) {/* this will catch, kernel-allocated, mmaped-to-usermode addresses */ physp = (vma->vm_pgoff <<PAGE_SHIFT ) + (virtp - vma->vm_start); +up_read (¤t->mm->mmap_sem); }else {/* otherwise, use get_user_pages() for general userland pages */ int res, nr_pages =1 ;struct page *pages; -down_read (¤t->mm->mmap_sem); res =get_user_pages (current, current->mm, virtp, nr_pages,1 ,0 , &pages,NULL );
drivers/media/video/v4l2-device.c +14 -16
@@ -159,31 +159,21 @@ int v4l2_device_register_subdev(struct v4l2_device *v4l2_dev, sd->v4l2_dev = v4l2_dev;if (sd->internal_ops && sd->internal_ops->registered) { err = sd->internal_ops->registered (sd); -if (err) { -module_put (sd->owner); -return err; - } +if (err) + goto error_module; }/* This just returns 0 if either of the two args is NULL */ err =v4l2_ctrl_add_handler (v4l2_dev->ctrl_handler, sd->ctrl_handler); -if (err) { -if (sd->internal_ops && sd->internal_ops->unregistered) - sd->internal_ops->unregistered (sd); -module_put (sd->owner); -return err; - } +if (err) + goto error_unregister;#if defined(CONFIG_MEDIA_CONTROLLER )/* Register the entity. */ if (v4l2_dev->mdev) { err =media_device_register_entity (v4l2_dev->mdev, entity); -if (err <0 ) { -if (sd->internal_ops && sd->internal_ops->unregistered) - sd->internal_ops->unregistered (sd); -module_put (sd->owner); -return err; - } +if (err <0 ) + goto error_unregister; }#endif
@@ -192,6 +182,14 @@ int v4l2_device_register_subdev(struct v4l2_device *v4l2_dev,spin_unlock (&v4l2_dev->lock);return 0 ; + +error_unregister: +if (sd->internal_ops && sd->internal_ops->unregistered) + sd->internal_ops->unregistered (sd); +error_module: +module_put (sd->owner); + sd->v4l2_dev =NULL ; +return err; }EXPORT_SYMBOL_GPL (v4l2_device_register_subdev);
drivers/mmc/host/sdhci-esdhc-imx.c +11 -8
@@ -232,15 +232,18 @@ static void esdhc_writel_le(struct sdhci_host *host, u32 val, int reg)static u16 esdhc_readw_le (struct sdhci_host *host,int reg) { +struct sdhci_pltfm_host *pltfm_host =sdhci_priv (host); +struct pltfm_imx_data *imx_data = pltfm_host->priv; +if (unlikely (reg ==SDHCI_HOST_VERSION )) { -u16 val =readw (host->ioaddr + (reg ^2 )); -/* -* uSDHC supports SDHCI v3.0, but it's encoded as value -* 0x3 in host controller version register, which violates -* SDHCI_SPEC_300 definition. Work it around here. -*/ -if ((val &SDHCI_SPEC_VER_MASK ) ==3 ) -return --val; + reg ^=2 ; +if (is_imx6q_usdhc (imx_data)) { +/* +* The usdhc register returns a wrong host version. +* Correct it here. +*/ +return SDHCI_SPEC_300 ; + } }return readw (host->ioaddr + reg);
drivers/net/ethernet/intel/igb/igb_main.c +5 -3
@@ -4559,11 +4559,13 @@ void igb_update_stats(struct igb_adapter *adapter, bytes =0 ; packets =0 ;for (i =0 ; i < adapter->num_rx_queues; i++) { -u32 rqdpc_tmp =rd32 (E1000_RQDPC (i)) &0x0FFF ; +u32 rqdpc =rd32 (E1000_RQDPC (i));struct igb_ring *ring = adapter->rx_ring[i]; - ring->rx_stats.drops += rqdpc_tmp; - net_stats->rx_fifo_errors += rqdpc_tmp; +if (rqdpc) { + ring->rx_stats.drops += rqdpc; + net_stats->rx_fifo_errors += rqdpc; + } do { start = u64_stats_fetch_begin_bh(&ring->rx_syncp);
drivers/net/wireless/b43/dma.h +1 -1
@@ -169,7 +169,7 @@ struct b43_dmadesc_generic {/* DMA engine tuning knobs */ #define B43_TXRING_SLOTS 256 -#define B43_RXRING_SLOTS 64 +#define B43_RXRING_SLOTS 256#define B43_DMA0_RX_FW598_BUFSIZE (B43_DMA0_RX_FW598_FO + IEEE80211_MAX_FRAME_LEN)#define B43_DMA0_RX_FW351_BUFSIZE (B43_DMA0_RX_FW351_FO + IEEE80211_MAX_FRAME_LEN)
drivers/net/wireless/p54/p54usb.c +1 -1
@@ -84,8 +84,8 @@ static struct usb_device_id p54u_table[] = { {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ {USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */ - {USB_DEVICE(0x083a, 0x4503)}, /* T-Com Sinus 154 data II */ {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ + {USB_DEVICE(0x083a, 0x4531)}, /* T-Com Sinus 154 data II */ {USB_DEVICE(0x083a, 0xc501)}, /* Zoom Wireless-G 4410 */ {USB_DEVICE(0x083a, 0xf503)}, /* Accton FD7050E ver 1010ec */ {USB_DEVICE(0x0846, 0x4240)}, /* Netgear WG111 (v2) */
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +8 -1
@@ -295,6 +295,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = { {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817f, rtl92cu_hal_cfg)},/* RTL8188CUS-VL */ {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x818a, rtl92cu_hal_cfg)}, + {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x819a, rtl92cu_hal_cfg)},/* 8188 Combo for BC4 */ {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8754, rtl92cu_hal_cfg)},
@@ -372,9 +373,15 @@ static struct usb_device_id rtl8192c_usb_ids[] = {MODULE_DEVICE_TABLE (usb, rtl8192c_usb_ids); +static int rtl8192cu_probe (struct usb_interface *intf, +const struct usb_device_id *id) +{ +return rtl_usb_probe (intf, id, &rtl92cu_hal_cfg); +} +static struct usb_driver rtl8192cu_driver = { .name ="rtl8192cu" , - .probe = rtl_usb_probe, + .probe = rtl8192cu_probe, .disconnect = rtl_usb_disconnect, .id_table = rtl8192c_usb_ids,
drivers/net/wireless/rtlwifi/usb.c +31 -18
91 lines not on this page · raw message
drivers/net/wireless/rtlwifi/usb.h +2 -1
@@ -158,7 +158,8 @@ struct rtl_usb_priv {int __devinit rtl_usb_probe (struct usb_interface *intf, -const struct usb_device_id *id); +const struct usb_device_id *id, +struct rtl_hal_cfg *rtl92cu_hal_cfg);void rtl_usb_disconnect (struct usb_interface *intf);int rtl_usb_suspend (struct usb_interface *pusb_intf,pm_message_t message);int rtl_usb_resume (struct usb_interface *pusb_intf);
drivers/net/xen-netback/interface.c +1 -2
@@ -132,6 +132,7 @@ static void xenvif_up(struct xenvif *vif)static void xenvif_down (struct xenvif *vif) {disable_irq (vif->irq); +del_timer_sync (&vif->credit_timeout);xen_netbk_deschedule_xenvif (vif);xen_netbk_remove_xenvif (vif); }
@@ -362,8 +363,6 @@ void xenvif_disconnect(struct xenvif *vif)atomic_dec (&vif->refcnt);wait_event (vif->waiting_to_free,atomic_read (&vif->refcnt) ==0 ); -del_timer_sync (&vif->credit_timeout); -if (vif->irq)unbind_from_irqhandler (vif->irq, vif);
drivers/net/xen-netback/netback.c +4 -4
@@ -883,13 +883,13 @@ static int netbk_count_requests(struct xenvif *vif,if (frags >= work_to_do) {netdev_err (vif->dev,"Need more frags\n" );netbk_fatal_tx_err (vif); -return -frags; +return -ENODATA ; }if (unlikely (frags >=MAX_SKB_FRAGS )) {netdev_err (vif->dev,"Too many frags\n" );netbk_fatal_tx_err (vif); -return -frags; +return -E2BIG ; } memcpy(txp, RING_GET_REQUEST(&vif->tx, cons + frags),
@@ -897,7 +897,7 @@ static int netbk_count_requests(struct xenvif *vif,if (txp->size > first->size) {netdev_err (vif->dev,"Frag is bigger than frame.\n" );netbk_fatal_tx_err (vif); -return -frags; +return -EIO ; } first->size -= txp->size;
@@ -907,7 +907,7 @@ static int netbk_count_requests(struct xenvif *vif,netdev_err (vif->dev,"txp->offset: %x, size: %u\n" , txp->offset, txp->size);netbk_fatal_tx_err (vif); -return -frags; +return -EINVAL ; } }while ((txp++)->flags & XEN_NETTXF_more_data);return frags;
drivers/pci/remove.c +2 -0
@@ -19,6 +19,8 @@ static void pci_free_resources(struct pci_dev *dev)static void pci_stop_dev (struct pci_dev *dev) { +pci_pme_active (dev, false); +if (dev->is_added) {pci_proc_detach_device (dev);pci_remove_sysfs_dev_files (dev);
drivers/pcmcia/vrc4171_card.c +1 -0
@@ -246,6 +246,7 @@ static int pccard_init(struct pcmcia_socket *sock) socket = &vrc4171_sockets[slot]; socket->csc_irq =search_nonuse_irq (); socket->io_irq =search_nonuse_irq (); +spin_lock_init (&socket->lock);return 0 ; }
drivers/platform/x86/asus-laptop.c +4 -13
@@ -820,8 +820,10 @@ static ssize_t show_infos(struct device *dev,/* * The HWRS method return informations about the hardware. * 0x80 bit is for WLAN, 0x100 for Bluetooth. +* 0x40 for WWAN, 0x10 for WIMAX. * The significance of others is yet to be found. -* If we don't find the method, we assume the device are present. +* We don't currently use this for device detection, and it +* takes several seconds to run on some systems. */ rv =acpi_evaluate_integer (asus->handle,"HWRS" ,NULL , &temp);if (!ACPI_FAILURE (rv))
@@ -1591,7 +1593,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus) {struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL };union acpi_object *model =NULL ; -unsigned long long bsts_result, hwrs_result; +unsigned long long bsts_result;char *string =NULL ;acpi_status status;
@@ -1653,17 +1655,6 @@ static int asus_laptop_get_info(struct asus_laptop *asus)if (*string)pr_notice (" %s model detected\n" , string); -/* -* The HWRS method return informations about the hardware. -* 0x80 bit is for WLAN, 0x100 for Bluetooth, -* 0x40 for WWAN, 0x10 for WIMAX. -* The significance of others is yet to be found. -*/ - status = -acpi_evaluate_integer (asus->handle,"HWRS" ,NULL , &hwrs_result); -if (!ACPI_FAILURE (status)) -pr_notice (" HWRS returned %x" , (int )hwrs_result); -if (!acpi_check_handle (asus->handle,METHOD_WL_STATUS ,NULL )) asus->have_rsts = true;
drivers/pps/clients/pps-ldisc.c +4 -6
@@ -31,7 +31,7 @@static void pps_tty_dcd_change (struct tty_struct *tty,unsigned int status,struct pps_event_time *ts) { -struct pps_device *pps = (struct pps_device *)tty->disc_data; +struct pps_device *pps =pps_lookup_dev (tty);BUG_ON (pps ==NULL );
@@ -67,9 +67,9 @@ static int pps_tty_open(struct tty_struct *tty)pr_err ("cannot register PPS source \"%s\"\n" , info.path);return -ENOMEM ; } - tty->disc_data = pps; + pps->lookup_cookie = tty; -/* Should open N_TTY ldisc too */ +/* Now open the base class N_TTY ldisc */ ret =alias_n_tty_open (tty);if (ret <0 ) {pr_err ("cannot open tty ldisc \"%s\"\n" , info.path);
@@ -81,7 +81,6 @@ static int pps_tty_open(struct tty_struct *tty)return 0 ; err_unregister: - tty->disc_data =NULL ;pps_unregister_source (pps);return ret; }
@@ -90,11 +89,10 @@ static void (*alias_n_tty_close)(struct tty_struct *tty);static void pps_tty_close (struct tty_struct *tty) { -struct pps_device *pps = (struct pps_device *)tty->disc_data; +struct pps_device *pps =pps_lookup_dev (tty);alias_n_tty_close (tty); - tty->disc_data =NULL ;dev_info (pps->dev,"removed\n" );pps_unregister_source (pps); }
drivers/pps/pps.c +43 -4
80 lines not on this page · raw message
drivers/rtc/rtc-pl031.c +3 -1
@@ -344,7 +344,9 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)/* Enable the clockwatch on ST Variants */ if (ldata->hw_designer ==AMBA_VENDOR_ST ) data |=RTC_CR_CWEN ; -writel (data |RTC_CR_EN , ldata->base +RTC_CR ); +else + data |=RTC_CR_EN ; +writel (data, ldata->base +RTC_CR );/* * On ST PL031 variants, the RTC reset value does not provide correct
drivers/s390/kvm/kvm_virtio.c +30 -8
@@ -414,6 +414,26 @@ static void kvm_extint_handler(unsigned int ext_int_code, }/* +* For s390-virtio, we expect a page above main storage containing +* the virtio configuration. Try to actually load from this area +* in order to figure out if the host provides this page. +*/ +static int __init test_devices_support (unsigned long addr) +{ +int ret = -EIO ; + + asmvolatile ( +"0: lura 0,%1\n" +"1: xgr %0,%0\n" +"2:\n" + EX_TABLE(0b,2b) +EX_TABLE (1b ,2b ) + : "+d" (ret) + : "a" (addr) + : "0", "cc"); + return ret; +} +/* * Init function for virtio * devices are in a single page above top of "normal" mem */
@@ -424,21 +444,23 @@ static int __init kvm_devices_init(void)if (!MACHINE_IS_KVM )return -ENODEV ; +if (test_devices_support (real_memory_size) <0 ) +return -ENODEV ; + + rc =vmem_add_mapping (real_memory_size,PAGE_SIZE ); +if (rc) +return rc; + + kvm_devices = (void *) real_memory_size; + kvm_root =root_device_register ("kvm_s390" );if (IS_ERR (kvm_root)) { rc =PTR_ERR (kvm_root);printk (KERN_ERR "Could not register kvm_s390 root device" ); +vmem_remove_mapping (real_memory_size,PAGE_SIZE );return rc; } - rc =vmem_add_mapping (real_memory_size,PAGE_SIZE ); -if (rc) { -root_device_unregister (kvm_root); -return rc; - } - - kvm_devices = (void *) real_memory_size; -INIT_WORK (&hotplug_work, hotplug_devices);service_subclass_irq_register ();
drivers/staging/comedi/comedi_fops.c +9 -4
@@ -136,6 +136,11 @@ static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd,/* Device config is special, because it must work on * an unconfigured device. */ if (cmd ==COMEDI_DEVCONFIG ) { +if (minor >=COMEDI_NUM_BOARD_MINORS ) { +/* Device config not appropriate on non-board minors. */ + rc = -ENOTTY ; + goto done; + } rc =do_devconfig_ioctl (dev, (struct comedi_devconfig __user *)arg); goto done;
@@ -1569,7 +1574,7 @@ static unsigned int comedi_poll(struct file *file, poll_table * wait) mask =0 ; read_subdev =comedi_get_read_subdevice (dev_file_info); -if (read_subdev) { +if (read_subdev && read_subdev->async) {poll_wait (file, &read_subdev->async->wait_head, wait);if (!read_subdev->busy || comedi_buf_read_n_available(read_subdev->async) > 0
@@ -1579,7 +1584,7 @@ static unsigned int comedi_poll(struct file *file, poll_table * wait) } } write_subdev =comedi_get_write_subdevice (dev_file_info); -if (write_subdev) { +if (write_subdev && write_subdev->async) {poll_wait (file, &write_subdev->async->wait_head, wait);comedi_buf_write_alloc (write_subdev->async, write_subdev->async->prealloc_bufsz);
@@ -1621,7 +1626,7 @@ static ssize_t comedi_write(struct file *file, const char __user *buf, } s =comedi_get_write_subdevice (dev_file_info); -if (s ==NULL ) { +if (s ==NULL || s->async ==NULL ) { retval = -EIO ; goto done; }
@@ -1732,7 +1737,7 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes, } s =comedi_get_read_subdevice (dev_file_info); -if (s ==NULL ) { +if (s ==NULL || s->async ==NULL ) { retval = -EIO ; goto done; }
drivers/staging/comedi/drivers/ni_labpc.c +19 -16
@@ -1264,7 +1264,9 @@ static int labpc_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)else channel =CR_CHAN (cmd->chanlist[0 ]);/* munge channel bits for differential / scan disabled mode */ -if (labpc_ai_scan_mode (cmd) !=MODE_SINGLE_CHAN && aref ==AREF_DIFF ) +if ((labpc_ai_scan_mode (cmd) ==MODE_SINGLE_CHAN || +labpc_ai_scan_mode (cmd) ==MODE_SINGLE_CHAN_INTERVAL ) && + aref ==AREF_DIFF ) channel *=2 ; devpriv->command1_bits |=ADC_CHAN_BITS (channel); devpriv->command1_bits |= thisboard->ai_range_code[range];
@@ -1280,21 +1282,6 @@ static int labpc_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) devpriv->write_byte (devpriv->command1_bits, dev->iobase +COMMAND1_REG ); } -/* setup any external triggering/pacing (command4 register) */ - devpriv->command4_bits =0 ; -if (cmd->convert_src !=TRIG_EXT ) - devpriv->command4_bits |=EXT_CONVERT_DISABLE_BIT ; -/* XXX should discard first scan when using interval scanning -* since manual says it is not synced with scan clock */ -if (labpc_use_continuous_mode (cmd) ==0 ) { - devpriv->command4_bits |=INTERVAL_SCAN_EN_BIT ; -if (cmd->scan_begin_src ==TRIG_EXT ) - devpriv->command4_bits |=EXT_SCAN_EN_BIT ; - } -/* single-ended/differential */ -if (aref ==AREF_DIFF ) - devpriv->command4_bits |=ADC_DIFF_BIT ; - devpriv->write_byte (devpriv->command4_bits, dev->iobase +COMMAND4_REG ); devpriv->write_byte (cmd->chanlist_len, dev->iobase +INTERVAL_COUNT_REG );
@@ -1374,6 +1361,22 @@ static int labpc_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) devpriv->command3_bits &= ~ADC_FNE_INTR_EN_BIT ; devpriv->write_byte (devpriv->command3_bits, dev->iobase +COMMAND3_REG ); +/* setup any external triggering/pacing (command4 register) */ + devpriv->command4_bits =0 ; +if (cmd->convert_src !=TRIG_EXT ) + devpriv->command4_bits |=EXT_CONVERT_DISABLE_BIT ; +/* XXX should discard first scan when using interval scanning +* since manual says it is not synced with scan clock */ +if (labpc_use_continuous_mode (cmd) ==0 ) { + devpriv->command4_bits |=INTERVAL_SCAN_EN_BIT ; +if (cmd->scan_begin_src ==TRIG_EXT ) + devpriv->command4_bits |=EXT_SCAN_EN_BIT ; + } +/* single-ended/differential */ +if (aref ==AREF_DIFF ) + devpriv->command4_bits |=ADC_DIFF_BIT ; + devpriv->write_byte (devpriv->command4_bits, dev->iobase +COMMAND4_REG ); +/* startup acquisition */ /* command2 reg */
drivers/staging/speakup/speakup_soft.c +1 -1
@@ -46,7 +46,7 @@ static int misc_registered;static struct var_t vars[] = { {CAPS_START , .u.s = {"\x01+3p" } }, {CAPS_STOP , .u.s = {"\x01-3p" } }, - {RATE , .u.n = {"\x01%ds" ,5 ,0 ,9 ,0 ,0 ,NULL } }, + {RATE , .u.n = {"\x01%ds" ,2 ,0 ,9 ,0 ,0 ,NULL } }, {PITCH , .u.n = {"\x01%dp" ,5 ,0 ,9 ,0 ,0 ,NULL } }, {VOL , .u.n = {"\x01%dv" ,5 ,0 ,9 ,0 ,0 ,NULL } }, {TONE , .u.n = {"\x01%dx" ,1 ,0 ,2 ,0 ,0 ,NULL } },
drivers/staging/zram/zram_drv.c +2 -2
@@ -242,7 +242,7 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,if (is_partial_io (bvec)) {/* Use a temporary buffer to decompress the page */ - uncmem =kmalloc (PAGE_SIZE ,GFP_KERNEL ); + uncmem =kmalloc (PAGE_SIZE ,GFP_NOIO );if (!uncmem) {pr_info ("Error allocating temp memory!\n" );return -ENOMEM ;
@@ -338,7 +338,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,* This is a partial IO. We need to read the full page * before to write the changes. */ - uncmem =kmalloc (PAGE_SIZE ,GFP_KERNEL ); + uncmem =kmalloc (PAGE_SIZE ,GFP_NOIO );if (!uncmem) {pr_info ("Error allocating temp memory!\n" ); ret = -ENOMEM ;
drivers/target/target_core_device.c +4 -9
@@ -1439,24 +1439,18 @@ static struct se_lun *core_dev_get_lun(struct se_portal_group *tpg, u32 unpackedstruct se_lun_acl *core_dev_init_initiator_node_lun_acl (struct se_portal_group *tpg, +struct se_node_acl *nacl,u32 mapped_lun, -char *initiatorname,int *ret) {struct se_lun_acl *lacl; -struct se_node_acl *nacl; -if (strlen (initiatorname) >=TRANSPORT_IQN_LEN ) { +if (strlen (nacl->initiatorname) >=TRANSPORT_IQN_LEN ) {pr_err ("%s InitiatorName exceeds maximum size.\n" , tpg->se_tpg_tfo->get_fabric_name ()); *ret = -EOVERFLOW ;return NULL ; } - nacl =core_tpg_get_initiator_node_acl (tpg, initiatorname); -if (!nacl) { - *ret = -EINVAL ; -return NULL ; - } lacl =kzalloc (sizeof (struct se_lun_acl ),GFP_KERNEL );if (!lacl) {pr_err ("Unable to allocate memory for struct se_lun_acl.\n" );
@@ -1467,7 +1461,8 @@ struct se_lun_acl *core_dev_init_initiator_node_lun_acl(INIT_LIST_HEAD (&lacl->lacl_list); lacl->mapped_lun = mapped_lun; lacl->se_lun_nacl = nacl; -snprintf (lacl->initiatorname,TRANSPORT_IQN_LEN ,"%s" , initiatorname); +snprintf (lacl->initiatorname,TRANSPORT_IQN_LEN ,"%s" , + nacl->initiatorname);return lacl; }
drivers/target/target_core_fabric_configfs.c +10 -2
@@ -354,9 +354,17 @@ static struct config_group *target_fabric_make_mappedlun( ret = -EINVAL ; goto out; } +if (mapped_lun > (TRANSPORT_MAX_LUNS_PER_TPG -1 )) { +pr_err ("Mapped LUN: %lu exceeds TRANSPORT_MAX_LUNS_PER_TPG" +"-1: %u for Target Portal Group: %u\n" , mapped_lun, +TRANSPORT_MAX_LUNS_PER_TPG -1 , + se_tpg->se_tpg_tfo->tpg_get_tag (se_tpg)); + ret = -EINVAL ; + goto out; + } - lacl =core_dev_init_initiator_node_lun_acl (se_tpg, mapped_lun, -config_item_name (acl_ci), &ret); + lacl =core_dev_init_initiator_node_lun_acl (se_tpg, se_nacl, + mapped_lun, &ret);if (!lacl) { ret = -EINVAL ; goto out;
drivers/target/target_core_tpg.c +2 -8
@@ -117,16 +117,10 @@ struct se_node_acl *core_tpg_get_initiator_node_acl(struct se_node_acl *acl;spin_lock_irq (&tpg->acl_node_lock); -list_for_each_entry (acl, &tpg->acl_node_list, acl_list) { -if (!strcmp (acl->initiatorname, initiatorname) && - !acl->dynamic_node_acl) { -spin_unlock_irq (&tpg->acl_node_lock); -return acl; - } - } + acl =__core_tpg_get_initiator_node_acl (tpg, initiatorname);spin_unlock_irq (&tpg->acl_node_lock); -return NULL ; +return acl; }/* core_tpg_add_node_to_devs():
drivers/tty/serial/8250.c +2 -2
@@ -2695,7 +2695,7 @@ serial8250_verify_port(struct uart_port *port, struct serial_struct *ser)if (ser->irq >= nr_irqs || ser->irq <0 || ser->baud_base <9600 || ser->type <PORT_UNKNOWN || ser->type >=ARRAY_SIZE (uart_config) || ser->type ==PORT_CIRRUS || - ser->type ==PORT_STARTECH ) + ser->type ==PORT_STARTECH || uart_config[ser->type].name ==NULL )return -EINVAL ;return 0 ; }
@@ -2705,7 +2705,7 @@ serial8250_type(struct uart_port *port) {int type = port->type; -if (type >=ARRAY_SIZE (uart_config)) +if (type >=ARRAY_SIZE (uart_config) || uart_config[type].name ==NULL ) type =0 ;return uart_config[type].name; }
drivers/tty/tty_ioctl.c +2 -2
@@ -618,7 +618,7 @@ static int set_termios(struct tty_struct *tty, void __user *arg, int opt)if (opt &TERMIOS_WAIT ) {tty_wait_until_sent (tty,0 );if (signal_pending (current)) -return -EINTR ; +return -ERESTARTSYS ; }tty_set_termios (tty, &tmp_termios);
@@ -685,7 +685,7 @@ static int set_termiox(struct tty_struct *tty, void __user *arg, int opt)if (opt &TERMIOS_WAIT ) {tty_wait_until_sent (tty,0 );if (signal_pending (current)) -return -EINTR ; +return -ERESTARTSYS ; }mutex_lock (&tty->termios_mutex);
drivers/tty/vt/vt.c +98 -38
257 lines not on this page · raw message
drivers/usb/core/driver.c +23 -15
@@ -541,22 +541,10 @@ int usb_match_device(struct usb_device *dev, const struct usb_device_id *id) }/* returns 0 if no match, 1 if match */ -int usb_match_one_id (struct usb_interface *interface, -const struct usb_device_id *id) +int usb_match_one_id_intf (struct usb_device *dev, +struct usb_host_interface *intf, +const struct usb_device_id *id) { -struct usb_host_interface *intf; -struct usb_device *dev; - -/* proc_connectinfo in devio.c may call us with id == NULL. */ -if (id ==NULL ) -return 0 ; - - intf = interface->cur_altsetting; - dev =interface_to_usbdev (interface); - -if (!usb_match_device (dev, id)) -return 0 ; -/* The interface class, subclass, and protocol should never be * checked for a match if the device class is Vendor Specific, * unless the match record specifies the Vendor ID. */
@@ -581,6 +569,26 @@ int usb_match_one_id(struct usb_interface *interface,return 1 ; } + +/* returns 0 if no match, 1 if match */ +int usb_match_one_id (struct usb_interface *interface, +const struct usb_device_id *id) +{ +struct usb_host_interface *intf; +struct usb_device *dev; + +/* proc_connectinfo in devio.c may call us with id == NULL. */ +if (id ==NULL ) +return 0 ; + + intf = interface->cur_altsetting; + dev =interface_to_usbdev (interface); + +if (!usb_match_device (dev, id)) +return 0 ; + +return usb_match_one_id_intf (dev, intf, id); +}EXPORT_SYMBOL_GPL (usb_match_one_id);/**
drivers/usb/core/hub.c +7 -3
@@ -1883,7 +1883,7 @@ static int usb_enumerate_device(struct usb_device *udev)if (err <0 ) {dev_err (&udev->dev,"can't read configurations, error %d\n" , err); - goto fail; +return err; } }if (udev->wusb ==1 && udev->authorized ==0 ) {
@@ -1899,8 +1899,12 @@ static int usb_enumerate_device(struct usb_device *udev) udev->serial =usb_cache_string (udev, udev->descriptor.iSerialNumber); } err =usb_enumerate_device_otg (udev); -fail: -return err; +if (err <0 ) +return err; + +usb_detect_interface_quirks (udev); + +return 0 ; }
drivers/usb/core/quirks.c +88 -63
191 lines not on this page · raw message
drivers/usb/core/usb.h +4 -0
@@ -24,6 +24,7 @@ extern void usb_disable_device(struct usb_device *dev, int skip_ep0);extern int usb_deauthorize_device (struct usb_device *);extern int usb_authorize_device (struct usb_device *);extern void usb_detect_quirks (struct usb_device *udev); +extern void usb_detect_interface_quirks (struct usb_device *udev);extern int usb_remove_device (struct usb_device *udev); extern int usb_get_device_descriptor(struct usb_device *dev,
@@ -35,6 +36,9 @@ extern int usb_set_configuration(struct usb_device *dev, int configuration);extern int usb_choose_configuration (struct usb_device *udev);extern void usb_kick_khubd (struct usb_device *dev); +extern int usb_match_one_id_intf (struct usb_device *dev, +struct usb_host_interface *intf, +const struct usb_device_id *id);extern int usb_match_device (struct usb_device *dev,const struct usb_device_id *id);extern void usb_forced_unbind_intf (struct usb_interface *intf);
drivers/usb/host/ehci-omap.c +1 -1
@@ -337,7 +337,7 @@ static const struct hc_driver ehci_omap_hc_driver = { .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, }; -MODULE_ALIAS ("platform:omap-ehci" ); +MODULE_ALIAS ("platform:ehci-omap" );MODULE_AUTHOR ("Texas Instruments, Inc." );MODULE_AUTHOR ("Felipe Balbi <[email protected]>" );
drivers/usb/serial/ftdi_sio.c +9 -11
@@ -1916,24 +1916,22 @@ static void ftdi_dtr_rts(struct usb_serial_port *port, int on) {struct ftdi_private *priv =usb_get_serial_port_data (port); -mutex_lock (&port->serial->disc_mutex); -if (!port->serial->disconnected) { -/* Disable flow control */ -if (!on &&usb_control_msg (port->serial->dev, +/* Disable flow control */ +if (!on) { +if (usb_control_msg (port->serial->dev,usb_sndctrlpipe (port->serial->dev,0 ),FTDI_SIO_SET_FLOW_CTRL_REQUEST ,FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE ,0 , priv->interface,NULL ,0 ,WDR_TIMEOUT ) <0 ) { -dev_err (&port->dev,"error from flowcontrol urb\n" ); +dev_err (&port->dev,"error from flowcontrol urb\n" ); } -/* drop RTS and DTR */ -if (on) -set_mctrl (port,TIOCM_DTR |TIOCM_RTS ); -else -clear_mctrl (port,TIOCM_DTR |TIOCM_RTS ); } -mutex_unlock (&port->serial->disc_mutex); +/* drop RTS and DTR */ +if (on) +set_mctrl (port,TIOCM_DTR |TIOCM_RTS ); +else +clear_mctrl (port,TIOCM_DTR |TIOCM_RTS ); }/*
drivers/usb/serial/mct_u232.c +9 -13
@@ -558,19 +558,15 @@ static void mct_u232_dtr_rts(struct usb_serial_port *port, int on)unsigned int control_state;struct mct_u232_private *priv =usb_get_serial_port_data (port); -mutex_lock (&port->serial->disc_mutex); -if (!port->serial->disconnected) { -/* drop DTR and RTS */ -spin_lock_irq (&priv->lock); -if (on) - priv->control_state |=TIOCM_DTR |TIOCM_RTS ; -else - priv->control_state &= ~(TIOCM_DTR |TIOCM_RTS ); - control_state = priv->control_state; -spin_unlock_irq (&priv->lock); -mct_u232_set_modem_ctrl (port->serial, control_state); - } -mutex_unlock (&port->serial->disc_mutex); +spin_lock_irq (&priv->lock); +if (on) + priv->control_state |=TIOCM_DTR |TIOCM_RTS ; +else + priv->control_state &= ~(TIOCM_DTR |TIOCM_RTS ); + control_state = priv->control_state; +spin_unlock_irq (&priv->lock); + +mct_u232_set_modem_ctrl (port->serial, control_state); }static void mct_u232_close (struct usb_serial_port *port)
drivers/usb/serial/option.c +15 -1
@@ -479,6 +479,7 @@ static const struct option_blacklist_info four_g_w14_blacklist = {static const struct option_blacklist_info alcatel_x200_blacklist = { .sendsetup =BIT (0 ) |BIT (1 ), + .reserved =BIT (4 ), };static const struct option_blacklist_info zte_0037_blacklist = {
@@ -575,8 +576,14 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLX) }, { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GKE) }, { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLE) }, + { USB_DEVICE(QUANTA_VENDOR_ID, 0xea42), + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c05, USB_CLASS_COMM, 0x02, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c23, USB_CLASS_COMM, 0x02, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t) &net_intf1_blacklist }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1441, USB_CLASS_COMM, 0x02, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1442, USB_CLASS_COMM, 0x02, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff),
@@ -1215,7 +1222,14 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist }, - { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D) }, + { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D), + .driver_info = (kernel_ulong_t)&net_intf6_blacklist }, + { USB_DEVICE(ALCATEL_VENDOR_ID, 0x0052), + .driver_info = (kernel_ulong_t)&net_intf6_blacklist }, + { USB_DEVICE(ALCATEL_VENDOR_ID, 0x00b6), + .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, + { USB_DEVICE(ALCATEL_VENDOR_ID, 0x00b7), + .driver_info = (kernel_ulong_t)&net_intf5_blacklist }, { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_L100V), .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
drivers/usb/serial/sierra.c +1 -7
@@ -891,19 +891,13 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port)static void sierra_dtr_rts (struct usb_serial_port *port,int on) { -struct usb_serial *serial = port->serial;struct sierra_port_private *portdata; portdata =usb_get_serial_port_data (port); portdata->rts_state = on; portdata->dtr_state = on; -if (serial->dev) { -mutex_lock (&serial->disc_mutex); -if (!serial->disconnected) -sierra_send_setup (port); -mutex_unlock (&serial->disc_mutex); - } +sierra_send_setup (port); }static int sierra_startup (struct usb_serial *serial)
drivers/usb/serial/ssu100.c +8 -11
@@ -533,19 +533,16 @@ static void ssu100_dtr_rts(struct usb_serial_port *port, int on)dbg ("%s\n" , __func__); -mutex_lock (&port->serial->disc_mutex); -if (!port->serial->disconnected) { -/* Disable flow control */ -if (!on && -ssu100_setregister (dev,0 ,UART_MCR ,0 ) <0 ) +/* Disable flow control */ +if (!on) { +if (ssu100_setregister (dev,0 ,UART_MCR ,0 ) <0 )dev_err (&port->dev,"error from flowcontrol urb\n" ); -/* drop RTS and DTR */ -if (on) -set_mctrl (dev,TIOCM_DTR |TIOCM_RTS ); -else -clear_mctrl (dev,TIOCM_DTR |TIOCM_RTS ); } -mutex_unlock (&port->serial->disc_mutex); +/* drop RTS and DTR */ +if (on) +set_mctrl (dev,TIOCM_DTR |TIOCM_RTS ); +else +clear_mctrl (dev,TIOCM_DTR |TIOCM_RTS ); }static void ssu100_update_msr (struct usb_serial_port *port,u8 msr)
drivers/usb/serial/usb-serial.c +13 -2
@@ -697,9 +697,20 @@ static int serial_carrier_raised(struct tty_port *port)static void serial_dtr_rts (struct tty_port *port,int on) { struct usb_serial_port *p = container_of(port, struct usb_serial_port, port); -struct usb_serial_driver *drv = p->serial->type; -if (drv->dtr_rts) +struct usb_serial *serial = p->serial; +struct usb_serial_driver *drv = serial->type; + +if (!drv->dtr_rts) +return ; +/* +* Work-around bug in the tty-layer which can result in dtr_rts +* being called after a disconnect (and tty_unregister_device +* has returned). Remove once bug has been squashed. +*/ +mutex_lock (&serial->disc_mutex); +if (!serial->disconnected) drv->dtr_rts (p, on); +mutex_unlock (&serial->disc_mutex); }static const struct tty_port_operations serial_port_ops = {
drivers/usb/serial/usb_wwan.c +3 -5
@@ -41,7 +41,6 @@ static int debug;void usb_wwan_dtr_rts (struct usb_serial_port *port,int on) { -struct usb_serial *serial = port->serial;struct usb_wwan_port_private *portdata;struct usb_wwan_intf_private *intfdata;
@@ -54,12 +53,11 @@ void usb_wwan_dtr_rts(struct usb_serial_port *port, int on)return ; portdata =usb_get_serial_port_data (port); -mutex_lock (&serial->disc_mutex); +/* FIXME: locking */ portdata->rts_state = on; portdata->dtr_state = on; -if (serial->dev) - intfdata->send_setup (port); -mutex_unlock (&serial->disc_mutex); + + intfdata->send_setup (port); }EXPORT_SYMBOL (usb_wwan_dtr_rts);
drivers/usb/storage/initializers.c +2 -2
@@ -147,7 +147,7 @@ static int usb_stor_huawei_dongles_pid(struct us_data *us)int idProduct; idesc = &us->pusb_intf->cur_altsetting->desc; - idProduct = us->pusb_dev->descriptor.idProduct; + idProduct =le16_to_cpu (us->pusb_dev->descriptor.idProduct);/* The first port is CDROM, * means the dongle in the single port mode, * and a switch command is required to be sent. */
@@ -169,7 +169,7 @@ int usb_stor_huawei_init(struct us_data *us)int result =0 ;if (usb_stor_huawei_dongles_pid (us)) { -if (us->pusb_dev->descriptor.idProduct >=0x1446 ) +if (le16_to_cpu (us->pusb_dev->descriptor.idProduct) >=0x1446 ) result =usb_stor_huawei_scsi_init (us);else result =usb_stor_huawei_feature_init (us);
drivers/usb/storage/unusual_cypress.h +1 -1
@@ -31,7 +31,7 @@ UNUSUAL_DEV( 0x04b4, 0x6831, 0x0000, 0x9999, "Cypress ISD-300LP", USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), -UNUSUAL_DEV (0x14cd ,0x6116 ,0x0000 ,0x9999 , +UNUSUAL_DEV (0x14cd ,0x6116 ,0x0000 ,0x0219 ,"Super Top" ,"USB 2.0 SATA BRIDGE" , USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0),
drivers/vhost/vhost.c +1 -1
@@ -1073,7 +1073,7 @@ static int translate_desc(struct vhost_dev *dev, u64 addr, u32 len, } _iov = iov + ret; size = reg->memory_size - addr + reg->guest_phys_addr; - _iov->iov_len =min ((u64 )len, size); + _iov->iov_len =min ((u64 )len - s, size); _iov->iov_base = (void __user *)(unsigned long ) (reg->userspace_addr + addr - reg->guest_phys_addr); s += size;
drivers/video/backlight/adp8860_bl.c +1 -1
@@ -791,7 +791,7 @@ static int adp8860_i2c_suspend(struct i2c_client *client, pm_message_t message)static int adp8860_i2c_resume (struct i2c_client *client) { -adp8860_set_bits (client,ADP8860_MDCR ,NSTBY ); +adp8860_set_bits (client,ADP8860_MDCR ,NSTBY |BLEN );return 0 ; }
drivers/video/backlight/adp8870_bl.c +1 -1
@@ -965,7 +965,7 @@ static int adp8870_i2c_suspend(struct i2c_client *client, pm_message_t message)static int adp8870_i2c_resume (struct i2c_client *client) { -adp8870_set_bits (client,ADP8870_MDCR ,NSTBY ); +adp8870_set_bits (client,ADP8870_MDCR ,NSTBY |BLEN );return 0 ; }
drivers/video/console/fbcon.c +40 -7
109 lines not on this page · raw message
drivers/video/console/vgacon.c +15 -7
@@ -1064,7 +1064,7 @@ static int vgacon_do_font_op(struct vgastate *state,char *arg,int set,int ch512)unsigned short video_port_status = vga_video_port_reg +6 ;int font_select =0x00 , beg, i;char *charmap; - +bool clear_attribs = false;if (vga_video_type !=VIDEO_TYPE_EGAM ) { charmap = (char *)VGA_MAP_MEM (colourmap,0 ); beg =0x0e ;
@@ -1169,12 +1169,6 @@ static int vgacon_do_font_op(struct vgastate *state,char *arg,int set,int ch512)/* if 512 char mode is already enabled don't re-enable it. */ if ((set) && (ch512 != vga_512_chars)) { -/* attribute controller */ -for (i =0 ; i <MAX_NR_CONSOLES ; i++) { -struct vc_data *c = vc_cons[i].d; -if (c && c->vc_sw == &vga_con) - c->vc_hi_font_mask = ch512 ?0x0800 :0 ; - } vga_512_chars = ch512;/* 256-char: enable intensity bit 512-char: disable intensity bit */
@@ -1185,8 +1179,22 @@ static int vgacon_do_font_op(struct vgastate *state,char *arg,int set,int ch512)it means, but it works, and it appears necessary */ inb_p (video_port_status);vga_wattr (state->vgabase,VGA_AR_ENABLE_DISPLAY ,0 ); + clear_attribs = true; }raw_spin_unlock_irq (&vga_lock); + +if (clear_attribs) { +for (i =0 ; i <MAX_NR_CONSOLES ; i++) { +struct vc_data *c = vc_cons[i].d; +if (c && c->vc_sw == &vga_con) { +/* force hi font mask to 0, so we always clear +the bit on either transition */ + c->vc_hi_font_mask =0x00 ; +clear_buffer_attributes (c); + c->vc_hi_font_mask = ch512 ?0x0800 :0 ; + } + } + }return 0 ; }
drivers/video/fbmem.c +6 -3
@@ -1628,7 +1628,9 @@ static int do_register_framebuffer(struct fb_info *fb_info) event.info = fb_info;if (!lock_fb_info (fb_info))return -ENODEV ; +console_lock ();fb_notifier_call_chain (FB_EVENT_FB_REGISTERED , &event); +console_unlock ();unlock_fb_info (fb_info);return 0 ; }
@@ -1644,8 +1646,10 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)if (!lock_fb_info (fb_info))return -ENODEV ; +console_lock (); event.info = fb_info; ret =fb_notifier_call_chain (FB_EVENT_FB_UNBIND , &event); +console_unlock ();unlock_fb_info (fb_info);if (ret)
@@ -1660,7 +1664,9 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) num_registered_fb--;fb_cleanup_device (fb_info); event.info = fb_info; +console_lock ();fb_notifier_call_chain (FB_EVENT_FB_UNREGISTERED , &event); +console_unlock ();/* this may free fb info */ put_fb_info (fb_info);
@@ -1831,11 +1837,8 @@ int fb_new_modelist(struct fb_info *info) err =1 ;if (!list_empty (&info->modelist)) { -if (!lock_fb_info (info)) -return -ENODEV ; event.info = info; err =fb_notifier_call_chain (FB_EVENT_NEW_MODELIST , &event); -unlock_fb_info (info); }return err;
drivers/video/fbsysfs.c +3 -0
@@ -175,6 +175,8 @@ static ssize_t store_modes(struct device *device,if (i *sizeof (struct fb_videomode ) != count)return -EINVAL ; +if (!lock_fb_info (fb_info)) +return -ENODEV ;console_lock ();list_splice (&fb_info->modelist, &old_list); fb_videomode_to_modelist((const struct fb_videomode *)buf, i,
@@ -186,6 +188,7 @@ static ssize_t store_modes(struct device *device,fb_destroy_modelist (&old_list);console_unlock (); +unlock_fb_info (fb_info);return 0 ; }
drivers/xen/evtchn.c +10 -0
@@ -269,6 +269,14 @@ static int evtchn_bind_to_user(struct per_user_data *u, int port) u->name, (void *)(unsigned long)port);if (rc >=0 ) rc =0 ; +else { +/* bind failed, should close the port now */ +struct evtchn_close close; + close.port = port; +if (HYPERVISOR_event_channel_op (EVTCHNOP_close, &close) !=0 ) +BUG (); +set_port_user (port,NULL ); + }return rc; }
@@ -277,6 +285,8 @@ static void evtchn_unbind_from_user(struct per_user_data *u, int port) {int irq =irq_from_evtchn (port); +BUG_ON (irq <0 ); +unbind_from_irqhandler (irq, (void *)(unsigned long )port);set_port_user (port,NULL );
drivers/xen/xen-pciback/pciback_ops.c +8 -7
@@ -8,6 +8,7 @@#include <linux/bitops.h> #include <xen/events.h> #include <linux/sched.h> +#include <linux/ratelimit.h> #include "pciback.h" int verbose_request;
@@ -135,7 +136,6 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev, struct pci_dev *dev, struct xen_pci_op *op) { struct xen_pcibk_dev_data *dev_data; -int otherend = pdev->xdev->otherend_id;int status;if (unlikely (verbose_request))
@@ -144,8 +144,9 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev, status =pci_enable_msi (dev);if (status) { -printk (KERN_ERR "error enable msi for guest %x status %x\n" , - otherend, status); +pr_warn_ratelimited (DRV_NAME ": %s: error enabling MSI for guest %u: err %d\n" , +pci_name (dev), pdev->xdev->otherend_id, + status); op->value =0 ;return XEN_PCI_ERR_op_failed; }
@@ -223,10 +224,10 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,pci_name (dev), i, op->msix_entries[i].vector); } - }else { - printk(KERN_WARNING DRV_NAME ": %s: failed to enable MSI-X: err %d!\n", - pci_name(dev), result); - } + }else +pr_warn_ratelimited (DRV_NAME ": %s: error enabling MSI-X for guest %u: err %d!\n" , +pci_name (dev), pdev->xdev->otherend_id, + result);kfree (entries); op->value = result;
fs/binfmt_em86.c +0 -1
@@ -42,7 +42,6 @@ static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs)return -ENOEXEC ; } - bprm->recursion_depth++;/* Well, the bang-shell is implicit... */ allow_write_access (bprm->file);fput (bprm->file); bprm->file =NULL ;
fs/binfmt_misc.c +0 -6
@@ -116,10 +116,6 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)if (!enabled) goto _ret; - retval = -ENOEXEC ; -if (bprm->recursion_depth >BINPRM_MAX_RECURSION ) - goto _ret; -/* to keep locking time low, we copy the interpreter string */ read_lock (&entries_lock); fmt =check_file (bprm);
@@ -199,8 +195,6 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)if (retval <0 ) goto _error; - bprm->recursion_depth++; - retval =search_binary_handler (bprm, regs);if (retval <0 ) goto _error;
fs/binfmt_script.c +1 -3
@@ -22,15 +22,13 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)char interp[BINPRM_BUF_SIZE ];int retval; -if ((bprm->buf[0 ] !='#' ) || (bprm->buf[1 ] !='!' ) || - (bprm->recursion_depth >BINPRM_MAX_RECURSION )) +if ((bprm->buf[0 ] !='#' ) || (bprm->buf[1 ] !='!' ))return -ENOEXEC ;/* * This section does the #! interpretation. * Sorta complicated, but hopefully it will work. -TYT */ - bprm->recursion_depth++;allow_write_access (bprm->file);fput (bprm->file); bprm->file =NULL ;
fs/block_dev.c +3 -1
@@ -82,13 +82,14 @@ sector_t blkdev_max_block(struct block_device *bdev) }/* Kill _all_ buffers and pagecache , dirty or not.. */ -static void kill_bdev (struct block_device *bdev) +void kill_bdev (struct block_device *bdev) {if (bdev->bd_inode->i_mapping->nrpages ==0 )return ;invalidate_bh_lrus ();truncate_inode_pages (bdev->bd_inode->i_mapping,0 ); } +EXPORT_SYMBOL (kill_bdev);int set_blocksize (struct block_device *bdev,int size) {
@@ -1024,6 +1025,7 @@ int revalidate_disk(struct gendisk *disk)mutex_lock (&bdev->bd_mutex);check_disk_size_change (disk, bdev); + bdev->bd_invalidated =0 ;mutex_unlock (&bdev->bd_mutex);bdput (bdev);return ret;
fs/cachefiles/rdwr.c +1 -1
@@ -918,7 +918,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)* own time */ dget (object->backer);mntget (cache->mnt); - file =dentry_open (object->backer, cache->mnt,O_RDWR , + file =dentry_open (object->backer, cache->mnt,O_RDWR |O_LARGEFILE , cache->cache_cred);if (IS_ERR (file)) { ret =PTR_ERR (file);
fs/direct-io.c +1 -1
@@ -304,9 +304,9 @@ static ssize_t dio_complete(struct dio *dio, loff_t offset, ssize_t ret, bool is dio->end_io (dio->iocb, offset, transferred, dio->private, ret, is_async); }else { +inode_dio_done (dio->inode);if (is_async)aio_complete (dio->iocb, ret,0 ); -inode_dio_done (dio->inode); }return ret;
fs/exec.c +5 -5
@@ -1385,6 +1385,10 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)struct linux_binfmt *fmt;pid_t old_pid; +/* This allows 4 levels of binfmt rewrites before failing hard. */ +if (depth >5 ) +return -ELOOP ; + retval =security_bprm_check (bprm);if (retval)return retval;
@@ -1408,12 +1412,8 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)if (!try_module_get (fmt->module))continue ;read_unlock (&binfmt_lock); + bprm->recursion_depth = depth +1 ; retval =fn (bprm, regs); -/* -* Restore the depth counter to its starting value -* in this call, so we don't have to rely on every -* load_binary function to restore it on return. -*/ bprm->recursion_depth = depth;if (retval >=0 ) {if (depth ==0 )
fs/ext4/balloc.c +7 -2
@@ -420,11 +420,16 @@ static int ext4_has_free_clusters(struct ext4_sb_info *sbi, free_clusters =percpu_counter_read_positive (fcc); dirty_clusters =percpu_counter_read_positive (dcc); - root_clusters =EXT4_B2C (sbi,ext4_r_blocks_count (sbi->s_es)); + +/* +* r_blocks_count should always be multiple of the cluster ratio so +* we are safe to do a plane bit shift only. +*/ + root_clusters =ext4_r_blocks_count (sbi->s_es) >> sbi->s_cluster_bits;if (free_clusters - (nclusters + root_clusters + dirty_clusters) <EXT4_FREECLUSTERS_WATERMARK ) { - free_clusters =EXT4_C2B (sbi,percpu_counter_sum_positive (fcc)); + free_clusters =percpu_counter_sum_positive (fcc); dirty_clusters =percpu_counter_sum_positive (dcc); }/* Check whether we have space after accounting for current
fs/ext4/extents.c +132 -110
15 lines not on this page · raw message
kernel/kmod.c +70 -12
82 lines not on this page · raw message
kernel/trace/ftrace.c +32 -14
46 lines not on this page · raw message
kernel/workqueue.c +31 -11
42 lines not on this page · raw message
lib/idr.c +34 -17
51 lines not on this page · raw message
mm/mmu_notifier.c +86 -61
147 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
At Mon, 04 Mar 2013 03:37:07 +0000,
Quoted 11 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.40 release. There are 153 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Mar 6 02:00:00 UTC 2013. Anything received after that time might be too late.
A combined patch relative to 3.2.39 will be posted as an additional response to this. A shortlog and diffstat can be found below.
This kernel can be built and boot without any problem. Building a kernel with this kernel also works fine.
- Build Machine: debian wheezy x86_64
CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz x 4
memory: 8GB
- Test machine: debian wheezy x86_64(KVM guest on the Build Machine)
vCPU: x2
memory: 2GB
I reviewed the following patches and it looks good to me.
Quoted 3 lines
Matt Fleming (1):
x86, efi: Make "noefi" really disable EFI runtime serivces
[fb834c7acc5e140cf4f9e86da93a66de8c0514da]
...
Quoted 3 lines
Satoru Takeuchi (1):
efi: ClearEFI_RUNTIME_SERVICESrather thanEFI_BOOTby "noefi" boot parameter
[1de63d60cd5b0d33a812efa455d5933bf1564a51]
Thanks,
Satoru
Quoted 21 lines · Satoru Takeuchi
At Mon, 04 Mar 2013 03:37:07 +0000,
Quoted 11 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.40 release. There are 153 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Mar 6 02:00:00 UTC 2013. Anything received after that time might be too late.
A combined patch relative to 3.2.39 will be posted as an additional response to this. A shortlog and diffstat can be found below.
This kernel can be built and boot without any problem. Building a kernel with this kernel also works fine.
- Build Machine: debian wheezy
x86_64
CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz x 4
memory: 8GB
Quoted 5 lines
- Test machine: debian wheezy
x86_64(KVM guest on the Build Machine)
vCPU: x2
memory: 2GBI reviewed the following patches and it looks good to me.
Thanks.
Ben.
Quoted 11 lines
Quoted 3 lines
Matt Fleming (1):
x86, efi: Make "noefi" really disable EFI runtime serivces
[fb834c7acc5e140cf4f9e86da93a66de8c0514da]...
Quoted 3 lines
Satoru Takeuchi (1):
efi: ClearEFI_RUNTIME_SERVICESrather thanEFI_BOOTby "noefi" boot parameter
[1de63d60cd5b0d33a812efa455d5933bf1564a51]Thanks,
Satoru
Signature · 3 lines
Ben Hutchings Always try to do things in chronological order; it's less confusing that way.