03 Nov, 2011

1 commit

  • * 'for-linus' of git://github.com/richardweinberger/linux: (90 commits)
    um: fix ubd cow size
    um: Fix kmalloc argument order in um/vdso/vma.c
    um: switch to use of drivers/Kconfig
    UserModeLinux-HOWTO.txt: fix a typo
    UserModeLinux-HOWTO.txt: remove ^H characters
    um: we need sys/user.h only on i386
    um: merge delay_{32,64}.c
    um: distribute exports to where exported stuff is defined
    um: kill system-um.h
    um: generic ftrace.h will do...
    um: segment.h is x86-only and needed only there
    um: asm/pda.h is not needed anymore
    um: hw_irq.h can go generic as well
    um: switch to generic-y
    um: clean Kconfig up a bit
    um: a couple of missing dependencies...
    um: kill useless argument of free_chan() and free_one_chan()
    um: unify ptrace_user.h
    um: unify KSTK_...
    um: fix gcov build breakage
    ...

    Linus Torvalds
     

02 Nov, 2011

9 commits


22 Sep, 2011

1 commit

  • Conflicts:
    MAINTAINERS
    drivers/net/Kconfig
    drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
    drivers/net/ethernet/broadcom/tg3.c
    drivers/net/wireless/iwlwifi/iwl-pci.c
    drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c
    drivers/net/wireless/rt2x00/rt2800usb.c
    drivers/net/wireless/wl12xx/main.c

    David S. Miller
     

15 Sep, 2011

4 commits

  • while not doing free_irq() from irq handler is commendable, kfree() on the
    data passed to said handler before free_irq() is Not Good(tm). Freeing
    the stack it's being run on is also not nice... Solution: delay actually
    freeing stuff.

    Signed-off-by: Al Viro
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • ... so set winch->fd to -1 before doing free_irq(), to avoid having
    winch_interrupt() come from/during the latter and attempt to do
    reactivate_fd() on something that's already gone.

    Signed-off-by: Al Viro
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • tty->count is decremented only after ->close() had been called and
    several tasks can hit it in parallel. As the result, using tty->count
    to check if you are the last one is broken. We end up leaving line->tty
    not reset to NULL and the next IRQ on that sucker will blow up trying to
    dereference pointers from kfree'd struct tty.

    Fix is obvious: we need to use a counter of our own.

    Signed-off-by: Al Viro
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • I could use out_close1, but that seems to be the code path to close the fd
    returned by os_create_unix_socket, and using it to close the fd returned
    by mkstemp might lead to some confusion, so I don't do it.

    Signed-off-by: Jonathan Neuschäfer
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonathan Neuschäfer
     

18 Aug, 2011

1 commit


26 Jul, 2011

6 commits


25 May, 2011

2 commits

  • The ucast transport is similar to the mcast transport (and, in fact,
    shares most of its code), only it uses UDP unicast to move packets.

    Obviously this is only useful for point-to-point connections between
    virtual ethernet devices.

    Signed-off-by: Nolan Leake
    Signed-off-by: Richard Weinberger
    Cc: David Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nolan Leake
     
  • UML_LIB_PATH is hardcoded to /usr/lib/uml/, on 64bit systems UML_LIB_PATH
    needs to be /usr/lib64/uml/.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     

26 Apr, 2011

1 commit


10 Apr, 2011

1 commit


23 Mar, 2011

1 commit

  • Commit 6caa76b ("tty: now phase out the ioctl file pointer for good")
    removed the ioctl file pointer. User Mode Linux's line driver uses this
    ioctl and needs a signature update too.

    Signed-off-by: Richard Weinberger
    Cc: Alan Cox
    Cc: Greg KH
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     

16 Mar, 2011

1 commit

  • …el/git/tip/linux-2.6-tip

    * 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    rtmutex: tester: Remove the remaining BKL leftovers
    lockdep/timers: Explain in detail the locking problems del_timer_sync() may cause
    rtmutex: Simplify PI algorithm and make highest prio task get lock
    rwsem: Remove redundant asmregparm annotation
    rwsem: Move duplicate function prototypes to linux/rwsem.h
    rwsem: Unify the duplicate rwsem_is_locked() inlines
    rwsem: Move duplicate init macros and functions to linux/rwsem.h
    rwsem: Move duplicate struct rwsem declaration to linux/rwsem.h
    x86: Cleanup rwsem_count_t typedef
    rwsem: Cleanup includes
    locking: Remove deprecated lock initializers
    cred: Replace deprecated spinlock initialization
    kthread: Replace deprecated spinlock initialization
    xtensa: Replace deprecated spinlock initialization
    um: Replace deprecated spinlock initialization
    sparc: Replace deprecated spinlock initialization
    mips: Replace deprecated spinlock initialization
    cris: Replace deprecated spinlock initialization
    alpha: Replace deprecated spinlock initialization
    rtmutex-tester: Remove BKL tests

    Linus Torvalds
     

14 Mar, 2011

1 commit

  • new function: file_open_root(dentry, mnt, name, flags) opens the file
    vfs_path_lookup would arrive to.

    Note that name can be empty; in that case the usual requirement that
    dentry should be a directory is lifted.

    open-coded equivalents switched to it, may_open() got down exactly
    one caller and became static.

    Signed-off-by: Al Viro

    Al Viro
     

27 Jan, 2011

1 commit


14 Jan, 2011

3 commits


25 Nov, 2010

1 commit

  • Disable the winch irq early to make sure we don't take an interrupt part
    way through the freeing of the handler data, resulting in a crash on
    shutdown:

    winch_interrupt : read failed, errno = 9
    fd 13 is losing SIGWINCH support
    ------------[ cut here ]------------
    WARNING: at lib/list_debug.c:48 list_del+0xc6/0x100()
    list_del corruption, next is LIST_POISON1 (00100100)
    082578c8: [] dump_stack+0x22/0x24
    082578e0: [] warn_slowpath_common+0x5a/0x80
    08257908: [] warn_slowpath_fmt+0x2e/0x30
    08257920: [] list_del+0xc6/0x100
    08257940: [] free_winch+0x14/0x80
    08257958: [] winch_interrupt+0xdb/0xe0
    08257978: [] handle_IRQ_event+0x35/0xe0
    08257998: [] handle_edge_irq+0xb7/0x170
    082579bc: [] do_IRQ+0x34/0x50
    082579d4: [] sigio_handler+0x5b/0x80
    082579ec: [] sig_handler_common+0x44/0xb0
    08257a68: [] sig_handler+0x38/0x50
    08257a78: [] handle_signal+0x5c/0xa0
    08257a9c: [] hard_handler+0x18/0x20
    08257aac: [] 0xc14400

    Signed-off-by: Will Newton
    Acked-by: WANG Cong
    Cc: Jeff Dike
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Will Newton
     

23 Oct, 2010

2 commits

  • * 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
    vfs: make no_llseek the default
    vfs: don't use BKL in default_llseek
    llseek: automatically add .llseek fop
    libfs: use generic_file_llseek for simple_attr
    mac80211: disallow seeks in minstrel debug code
    lirc: make chardev nonseekable
    viotape: use noop_llseek
    raw: use explicit llseek file operations
    ibmasmfs: use generic_file_llseek
    spufs: use llseek in all file operations
    arm/omap: use generic_file_llseek in iommu_debug
    lkdtm: use generic_file_llseek in debugfs
    net/wireless: use generic_file_llseek in debugfs
    drm: use noop_llseek

    Linus Torvalds
     
  • * 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
    BKL: introduce CONFIG_BKL.
    dabusb: remove the BKL
    sunrpc: remove the big kernel lock
    init/main.c: remove BKL notations
    blktrace: remove the big kernel lock
    rtmutex-tester: make it build without BKL
    dvb-core: kill the big kernel lock
    dvb/bt8xx: kill the big kernel lock
    tlclk: remove big kernel lock
    fix rawctl compat ioctls breakage on amd64 and itanic
    uml: kill big kernel lock
    parisc: remove big kernel lock
    cris: autoconvert trivial BKL users
    alpha: kill big kernel lock
    isapnp: BKL removal
    s390/block: kill the big kernel lock
    hpet: kill BKL, add compat_ioctl

    Linus Torvalds
     

19 Oct, 2010

1 commit

  • Three uml device drivers still use the big kernel lock,
    but all of them can be safely converted to using
    a per-driver mutex instead. Most likely this is not
    even necessary, so after further review these can
    and should be removed as well.

    The exec system call no longer requires the BKL either,
    so remove it from there, too.

    Signed-off-by: Arnd Bergmann
    Cc: Jeff Dike
    Cc: user-mode-linux-devel@lists.sourceforge.net

    Arnd Bergmann
     

16 Oct, 2010

1 commit

  • Fix a build error introduced by d6d1b650ae6acce73d55dd024 ("param: simple
    locking for sysfs-writable charp parameters").

    CC arch/um/kernel/trap.o
    arch/um/drivers/hostaudio_kern.c: In function 'hostaudio_open':
    arch/um/drivers/hostaudio_kern.c:204: error: '__param_dsp' undeclared (first use in this function)
    arch/um/drivers/hostaudio_kern.c:204: error: (Each undeclared identifier is reported only once
    arch/um/drivers/hostaudio_kern.c:204: error: for each function it appears in.)
    arch/um/drivers/hostaudio_kern.c: In function 'hostmixer_open_mixdev':
    arch/um/drivers/hostaudio_kern.c:265: error: '__param_mixer' undeclared (first use in this function)
    arch/um/drivers/hostaudio_kern.c:272: error: '__param_dsp' undeclared (first use in this function)

    Reported-by: Toralf Förster
    Tested-by: Toralf Förster
    Cc: Rusty Russell
    Cc: Takashi Iwai
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     

15 Oct, 2010

2 commits

  • All file_operations should get a .llseek operation so we can make
    nonseekable_open the default for future file operations without a
    .llseek pointer.

    The three cases that we can automatically detect are no_llseek, seq_lseek
    and default_llseek. For cases where we can we can automatically prove that
    the file offset is always ignored, we use noop_llseek, which maintains
    the current behavior of not returning an error from a seek.

    New drivers should normally not use noop_llseek but instead use no_llseek
    and call nonseekable_open at open time. Existing drivers can be converted
    to do the same when the maintainer knows for certain that no user code
    relies on calling seek on the device file.

    The generated code is often incorrectly indented and right now contains
    comments that clarify for each added line why a specific variant was
    chosen. In the version that gets submitted upstream, the comments will
    be gone and I will manually fix the indentation, because there does not
    seem to be a way to do that using coccinelle.

    Some amount of new code is currently sitting in linux-next that should get
    the same modifications, which I will do at the end of the merge window.

    Many thanks to Julia Lawall for helping me learn to write a semantic
    patch that does all this.

    ===== begin semantic patch =====
    // This adds an llseek= method to all file operations,
    // as a preparation for making no_llseek the default.
    //
    // The rules are
    // - use no_llseek explicitly if we do nonseekable_open
    // - use seq_lseek for sequential files
    // - use default_llseek if we know we access f_pos
    // - use noop_llseek if we know we don't access f_pos,
    // but we still want to allow users to call lseek
    //
    @ open1 exists @
    identifier nested_open;
    @@
    nested_open(...)
    {

    }

    @ open exists@
    identifier open_f;
    identifier i, f;
    identifier open1.nested_open;
    @@
    int open_f(struct inode *i, struct file *f)
    {

    }

    @ read disable optional_qualifier exists @
    identifier read_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    expression E;
    identifier func;
    @@
    ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
    {

    }

    @ read_no_fpos disable optional_qualifier exists @
    identifier read_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    @@
    ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
    {
    ... when != off
    }

    @ write @
    identifier write_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    expression E;
    identifier func;
    @@
    ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
    {

    }

    @ write_no_fpos @
    identifier write_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    @@
    ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
    {
    ... when != off
    }

    @ fops0 @
    identifier fops;
    @@
    struct file_operations fops = {
    ...
    };

    @ has_llseek depends on fops0 @
    identifier fops0.fops;
    identifier llseek_f;
    @@
    struct file_operations fops = {
    ...
    .llseek = llseek_f,
    ...
    };

    @ has_read depends on fops0 @
    identifier fops0.fops;
    identifier read_f;
    @@
    struct file_operations fops = {
    ...
    .read = read_f,
    ...
    };

    @ has_write depends on fops0 @
    identifier fops0.fops;
    identifier write_f;
    @@
    struct file_operations fops = {
    ...
    .write = write_f,
    ...
    };

    @ has_open depends on fops0 @
    identifier fops0.fops;
    identifier open_f;
    @@
    struct file_operations fops = {
    ...
    .open = open_f,
    ...
    };

    // use no_llseek if we call nonseekable_open
    ////////////////////////////////////////////
    @ nonseekable1 depends on !has_llseek && has_open @
    identifier fops0.fops;
    identifier nso ~= "nonseekable_open";
    @@
    struct file_operations fops = {
    ... .open = nso, ...
    +.llseek = no_llseek, /* nonseekable */
    };

    @ nonseekable2 depends on !has_llseek @
    identifier fops0.fops;
    identifier open.open_f;
    @@
    struct file_operations fops = {
    ... .open = open_f, ...
    +.llseek = no_llseek, /* open uses nonseekable */
    };

    // use seq_lseek for sequential files
    /////////////////////////////////////
    @ seq depends on !has_llseek @
    identifier fops0.fops;
    identifier sr ~= "seq_read";
    @@
    struct file_operations fops = {
    ... .read = sr, ...
    +.llseek = seq_lseek, /* we have seq_read */
    };

    // use default_llseek if there is a readdir
    ///////////////////////////////////////////
    @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier readdir_e;
    @@
    // any other fop is used that changes pos
    struct file_operations fops = {
    ... .readdir = readdir_e, ...
    +.llseek = default_llseek, /* readdir is present */
    };

    // use default_llseek if at least one of read/write touches f_pos
    /////////////////////////////////////////////////////////////////
    @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read.read_f;
    @@
    // read fops use offset
    struct file_operations fops = {
    ... .read = read_f, ...
    +.llseek = default_llseek, /* read accesses f_pos */
    };

    @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier write.write_f;
    @@
    // write fops use offset
    struct file_operations fops = {
    ... .write = write_f, ...
    + .llseek = default_llseek, /* write accesses f_pos */
    };

    // Use noop_llseek if neither read nor write accesses f_pos
    ///////////////////////////////////////////////////////////

    @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read_no_fpos.read_f;
    identifier write_no_fpos.write_f;
    @@
    // write fops use offset
    struct file_operations fops = {
    ...
    .write = write_f,
    .read = read_f,
    ...
    +.llseek = noop_llseek, /* read and write both use no f_pos */
    };

    @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier write_no_fpos.write_f;
    @@
    struct file_operations fops = {
    ... .write = write_f, ...
    +.llseek = noop_llseek, /* write uses no f_pos */
    };

    @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read_no_fpos.read_f;
    @@
    struct file_operations fops = {
    ... .read = read_f, ...
    +.llseek = noop_llseek, /* read uses no f_pos */
    };

    @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    @@
    struct file_operations fops = {
    ...
    +.llseek = noop_llseek, /* no read or write fn */
    };
    ===== End semantic patch =====

    Signed-off-by: Arnd Bergmann
    Cc: Julia Lawall
    Cc: Christoph Hellwig

    Arnd Bergmann
     
  • Commit f81f2f7c (ubd: drop unnecessary rq->sector manipulation)
    dropped request->sector manipulation in preparation for global request
    handling cleanup; unfortunately, it incorrectly assumed that the
    updated sector wasn't being used.

    ubd tries to issue as many requests as possible to io_thread. When
    issuing fails due to memory pressure or other reasons, the device is
    put on the restart list and issuing stops. On IO completion, devices
    on the restart list are scanned and IO issuing is restarted.

    ubd issues IOs sg-by-sg and issuing can be stopped in the middle of a
    request, so each device on the restart queue needs to remember where
    to restart in its current request. ubd needs to keep track of the
    issue position itself because,

    * blk_rq_pos(req) is now updated by the block layer to keep track of
    _completion_ position.

    * Multiple io_req's for the current request may be in flight, so it's
    difficult to tell where blk_rq_pos(req) currently is.

    Add ubd->rq_pos to keep track of the issue position and use it to
    correctly restart io_req issue.

    Signed-off-by: Tejun Heo
    Reported-by: Richard Weinberger
    Tested-by: Richard Weinberger
    Tested-by: Chris Frey
    Cc: stable@kernel.org
    Signed-off-by: Jens Axboe

    Tejun Heo