Commit ffb6a445 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml

Pull UML fixes from Richard Weinberger:
 "This update brings various fixes.
  Nothing special...

  In my local queue I have some more fixes which will be sent later to
  you.  3.9 uncovered strange UML issues.  :("

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
  um: Use tty_port in SIGWINCH handler
  um: Use tty_port_operations->destruct
  um: fix build failure due to mess-up of sig_info protorype
  um: add missing declaration of 'getrlimit()' and friends
  net : enable tx time stamping in the vde driver.
  hostfs: fix a not needed double check
parents 152fcb27 2116bda6
...@@ -37,7 +37,7 @@ extern int console_write_chan(struct chan *chan, const char *buf, ...@@ -37,7 +37,7 @@ extern int console_write_chan(struct chan *chan, const char *buf,
extern int console_open_chan(struct line *line, struct console *co); extern int console_open_chan(struct line *line, struct console *co);
extern void deactivate_chan(struct chan *chan, int irq); extern void deactivate_chan(struct chan *chan, int irq);
extern void reactivate_chan(struct chan *chan, int irq); extern void reactivate_chan(struct chan *chan, int irq);
extern void chan_enable_winch(struct chan *chan, struct tty_struct *tty); extern void chan_enable_winch(struct chan *chan, struct tty_port *port);
extern int enable_chan(struct line *line); extern int enable_chan(struct line *line);
extern void close_chan(struct line *line); extern void close_chan(struct line *line);
extern int chan_window_size(struct line *line, extern int chan_window_size(struct line *line,
......
...@@ -122,10 +122,10 @@ static int open_chan(struct list_head *chans) ...@@ -122,10 +122,10 @@ static int open_chan(struct list_head *chans)
return err; return err;
} }
void chan_enable_winch(struct chan *chan, struct tty_struct *tty) void chan_enable_winch(struct chan *chan, struct tty_port *port)
{ {
if (chan && chan->primary && chan->ops->winch) if (chan && chan->primary && chan->ops->winch)
register_winch(chan->fd, tty); register_winch(chan->fd, port);
} }
static void line_timer_cb(struct work_struct *work) static void line_timer_cb(struct work_struct *work)
......
...@@ -216,7 +216,7 @@ static int winch_thread(void *arg) ...@@ -216,7 +216,7 @@ static int winch_thread(void *arg)
} }
} }
static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out, static int winch_tramp(int fd, struct tty_port *port, int *fd_out,
unsigned long *stack_out) unsigned long *stack_out)
{ {
struct winch_data data; struct winch_data data;
...@@ -271,7 +271,7 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out, ...@@ -271,7 +271,7 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out,
return err; return err;
} }
void register_winch(int fd, struct tty_struct *tty) void register_winch(int fd, struct tty_port *port)
{ {
unsigned long stack; unsigned long stack;
int pid, thread, count, thread_fd = -1; int pid, thread, count, thread_fd = -1;
...@@ -281,17 +281,17 @@ void register_winch(int fd, struct tty_struct *tty) ...@@ -281,17 +281,17 @@ void register_winch(int fd, struct tty_struct *tty)
return; return;
pid = tcgetpgrp(fd); pid = tcgetpgrp(fd);
if (is_skas_winch(pid, fd, tty)) { if (is_skas_winch(pid, fd, port)) {
register_winch_irq(-1, fd, -1, tty, 0); register_winch_irq(-1, fd, -1, port, 0);
return; return;
} }
if (pid == -1) { if (pid == -1) {
thread = winch_tramp(fd, tty, &thread_fd, &stack); thread = winch_tramp(fd, port, &thread_fd, &stack);
if (thread < 0) if (thread < 0)
return; return;
register_winch_irq(thread_fd, fd, thread, tty, stack); register_winch_irq(thread_fd, fd, thread, port, stack);
count = write(thread_fd, &c, sizeof(c)); count = write(thread_fd, &c, sizeof(c));
if (count != sizeof(c)) if (count != sizeof(c))
......
...@@ -38,10 +38,10 @@ extern int generic_window_size(int fd, void *unused, unsigned short *rows_out, ...@@ -38,10 +38,10 @@ extern int generic_window_size(int fd, void *unused, unsigned short *rows_out,
unsigned short *cols_out); unsigned short *cols_out);
extern void generic_free(void *data); extern void generic_free(void *data);
struct tty_struct; struct tty_port;
extern void register_winch(int fd, struct tty_struct *tty); extern void register_winch(int fd, struct tty_port *port);
extern void register_winch_irq(int fd, int tty_fd, int pid, extern void register_winch_irq(int fd, int tty_fd, int pid,
struct tty_struct *tty, unsigned long stack); struct tty_port *port, unsigned long stack);
#define __channel_help(fn, prefix) \ #define __channel_help(fn, prefix) \
__uml_help(fn, prefix "[0-9]*=<channel description>\n" \ __uml_help(fn, prefix "[0-9]*=<channel description>\n" \
......
...@@ -305,7 +305,7 @@ static int line_activate(struct tty_port *port, struct tty_struct *tty) ...@@ -305,7 +305,7 @@ static int line_activate(struct tty_port *port, struct tty_struct *tty)
return ret; return ret;
if (!line->sigio) { if (!line->sigio) {
chan_enable_winch(line->chan_out, tty); chan_enable_winch(line->chan_out, port);
line->sigio = 1; line->sigio = 1;
} }
...@@ -315,8 +315,22 @@ static int line_activate(struct tty_port *port, struct tty_struct *tty) ...@@ -315,8 +315,22 @@ static int line_activate(struct tty_port *port, struct tty_struct *tty)
return 0; return 0;
} }
static void unregister_winch(struct tty_struct *tty);
static void line_destruct(struct tty_port *port)
{
struct tty_struct *tty = tty_port_tty_get(port);
struct line *line = tty->driver_data;
if (line->sigio) {
unregister_winch(tty);
line->sigio = 0;
}
}
static const struct tty_port_operations line_port_ops = { static const struct tty_port_operations line_port_ops = {
.activate = line_activate, .activate = line_activate,
.destruct = line_destruct,
}; };
int line_open(struct tty_struct *tty, struct file *filp) int line_open(struct tty_struct *tty, struct file *filp)
...@@ -340,18 +354,6 @@ int line_install(struct tty_driver *driver, struct tty_struct *tty, ...@@ -340,18 +354,6 @@ int line_install(struct tty_driver *driver, struct tty_struct *tty,
return 0; return 0;
} }
static void unregister_winch(struct tty_struct *tty);
void line_cleanup(struct tty_struct *tty)
{
struct line *line = tty->driver_data;
if (line->sigio) {
unregister_winch(tty);
line->sigio = 0;
}
}
void line_close(struct tty_struct *tty, struct file * filp) void line_close(struct tty_struct *tty, struct file * filp)
{ {
struct line *line = tty->driver_data; struct line *line = tty->driver_data;
...@@ -601,7 +603,7 @@ struct winch { ...@@ -601,7 +603,7 @@ struct winch {
int fd; int fd;
int tty_fd; int tty_fd;
int pid; int pid;
struct tty_struct *tty; struct tty_port *port;
unsigned long stack; unsigned long stack;
struct work_struct work; struct work_struct work;
}; };
...@@ -655,7 +657,7 @@ static irqreturn_t winch_interrupt(int irq, void *data) ...@@ -655,7 +657,7 @@ static irqreturn_t winch_interrupt(int irq, void *data)
goto out; goto out;
} }
} }
tty = winch->tty; tty = tty_port_tty_get(winch->port);
if (tty != NULL) { if (tty != NULL) {
line = tty->driver_data; line = tty->driver_data;
if (line != NULL) { if (line != NULL) {
...@@ -663,6 +665,7 @@ static irqreturn_t winch_interrupt(int irq, void *data) ...@@ -663,6 +665,7 @@ static irqreturn_t winch_interrupt(int irq, void *data)
&tty->winsize.ws_col); &tty->winsize.ws_col);
kill_pgrp(tty->pgrp, SIGWINCH, 1); kill_pgrp(tty->pgrp, SIGWINCH, 1);
} }
tty_kref_put(tty);
} }
out: out:
if (winch->fd != -1) if (winch->fd != -1)
...@@ -670,7 +673,7 @@ static irqreturn_t winch_interrupt(int irq, void *data) ...@@ -670,7 +673,7 @@ static irqreturn_t winch_interrupt(int irq, void *data)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
void register_winch_irq(int fd, int tty_fd, int pid, struct tty_struct *tty, void register_winch_irq(int fd, int tty_fd, int pid, struct tty_port *port,
unsigned long stack) unsigned long stack)
{ {
struct winch *winch; struct winch *winch;
...@@ -685,7 +688,7 @@ void register_winch_irq(int fd, int tty_fd, int pid, struct tty_struct *tty, ...@@ -685,7 +688,7 @@ void register_winch_irq(int fd, int tty_fd, int pid, struct tty_struct *tty,
.fd = fd, .fd = fd,
.tty_fd = tty_fd, .tty_fd = tty_fd,
.pid = pid, .pid = pid,
.tty = tty, .port = port,
.stack = stack }); .stack = stack });
if (um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt, if (um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt,
...@@ -714,15 +717,18 @@ static void unregister_winch(struct tty_struct *tty) ...@@ -714,15 +717,18 @@ static void unregister_winch(struct tty_struct *tty)
{ {
struct list_head *ele, *next; struct list_head *ele, *next;
struct winch *winch; struct winch *winch;
struct tty_struct *wtty;
spin_lock(&winch_handler_lock); spin_lock(&winch_handler_lock);
list_for_each_safe(ele, next, &winch_handlers) { list_for_each_safe(ele, next, &winch_handlers) {
winch = list_entry(ele, struct winch, list); winch = list_entry(ele, struct winch, list);
if (winch->tty == tty) { wtty = tty_port_tty_get(winch->port);
if (wtty == tty) {
free_winch(winch); free_winch(winch);
break; break;
} }
tty_kref_put(wtty);
} }
spin_unlock(&winch_handler_lock); spin_unlock(&winch_handler_lock);
} }
......
...@@ -218,6 +218,7 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -218,6 +218,7 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
spin_lock_irqsave(&lp->lock, flags); spin_lock_irqsave(&lp->lock, flags);
len = (*lp->write)(lp->fd, skb, lp); len = (*lp->write)(lp->fd, skb, lp);
skb_tx_timestamp(skb);
if (len == skb->len) { if (len == skb->len) {
dev->stats.tx_packets++; dev->stats.tx_packets++;
...@@ -281,6 +282,7 @@ static void uml_net_get_drvinfo(struct net_device *dev, ...@@ -281,6 +282,7 @@ static void uml_net_get_drvinfo(struct net_device *dev,
static const struct ethtool_ops uml_net_ethtool_ops = { static const struct ethtool_ops uml_net_ethtool_ops = {
.get_drvinfo = uml_net_get_drvinfo, .get_drvinfo = uml_net_get_drvinfo,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_ts_info = ethtool_op_get_ts_info,
}; };
static void uml_net_user_timer_expire(unsigned long _conn) static void uml_net_user_timer_expire(unsigned long _conn)
......
...@@ -105,7 +105,6 @@ static const struct tty_operations ssl_ops = { ...@@ -105,7 +105,6 @@ static const struct tty_operations ssl_ops = {
.throttle = line_throttle, .throttle = line_throttle,
.unthrottle = line_unthrottle, .unthrottle = line_unthrottle,
.install = ssl_install, .install = ssl_install,
.cleanup = line_cleanup,
.hangup = line_hangup, .hangup = line_hangup,
}; };
......
...@@ -110,7 +110,6 @@ static const struct tty_operations console_ops = { ...@@ -110,7 +110,6 @@ static const struct tty_operations console_ops = {
.set_termios = line_set_termios, .set_termios = line_set_termios,
.throttle = line_throttle, .throttle = line_throttle,
.unthrottle = line_unthrottle, .unthrottle = line_unthrottle,
.cleanup = line_cleanup,
.hangup = line_hangup, .hangup = line_hangup,
}; };
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include <sysdep/mcontext.h> #include <sysdep/mcontext.h>
#include "internal.h" #include "internal.h"
void (*sig_info[NSIG])(int, siginfo_t *, struct uml_pt_regs *) = { void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = {
[SIGTRAP] = relay_signal, [SIGTRAP] = relay_signal,
[SIGFPE] = relay_signal, [SIGFPE] = relay_signal,
[SIGILL] = relay_signal, [SIGILL] = relay_signal,
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include <init.h> #include <init.h>
#include <os.h> #include <os.h>
......
...@@ -845,15 +845,8 @@ int hostfs_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -845,15 +845,8 @@ int hostfs_setattr(struct dentry *dentry, struct iattr *attr)
return err; return err;
if ((attr->ia_valid & ATTR_SIZE) && if ((attr->ia_valid & ATTR_SIZE) &&
attr->ia_size != i_size_read(inode)) { attr->ia_size != i_size_read(inode))
int error;
error = inode_newsize_ok(inode, attr->ia_size);
if (error)
return error;
truncate_setsize(inode, attr->ia_size); truncate_setsize(inode, attr->ia_size);
}
setattr_copy(inode, attr); setattr_copy(inode, attr);
mark_inode_dirty(inode); mark_inode_dirty(inode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment