Skip to content

Commit

Permalink
Merge branch 'linux-3.0.y' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/stable/linux-stable into rs-dev
  • Loading branch information
yanniks committed Aug 15, 2013
2 parents 3851932 + af4bafb commit 99c26fb
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 72 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 0
SUBLEVEL = 90
SUBLEVEL = 91
EXTRAVERSION =
NAME = Sneaky Weasel

Expand Down
47 changes: 28 additions & 19 deletions drivers/char/virtio_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,12 @@ static struct port *find_port_by_devt_in_portdev(struct ports_device *portdev,
unsigned long flags;

spin_lock_irqsave(&portdev->ports_lock, flags);
list_for_each_entry(port, &portdev->ports, list)
if (port->cdev->dev == dev)
list_for_each_entry(port, &portdev->ports, list) {
if (port->cdev->dev == dev) {
kref_get(&port->kref);
goto out;
}
}
port = NULL;
out:
spin_unlock_irqrestore(&portdev->ports_lock, flags);
Expand Down Expand Up @@ -622,6 +625,10 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf,

port = filp->private_data;

/* Port is hot-unplugged. */
if (!port->guest_connected)
return -ENODEV;

if (!port_has_data(port)) {
/*
* If nothing's connected on the host just return 0 in
Expand All @@ -638,7 +645,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf,
if (ret < 0)
return ret;
}
/* Port got hot-unplugged. */
/* Port got hot-unplugged while we were waiting above. */
if (!port->guest_connected)
return -ENODEV;
/*
Expand Down Expand Up @@ -781,14 +788,14 @@ static int port_fops_open(struct inode *inode, struct file *filp)
struct port *port;
int ret;

/* We get the port with a kref here */
port = find_port_by_devt(cdev->dev);
if (!port) {
/* Port was unplugged before we could proceed */
return -ENXIO;
}
filp->private_data = port;

/* Prevent against a port getting hot-unplugged at the same time */
spin_lock_irq(&port->portdev->ports_lock);
kref_get(&port->kref);
spin_unlock_irq(&port->portdev->ports_lock);

/*
* Don't allow opening of console port devices -- that's done
* via /dev/hvc
Expand Down Expand Up @@ -1243,14 +1250,6 @@ static void remove_port(struct kref *kref)

port = container_of(kref, struct port, kref);

sysfs_remove_group(&port->dev->kobj, &port_attribute_group);
device_destroy(pdrvdata.class, port->dev->devt);
cdev_del(port->cdev);

kfree(port->name);

debugfs_remove(port->debugfs_file);

kfree(port);
}

Expand All @@ -1268,12 +1267,14 @@ static void unplug_port(struct port *port)
spin_unlock_irq(&port->portdev->ports_lock);

if (port->guest_connected) {
/* Let the app know the port is going down. */
send_sigio_to_port(port);

/* Do this after sigio is actually sent */
port->guest_connected = false;
port->host_connected = false;
wake_up_interruptible(&port->waitqueue);

/* Let the app know the port is going down. */
send_sigio_to_port(port);
wake_up_interruptible(&port->waitqueue);
}

if (is_console_port(port)) {
Expand All @@ -1299,6 +1300,14 @@ static void unplug_port(struct port *port)
*/
port->portdev = NULL;

sysfs_remove_group(&port->dev->kobj, &port_attribute_group);
device_destroy(pdrvdata.class, port->dev->devt);
cdev_del(port->cdev);

kfree(port->name);

debugfs_remove(port->debugfs_file);

/*
* Locks around here are not necessary - a port can't be
* opened after we removed the port struct from ports_list
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/adt7470.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static inline int adt7470_write_word_data(struct i2c_client *client, u8 reg,
u16 value)
{
return i2c_smbus_write_byte_data(client, reg, value & 0xFF)
&& i2c_smbus_write_byte_data(client, reg + 1, value >> 8);
|| i2c_smbus_write_byte_data(client, reg + 1, value >> 8);
}

static void adt7470_init_client(struct i2c_client *client)
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/nsp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -2927,7 +2927,7 @@ static void nsp32_do_bus_reset(nsp32_hw_data *data)
* reset SCSI bus
*/
nsp32_write1(base, SCSI_BUS_CONTROL, BUSCTL_RST);
udelay(RESET_HOLD_TIME);
mdelay(RESET_HOLD_TIME / 1000);
nsp32_write1(base, SCSI_BUS_CONTROL, 0);
for(i = 0; i < 5; i++) {
intrdat = nsp32_read2(base, IRQ_STATUS); /* dummy read */
Expand Down
2 changes: 1 addition & 1 deletion fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,7 @@ static struct dentry * d_find_any_alias(struct inode *inode)
*/
struct dentry *d_obtain_alias(struct inode *inode)
{
static const struct qstr anonstring = { .name = "" };
static const struct qstr anonstring = { .name = "/", .len = 1 };
struct dentry *tmp;
struct dentry *res;

Expand Down
69 changes: 22 additions & 47 deletions fs/debugfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,7 @@ EXPORT_SYMBOL_GPL(debugfs_remove);
*/
void debugfs_remove_recursive(struct dentry *dentry)
{
struct dentry *child;
struct dentry *parent;
struct dentry *child, *next, *parent;

if (!dentry)
return;
Expand All @@ -391,61 +390,37 @@ void debugfs_remove_recursive(struct dentry *dentry)
return;

parent = dentry;
down:
mutex_lock(&parent->d_inode->i_mutex);
list_for_each_entry_safe(child, next, &parent->d_subdirs, d_u.d_child) {
if (!debugfs_positive(child))
continue;

while (1) {
/*
* When all dentries under "parent" has been removed,
* walk up the tree until we reach our starting point.
*/
if (list_empty(&parent->d_subdirs)) {
mutex_unlock(&parent->d_inode->i_mutex);
if (parent == dentry)
break;
parent = parent->d_parent;
mutex_lock(&parent->d_inode->i_mutex);
}
child = list_entry(parent->d_subdirs.next, struct dentry,
d_u.d_child);
next_sibling:

/*
* If "child" isn't empty, walk down the tree and
* remove all its descendants first.
*/
/* perhaps simple_empty(child) makes more sense */
if (!list_empty(&child->d_subdirs)) {
mutex_unlock(&parent->d_inode->i_mutex);
parent = child;
mutex_lock(&parent->d_inode->i_mutex);
continue;
}
__debugfs_remove(child, parent);
if (parent->d_subdirs.next == &child->d_u.d_child) {
/*
* Try the next sibling.
*/
if (child->d_u.d_child.next != &parent->d_subdirs) {
child = list_entry(child->d_u.d_child.next,
struct dentry,
d_u.d_child);
goto next_sibling;
}

/*
* Avoid infinite loop if we fail to remove
* one dentry.
*/
mutex_unlock(&parent->d_inode->i_mutex);
break;
goto down;
}
simple_release_fs(&debugfs_mount, &debugfs_mount_count);
up:
if (!__debugfs_remove(child, parent))
simple_release_fs(&debugfs_mount, &debugfs_mount_count);
}

parent = dentry->d_parent;
mutex_unlock(&parent->d_inode->i_mutex);
child = parent;
parent = parent->d_parent;
mutex_lock(&parent->d_inode->i_mutex);
__debugfs_remove(dentry, parent);

if (child != dentry) {
next = list_entry(child->d_u.d_child.next, struct dentry,
d_u.d_child);
goto up;
}

if (!__debugfs_remove(child, parent))
simple_release_fs(&debugfs_mount, &debugfs_mount_count);
mutex_unlock(&parent->d_inode->i_mutex);
simple_release_fs(&debugfs_mount, &debugfs_mount_count);
}
EXPORT_SYMBOL_GPL(debugfs_remove_recursive);

Expand Down
4 changes: 3 additions & 1 deletion include/linux/ftrace_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ struct trace_iterator {
/* trace_seq for __print_flags() and __print_symbolic() etc. */
struct trace_seq tmp_seq;

cpumask_var_t started;

/* The below is zeroed out in pipe_read */
struct trace_seq seq;
struct trace_entry *ent;
Expand All @@ -82,7 +84,7 @@ struct trace_iterator {
loff_t pos;
long idx;

cpumask_var_t started;
/* All new field here will be zeroed out in pipe_read */
};


Expand Down
1 change: 1 addition & 0 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -3245,6 +3245,7 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
memset(&iter->seq, 0,
sizeof(struct trace_iterator) -
offsetof(struct trace_iterator, seq));
cpumask_clear(iter->started);
iter->pos = -1;

trace_event_read_lock();
Expand Down
3 changes: 2 additions & 1 deletion tools/perf/util/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const char *map_type__name[MAP__NR_TYPES] = {

static inline int is_anon_memory(const char *filename)
{
return strcmp(filename, "//anon") == 0;
return !strcmp(filename, "//anon") ||
!strcmp(filename, "/anon_hugepage (deleted)");
}

void map__init(struct map *self, enum map_type type,
Expand Down

0 comments on commit 99c26fb

Please sign in to comment.