From efc76eac5be7d54b2952c157c44a03685e32c68c Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 10 May 2012 15:07:20 -0700 Subject: [PATCH] --- yaml --- r: 300150 b: refs/heads/master c: 9e5869f8d70d94850cf86163c57ba8d4daa29924 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/cifs/cifsfs.c | 2 +- trunk/mm/percpu.c | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 608474e8c2c0..62c741b34295 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a5a737e090e25981e99d69f01400e3a80356581c +refs/heads/master: 9e5869f8d70d94850cf86163c57ba8d4daa29924 diff --git a/trunk/fs/cifs/cifsfs.c b/trunk/fs/cifs/cifsfs.c index ca6a3796a33b..541ef81f6ae8 100644 --- a/trunk/fs/cifs/cifsfs.c +++ b/trunk/fs/cifs/cifsfs.c @@ -699,7 +699,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin) * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate * the cached file length */ - if (origin != SEEK_SET || origin != SEEK_CUR) { + if (origin != SEEK_SET && origin != SEEK_CUR) { int rc; struct inode *inode = file->f_path.dentry->d_inode; diff --git a/trunk/mm/percpu.c b/trunk/mm/percpu.c index f921fdfb5430..bb4be7435ce3 100644 --- a/trunk/mm/percpu.c +++ b/trunk/mm/percpu.c @@ -1650,6 +1650,16 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size, areas[group] = ptr; base = min(ptr, base); + } + + /* + * Copy data and free unused parts. This should happen after all + * allocations are complete; otherwise, we may end up with + * overlapping groups. + */ + for (group = 0; group < ai->nr_groups; group++) { + struct pcpu_group_info *gi = &ai->groups[group]; + void *ptr = areas[group]; for (i = 0; i < gi->nr_units; i++, ptr += ai->unit_size) { if (gi->cpu_map[i] == NR_CPUS) { @@ -1885,6 +1895,8 @@ void __init setup_per_cpu_areas(void) fc = __alloc_bootmem(unit_size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); if (!ai || !fc) panic("Failed to allocate memory for percpu areas."); + /* kmemleak tracks the percpu allocations separately */ + kmemleak_free(fc); ai->dyn_size = unit_size; ai->unit_size = unit_size;