Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300343
b: refs/heads/master
c: a2ae978
h: refs/heads/master
i:
  300341: 30d93f0
  300339: 6441a33
  300335: a1e4b32
v: v3
  • Loading branch information
Linus Torvalds committed May 19, 2012
1 parent b1fa524 commit 52d68b3
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 67 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d4b1133558e0d417342d5d2c49e4c35b428ff20d
refs/heads/master: a2ae9787568ac50978c03ce67bfb79ad2e100cca
4 changes: 0 additions & 4 deletions trunk/arch/frv/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ unsigned long get_wchan(struct task_struct *p);
#define KSTK_EIP(tsk) ((tsk)->thread.frame0->pc)
#define KSTK_ESP(tsk) ((tsk)->thread.frame0->sp)

/* Allocation and freeing of basic task resources. */
extern struct task_struct *alloc_task_struct_node(int node);
extern void free_task_struct(struct task_struct *p);

#define cpu_relax() barrier()

/* data cache prefetch */
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/tile/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ config TILE
select GENERIC_IRQ_PROBE
select GENERIC_PENDING_IRQ if SMP
select GENERIC_IRQ_SHOW
select HAVE_SYSCALL_WRAPPERS if TILEGX
select SYS_HYPERVISOR
select ARCH_HAVE_NMI_SAFE_CMPXCHG

Expand Down
14 changes: 11 additions & 3 deletions trunk/arch/x86/kernel/cpu/mcheck/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,16 +945,18 @@ struct mce_info {
atomic_t inuse;
struct task_struct *t;
__u64 paddr;
int restartable;
} mce_info[MCE_INFO_MAX];

static void mce_save_info(__u64 addr)
static void mce_save_info(__u64 addr, int c)
{
struct mce_info *mi;

for (mi = mce_info; mi < &mce_info[MCE_INFO_MAX]; mi++) {
if (atomic_cmpxchg(&mi->inuse, 0, 1) == 0) {
mi->t = current;
mi->paddr = addr;
mi->restartable = c;
return;
}
}
Expand Down Expand Up @@ -1130,7 +1132,7 @@ void do_machine_check(struct pt_regs *regs, long error_code)
mce_panic("Fatal machine check on current CPU", &m, msg);
if (worst == MCE_AR_SEVERITY) {
/* schedule action before return to userland */
mce_save_info(m.addr);
mce_save_info(m.addr, m.mcgstatus & MCG_STATUS_RIPV);
set_thread_flag(TIF_MCE_NOTIFY);
} else if (kill_it) {
force_sig(SIGBUS, current);
Expand Down Expand Up @@ -1179,7 +1181,13 @@ void mce_notify_process(void)

pr_err("Uncorrected hardware memory error in user-access at %llx",
mi->paddr);
if (memory_failure(pfn, MCE_VECTOR, MF_ACTION_REQUIRED) < 0) {
/*
* We must call memory_failure() here even if the current process is
* doomed. We still need to mark the page as poisoned and alert any
* other users of the page.
*/
if (memory_failure(pfn, MCE_VECTOR, MF_ACTION_REQUIRED) < 0 ||
mi->restartable == 0) {
pr_err("Memory error not recovered");
force_sig(SIGBUS, current);
}
Expand Down
32 changes: 17 additions & 15 deletions trunk/drivers/md/dm-thin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1632,6 +1632,21 @@ static int bind_control_target(struct pool *pool, struct dm_target *ti)
pool->low_water_blocks = pt->low_water_blocks;
pool->pf = pt->pf;

/*
* If discard_passdown was enabled verify that the data device
* supports discards. Disable discard_passdown if not; otherwise
* -EOPNOTSUPP will be returned.
*/
if (pt->pf.discard_passdown) {
struct request_queue *q = bdev_get_queue(pt->data_dev->bdev);
if (!q || !blk_queue_discard(q)) {
char buf[BDEVNAME_SIZE];
DMWARN("Discard unsupported by data device (%s): Disabling discard passdown.",
bdevname(pt->data_dev->bdev, buf));
pool->pf.discard_passdown = 0;
}
}

return 0;
}

Expand Down Expand Up @@ -1988,19 +2003,6 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv)
goto out_flags_changed;
}

/*
* If discard_passdown was enabled verify that the data device
* supports discards. Disable discard_passdown if not; otherwise
* -EOPNOTSUPP will be returned.
*/
if (pf.discard_passdown) {
struct request_queue *q = bdev_get_queue(data_dev->bdev);
if (!q || !blk_queue_discard(q)) {
DMWARN("Discard unsupported by data device: Disabling discard passdown.");
pf.discard_passdown = 0;
}
}

pt->pool = pool;
pt->ti = ti;
pt->metadata_dev = metadata_dev;
Expand Down Expand Up @@ -2385,7 +2387,7 @@ static int pool_status(struct dm_target *ti, status_type_t type,
(unsigned long long)pt->low_water_blocks);

count = !pool->pf.zero_new_blocks + !pool->pf.discard_enabled +
!pool->pf.discard_passdown;
!pt->pf.discard_passdown;
DMEMIT("%u ", count);

if (!pool->pf.zero_new_blocks)
Expand All @@ -2394,7 +2396,7 @@ static int pool_status(struct dm_target *ti, status_type_t type,
if (!pool->pf.discard_enabled)
DMEMIT("ignore_discard ");

if (!pool->pf.discard_passdown)
if (!pt->pf.discard_passdown)
DMEMIT("no_discard_passdown ");

break;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -3189,7 +3189,7 @@ static void calc_sectors(struct r10conf *conf, sector_t size)
if (conf->far_offset)
conf->stride = 1 << conf->chunk_shift;
else {
sector_div(size, conf->near_copies);
sector_div(size, conf->far_copies);
conf->stride = size << conf->chunk_shift;
}
}
Expand Down
18 changes: 18 additions & 0 deletions trunk/drivers/rtc/rtc-pl031.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
int ret;
struct pl031_local *ldata;
struct rtc_class_ops *ops = id->data;
unsigned long time;

ret = amba_request_regions(adev, NULL);
if (ret)
Expand Down Expand Up @@ -343,6 +344,23 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN,
ldata->base + RTC_CR);

/*
* On ST PL031 variants, the RTC reset value does not provide correct
* weekday for 2000-01-01. Correct the erroneous sunday to saturday.
*/
if (ldata->hw_designer == AMBA_VENDOR_ST) {
if (readl(ldata->base + RTC_YDR) == 0x2000) {
time = readl(ldata->base + RTC_DR);
if ((time &
(RTC_MON_MASK | RTC_MDAY_MASK | RTC_WDAY_MASK))
== 0x02120000) {
time = time | (0x7 << RTC_WDAY_SHIFT);
writel(0x2000, ldata->base + RTC_YLR);
writel(time, ldata->base + RTC_LR);
}
}
}

ldata->rtc = rtc_device_register("pl031", &adev->dev, ops,
THIS_MODULE);
if (IS_ERR(ldata->rtc)) {
Expand Down
63 changes: 22 additions & 41 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1799,10 +1799,15 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
if (task) {
files = get_files_struct(task);
if (files) {
struct file *file;
rcu_read_lock();
if (fcheck_files(files, fd)) {
file = fcheck_files(files, fd);
if (file) {
unsigned i_mode, f_mode = file->f_mode;

rcu_read_unlock();
put_files_struct(files);

if (task_dumpable(task)) {
rcu_read_lock();
cred = __task_cred(task);
Expand All @@ -1813,7 +1818,14 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
inode->i_uid = 0;
inode->i_gid = 0;
}
inode->i_mode &= ~(S_ISUID | S_ISGID);

i_mode = S_IFLNK;
if (f_mode & FMODE_READ)
i_mode |= S_IRUSR | S_IXUSR;
if (f_mode & FMODE_WRITE)
i_mode |= S_IWUSR | S_IXUSR;
inode->i_mode = i_mode;

security_task_to_inode(task, inode);
put_task_struct(task);
return 1;
Expand All @@ -1837,8 +1849,6 @@ static struct dentry *proc_fd_instantiate(struct inode *dir,
struct dentry *dentry, struct task_struct *task, const void *ptr)
{
unsigned fd = *(const unsigned *)ptr;
struct file *file;
struct files_struct *files;
struct inode *inode;
struct proc_inode *ei;
struct dentry *error = ERR_PTR(-ENOENT);
Expand All @@ -1848,25 +1858,6 @@ static struct dentry *proc_fd_instantiate(struct inode *dir,
goto out;
ei = PROC_I(inode);
ei->fd = fd;
files = get_files_struct(task);
if (!files)
goto out_iput;
inode->i_mode = S_IFLNK;

/*
* We are not taking a ref to the file structure, so we must
* hold ->file_lock.
*/
spin_lock(&files->file_lock);
file = fcheck_files(files, fd);
if (!file)
goto out_unlock;
if (file->f_mode & FMODE_READ)
inode->i_mode |= S_IRUSR | S_IXUSR;
if (file->f_mode & FMODE_WRITE)
inode->i_mode |= S_IWUSR | S_IXUSR;
spin_unlock(&files->file_lock);
put_files_struct(files);

inode->i_op = &proc_pid_link_inode_operations;
inode->i_size = 64;
Expand All @@ -1879,12 +1870,6 @@ static struct dentry *proc_fd_instantiate(struct inode *dir,

out:
return error;
out_unlock:
spin_unlock(&files->file_lock);
put_files_struct(files);
out_iput:
iput(inode);
goto out;
}

static struct dentry *proc_lookupfd_common(struct inode *dir,
Expand Down Expand Up @@ -2177,16 +2162,16 @@ static struct dentry *proc_map_files_lookup(struct inode *dir,
goto out;

result = ERR_PTR(-EACCES);
if (lock_trace(task))
if (!ptrace_may_access(task, PTRACE_MODE_READ))
goto out_put_task;

result = ERR_PTR(-ENOENT);
if (dname_to_vma_addr(dentry, &vm_start, &vm_end))
goto out_unlock;
goto out_put_task;

mm = get_task_mm(task);
if (!mm)
goto out_unlock;
goto out_put_task;

down_read(&mm->mmap_sem);
vma = find_exact_vma(mm, vm_start, vm_end);
Expand All @@ -2198,8 +2183,6 @@ static struct dentry *proc_map_files_lookup(struct inode *dir,
out_no_vma:
up_read(&mm->mmap_sem);
mmput(mm);
out_unlock:
unlock_trace(task);
out_put_task:
put_task_struct(task);
out:
Expand Down Expand Up @@ -2233,20 +2216,20 @@ proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir)
goto out;

ret = -EACCES;
if (lock_trace(task))
if (!ptrace_may_access(task, PTRACE_MODE_READ))
goto out_put_task;

ret = 0;
switch (filp->f_pos) {
case 0:
ino = inode->i_ino;
if (filldir(dirent, ".", 1, 0, ino, DT_DIR) < 0)
goto out_unlock;
goto out_put_task;
filp->f_pos++;
case 1:
ino = parent_ino(dentry);
if (filldir(dirent, "..", 2, 1, ino, DT_DIR) < 0)
goto out_unlock;
goto out_put_task;
filp->f_pos++;
default:
{
Expand All @@ -2257,7 +2240,7 @@ proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir)

mm = get_task_mm(task);
if (!mm)
goto out_unlock;
goto out_put_task;
down_read(&mm->mmap_sem);

nr_files = 0;
Expand Down Expand Up @@ -2287,7 +2270,7 @@ proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir)
flex_array_free(fa);
up_read(&mm->mmap_sem);
mmput(mm);
goto out_unlock;
goto out_put_task;
}
for (i = 0, vma = mm->mmap, pos = 2; vma;
vma = vma->vm_next) {
Expand Down Expand Up @@ -2332,8 +2315,6 @@ proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir)
}
}

out_unlock:
unlock_trace(task);
out_put_task:
put_task_struct(task);
out:
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -5481,7 +5481,7 @@ static int mem_cgroup_move_charge_pte_range(pmd_t *pmd,
* part of thp split is not executed yet.
*/
if (pmd_trans_huge_lock(pmd, vma) == 1) {
if (!mc.precharge) {
if (mc.precharge < HPAGE_PMD_NR) {
spin_unlock(&vma->vm_mm->page_table_lock);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2040,7 +2040,7 @@ static bool has_cpu_slab(int cpu, void *info)
struct kmem_cache *s = info;
struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu);

return !!(c->page);
return c->page || c->partial;
}

static void flush_all(struct kmem_cache *s)
Expand Down

0 comments on commit 52d68b3

Please sign in to comment.