Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234020
b: refs/heads/master
c: 35d34df
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Mar 10, 2011
1 parent 10de3b7 commit be9ee01
Show file tree
Hide file tree
Showing 21 changed files with 80 additions and 39 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: 36e8695ca5dcf48c837a6efe6f780c47ac9ec808
refs/heads/master: 35d34df711e8b44846e759d8cfddb4ec6877cccb
1 change: 1 addition & 0 deletions trunk/arch/alpha/kernel/sys_titan.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ static int
titan_set_irq_affinity(struct irq_data *d, const struct cpumask *affinity,
bool force)
{
unsigned int irq = d->irq;
spin_lock(&titan_irq_lock);
titan_cpu_set_irq_affinity(irq - 16, *affinity);
titan_update_irq_hw(titan_cached_irq_mask);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ static unsigned int pcc_get_freq(unsigned int cpu)
cmd_incomplete:
iowrite16(0, &pcch_hdr->status);
spin_unlock(&pcc_lock);
return -EINVAL;
return 0;
}

static int pcc_cpufreq_target(struct cpufreq_policy *policy,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/i2c/busses/i2c-eg20t.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/pci.h>
#include <linux/mutex.h>
#include <linux/ktime.h>
#include <linux/slab.h>

#define PCH_EVENT_SET 0 /* I2C Interrupt Event Set Status */
#define PCH_EVENT_NONE 1 /* I2C Interrupt Event Clear Status */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/i2c/busses/i2c-ocores.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static struct i2c_adapter ocores_adapter = {
static int ocores_i2c_of_probe(struct platform_device* pdev,
struct ocores_i2c* i2c)
{
__be32* val;
const __be32* val;

val = of_get_property(pdev->dev.of_node, "regstep", NULL);
if (!val) {
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/i2c/busses/i2c-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,7 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
* REVISIT: Some wkup sources might not be needed.
*/
dev->westate = OMAP_I2C_WE_ALL;
if (dev->rev < OMAP_I2C_REV_ON_4430)
omap_i2c_write_reg(dev, OMAP_I2C_WE_REG,
dev->westate);
omap_i2c_write_reg(dev, OMAP_I2C_WE_REG, dev->westate);
}
}
omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ void mmc_rescan(struct work_struct *work)
* still present
*/
if (host->bus_ops && host->bus_ops->detect && !host->bus_dead
&& mmc_card_is_removable(host))
&& !(host->caps & MMC_CAP_NONREMOVABLE))
host->bus_ops->detect(host);

/*
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/watchdog/sbc_fitpc2_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,14 @@ static struct miscdevice fitpc2_wdt_miscdev = {
static int __init fitpc2_wdt_init(void)
{
int err;
const char *brd_name;

if (!strstr(dmi_get_system_info(DMI_BOARD_NAME), "SBC-FITPC2"))
brd_name = dmi_get_system_info(DMI_BOARD_NAME);

if (!brd_name || !strstr(brd_name, "SBC-FITPC2"))
return -ENODEV;

pr_info("%s found\n", dmi_get_system_info(DMI_BOARD_NAME));
pr_info("%s found\n", brd_name);

if (!request_region(COMMAND_PORT, 1, WATCHDOG_NAME)) {
pr_err("I/O address 0x%04x already in use\n", COMMAND_PORT);
Expand Down
14 changes: 11 additions & 3 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1546,6 +1546,7 @@ static int path_walk(const char *name, struct nameidata *nd)
/* nd->path had been dropped */
current->total_link_count = 0;
nd->path = save;
nd->inode = save.dentry->d_inode;
path_get(&nd->path);
nd->flags |= LOOKUP_REVAL;
result = link_path_walk(name, nd);
Expand Down Expand Up @@ -2455,22 +2456,29 @@ struct file *do_filp_open(int dfd, const char *pathname,
/* !O_CREAT, simple open */
error = do_path_lookup(dfd, pathname, flags, &nd);
if (unlikely(error))
goto out_filp;
goto out_filp2;
error = -ELOOP;
if (!(nd.flags & LOOKUP_FOLLOW)) {
if (nd.inode->i_op->follow_link)
goto out_path;
goto out_path2;
}
error = -ENOTDIR;
if (nd.flags & LOOKUP_DIRECTORY) {
if (!nd.inode->i_op->lookup)
goto out_path;
goto out_path2;
}
audit_inode(pathname, nd.path.dentry);
filp = finish_open(&nd, open_flag, acc_mode);
out2:
release_open_intent(&nd);
return filp;

out_path2:
path_put(&nd.path);
out_filp2:
filp = ERR_PTR(error);
goto out2;

creat:
/* OK, have to create the file. Find the parent. */
error = path_init_rcu(dfd, pathname,
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/nfsd/nfs4callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ static int decode_cb_sequence4resok(struct xdr_stream *xdr,
* If the server returns different values for sessionID, slotID or
* sequence number, the server is looney tunes.
*/
p = xdr_inline_decode(xdr, NFS4_MAX_SESSIONID_LEN + 4 + 4);
p = xdr_inline_decode(xdr, NFS4_MAX_SESSIONID_LEN + 4 + 4 + 4 + 4);
if (unlikely(p == NULL))
goto out_overflow;
memcpy(id.data, p, NFS4_MAX_SESSIONID_LEN);
Expand Down
13 changes: 7 additions & 6 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -2445,15 +2445,16 @@ nfs4_check_delegmode(struct nfs4_delegation *dp, int flags)
static struct nfs4_delegation *
find_delegation_file(struct nfs4_file *fp, stateid_t *stid)
{
struct nfs4_delegation *dp = NULL;
struct nfs4_delegation *dp;

spin_lock(&recall_lock);
list_for_each_entry(dp, &fp->fi_delegations, dl_perfile) {
if (dp->dl_stateid.si_stateownerid == stid->si_stateownerid)
break;
}
list_for_each_entry(dp, &fp->fi_delegations, dl_perfile)
if (dp->dl_stateid.si_stateownerid == stid->si_stateownerid) {
spin_unlock(&recall_lock);
return dp;
}
spin_unlock(&recall_lock);
return dp;
return NULL;
}

int share_access_to_flags(u32 share_access)
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ nfsd4_decode_create_session(struct nfsd4_compoundargs *argp,

u32 dummy;
char *machine_name;
int i;
int i, j;
int nr_secflavs;

READ_BUF(16);
Expand Down Expand Up @@ -1215,7 +1215,7 @@ nfsd4_decode_create_session(struct nfsd4_compoundargs *argp,
READ_BUF(4);
READ32(dummy);
READ_BUF(dummy * 4);
for (i = 0; i < dummy; ++i)
for (j = 0; j < dummy; ++j)
READ32(dummy);
break;
case RPC_AUTH_GSS:
Expand Down
8 changes: 6 additions & 2 deletions trunk/fs/proc/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
static void proc_evict_inode(struct inode *inode)
{
struct proc_dir_entry *de;
struct ctl_table_header *head;

truncate_inode_pages(&inode->i_data, 0);
end_writeback(inode);
Expand All @@ -38,8 +39,11 @@ static void proc_evict_inode(struct inode *inode)
de = PROC_I(inode)->pde;
if (de)
pde_put(de);
if (PROC_I(inode)->sysctl)
sysctl_head_put(PROC_I(inode)->sysctl);
head = PROC_I(inode)->sysctl;
if (head) {
rcu_assign_pointer(PROC_I(inode)->sysctl, NULL);
sysctl_head_put(head);
}
}

struct vfsmount *proc_mnt;
Expand Down
7 changes: 5 additions & 2 deletions trunk/fs/proc/proc_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,15 +408,18 @@ static int proc_sys_compare(const struct dentry *parent,
const struct dentry *dentry, const struct inode *inode,
unsigned int len, const char *str, const struct qstr *name)
{
struct ctl_table_header *head;
/* Although proc doesn't have negative dentries, rcu-walk means
* that inode here can be NULL */
/* AV: can it, indeed? */
if (!inode)
return 0;
return 1;
if (name->len != len)
return 1;
if (memcmp(name->name, str, len))
return 1;
return !sysctl_is_seen(PROC_I(inode)->sysctl);
head = rcu_dereference(PROC_I(inode)->sysctl);
return !head || !sysctl_is_seen(head);
}

static const struct dentry_operations proc_sys_dentry_operations = {
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -2392,6 +2392,9 @@ extern int netdev_notice(const struct net_device *dev, const char *format, ...)
extern int netdev_info(const struct net_device *dev, const char *format, ...)
__attribute__ ((format (printf, 2, 3)));

#define MODULE_ALIAS_NETDEV(device) \
MODULE_ALIAS("netdev-" device)

#if defined(DEBUG)
#define netdev_dbg(__dev, format, args...) \
netdev_printk(KERN_DEBUG, __dev, format, ##args)
Expand Down
14 changes: 10 additions & 4 deletions trunk/include/linux/sysctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,7 @@ enum

#ifdef __KERNEL__
#include <linux/list.h>
#include <linux/rcupdate.h>

/* For the /proc/sys support */
struct ctl_table;
Expand Down Expand Up @@ -1037,10 +1038,15 @@ struct ctl_table_root {
struct ctl_table trees. */
struct ctl_table_header
{
struct ctl_table *ctl_table;
struct list_head ctl_entry;
int used;
int count;
union {
struct {
struct ctl_table *ctl_table;
struct list_head ctl_entry;
int used;
int count;
};
struct rcu_head rcu;
};
struct completion *unregistering;
struct ctl_table *ctl_table_arg;
struct ctl_table_root *root;
Expand Down
15 changes: 10 additions & 5 deletions trunk/kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ static int sysrq_sysctl_handler(ctl_table *table, int write,
static struct ctl_table root_table[];
static struct ctl_table_root sysctl_table_root;
static struct ctl_table_header root_table_header = {
.count = 1,
{{.count = 1,
.ctl_table = root_table,
.ctl_entry = LIST_HEAD_INIT(sysctl_table_root.default_set.list),
.ctl_entry = LIST_HEAD_INIT(sysctl_table_root.default_set.list),}},
.root = &sysctl_table_root,
.set = &sysctl_table_root.default_set,
};
Expand Down Expand Up @@ -1567,11 +1567,16 @@ void sysctl_head_get(struct ctl_table_header *head)
spin_unlock(&sysctl_lock);
}

static void free_head(struct rcu_head *rcu)
{
kfree(container_of(rcu, struct ctl_table_header, rcu));
}

void sysctl_head_put(struct ctl_table_header *head)
{
spin_lock(&sysctl_lock);
if (!--head->count)
kfree(head);
call_rcu(&head->rcu, free_head);
spin_unlock(&sysctl_lock);
}

Expand Down Expand Up @@ -1948,10 +1953,10 @@ void unregister_sysctl_table(struct ctl_table_header * header)
start_unregistering(header);
if (!--header->parent->count) {
WARN_ON(1);
kfree(header->parent);
call_rcu(&header->parent->rcu, free_head);
}
if (!--header->count)
kfree(header);
call_rcu(&header->rcu, free_head);
spin_unlock(&sysctl_lock);
}

Expand Down
12 changes: 10 additions & 2 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,13 +1114,21 @@ EXPORT_SYMBOL(netdev_bonding_change);
void dev_load(struct net *net, const char *name)
{
struct net_device *dev;
int no_module;

rcu_read_lock();
dev = dev_get_by_name_rcu(net, name);
rcu_read_unlock();

if (!dev && capable(CAP_NET_ADMIN))
request_module("%s", name);
no_module = !dev;
if (no_module && capable(CAP_NET_ADMIN))
no_module = request_module("netdev-%s", name);
if (no_module && capable(CAP_SYS_MODULE)) {
if (!request_module("%s", name))
pr_err("Loading kernel module for a network device "
"with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s "
"instead\n", name);
}
}
EXPORT_SYMBOL(dev_load);

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -1765,4 +1765,4 @@ module_exit(ipgre_fini);
MODULE_LICENSE("GPL");
MODULE_ALIAS_RTNL_LINK("gre");
MODULE_ALIAS_RTNL_LINK("gretap");
MODULE_ALIAS("gre0");
MODULE_ALIAS_NETDEV("gre0");
2 changes: 1 addition & 1 deletion trunk/net/ipv4/ipip.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,4 +913,4 @@ static void __exit ipip_fini(void)
module_init(ipip_init);
module_exit(ipip_fini);
MODULE_LICENSE("GPL");
MODULE_ALIAS("tunl0");
MODULE_ALIAS_NETDEV("tunl0");
2 changes: 1 addition & 1 deletion trunk/net/ipv6/sit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1290,4 +1290,4 @@ static int __init sit_init(void)
module_init(sit_init);
module_exit(sit_cleanup);
MODULE_LICENSE("GPL");
MODULE_ALIAS("sit0");
MODULE_ALIAS_NETDEV("sit0");

0 comments on commit be9ee01

Please sign in to comment.