21 Sep, 2011

1 commit

  • When no floppy is found the module code can be released while a timer
    function is pending or about to be executed.

    CPU0 CPU1
    floppy_init()
    timer_softirq()
    spin_lock_irq(&base->lock);
    detach_timer();
    spin_unlock_irq(&base->lock);
    -> Interrupt
    del_timer();
    return -ENODEV;
    module_cleanup();

    Signed-off-by: Thomas Gleixner
    Cc: Jens Axboe
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Jens Axboe

    Carsten Emde
     

23 Aug, 2011

1 commit


22 Aug, 2011

2 commits

  • This patch fixes belows:

    1. Fix code style issue.
    2. Fix incorrect functions name in comments.

    Signed-off-by: Joe Jin
    Cc: Jens Axboe
    Cc: Ian Campbell
    Signed-off-by: Konrad Rzeszutek Wilk

    Joe Jin
     
  • When do block-attach/block-detach test with below steps, umount hangs
    in the guest. Furthermore shutdown ends up being stuck when umounting file-systems.

    1. start guest.
    2. attach new block device by xm block-attach in Dom0.
    3. mount new disk in guest.
    4. execute xm block-detach to detach the block device in dom0 until timeout
    5. Any request to the disk will hung.

    Root cause:
    This issue is caused when setting backend device's state to
    'XenbusStateClosing', which sends to the frontend the XenbusStateClosing
    notification. When frontend receives the notification it tries to release
    the disk in blkfront_closing(), but at that moment the disk is still in use
    by guest, so frontend refuses to close. Specifically it sets the disk state to
    XenbusStateClosing and sends the notification to backend - when backend receives the
    event, it disconnects the vbd from real device, and sets the vbd device state to
    XenbusStateClosing. The backend disconnects the real device/file, and any IO
    requests to the disk in guest will end up in ether, leaving disk DEAD and set to
    XenbusStateClosing. When the guest wants to disconnect the disk, umount will
    hang on blkif_release()->xlvbd_release_gendisk() as it is unable to send any IO
    to the disk, which prevents clean system shutdown.

    Solution:
    Don't disconnect backend until frontend state switched to XenbusStateClosed.

    Signed-off-by: Joe Jin
    Cc: Daniel Stodden
    Cc: Jens Axboe
    Cc: Annie Li
    Cc: Ian Campbell
    [v1: Modified description a bit]
    Signed-off-by: Konrad Rzeszutek Wilk

    Joe Jin
     

10 Aug, 2011

1 commit


09 Aug, 2011

1 commit


03 Aug, 2011

1 commit


02 Aug, 2011

1 commit


01 Aug, 2011

4 commits

  • LOOP_CLR_FD takes lo->lo_ctl_mutex and tries to remove the loop sysfs
    files. Sysfs calls show() and waits for lo->lo_ctl_mutex. LOOP_CLR_FD
    waits for show() to finish to remove the sysfs file.

    cat /sys/class/block/loop0/loop/backing_file
    mutex_lock_nested+0x176/0x350
    ? loop_attr_do_show_backing_file+0x2f/0xd0 [loop]
    ? loop_attr_do_show_backing_file+0x2f/0xd0 [loop]
    loop_attr_do_show_backing_file+0x2f/0xd0 [loop]
    dev_attr_show+0x1b/0x60
    ? sysfs_read_file+0x86/0x1a0
    ? __get_free_pages+0x12/0x50
    sysfs_read_file+0xaf/0x1a0

    ioctl(LOOP_CLR_FD):
    wait_for_common+0x12c/0x180
    ? try_to_wake_up+0x2a0/0x2a0
    wait_for_completion+0x18/0x20
    sysfs_deactivate+0x178/0x180
    ? sysfs_addrm_finish+0x43/0x70
    ? sysfs_addrm_start+0x1d/0x20
    sysfs_addrm_finish+0x43/0x70
    sysfs_hash_and_remove+0x85/0xa0
    sysfs_remove_group+0x59/0x100
    loop_clr_fd+0x1dc/0x3f0 [loop]
    lo_ioctl+0x223/0x7a0 [loop]

    Instead of taking the lo_ctl_mutex from sysfs code, take the inner
    lo->lo_lock, to protect the access to the backing_file data.

    Thanks to Tejun for help debugging and finding a solution.

    Cc: Milan Broz
    Cc: Tejun Heo
    Signed-off-by: Kay Sievers
    Cc: stable@kernel.org
    Signed-off-by: Jens Axboe

    Kay Sievers
     
  • Instead of unconditionally creating a fixed number of dead loop
    devices which need to be investigated by storage handling services,
    even when they are never used, we allow distros start with 0
    loop devices and have losetup(8) and similar switch to the dynamic
    /dev/loop-control interface instead of searching /dev/loop%i for free
    devices.

    Signed-off-by: Kay Sievers
    Signed-off-by: Jens Axboe

    Kay Sievers
     
  • Loop devices today have a fixed pre-allocated number of usually 8.
    The number can only be changed at module init time. To find a free
    device to use, /dev/loop%i needs to be scanned, and all devices need
    to be opened until a free one is possibly found.

    This adds a new /dev/loop-control device node, that allows to
    dynamically find or allocate a free device, and to add and remove loop
    devices from the running system:
    LOOP_CTL_ADD adds a specific device. Arg is the number
    of the device. It returns the device i or a negative
    error code.

    LOOP_CTL_REMOVE removes a specific device, Arg is the
    number the device. It returns the device i or a negative
    error code.

    LOOP_CTL_GET_FREE finds the next unbound device or allocates
    a new one. No arg is given. It returns the device i or a
    negative error code.

    The loop kernel module gets automatically loaded when
    /dev/loop-control is accessed the first time. The alias
    specified in the module, instructs udev to create this
    'dead' device node, even when the module is not loaded.

    Example:
    cfd = open("/dev/loop-control", O_RDWR);

    # add a new specific loop device
    err = ioctl(cfd, LOOP_CTL_ADD, devnr);

    # remove a specific loop device
    err = ioctl(cfd, LOOP_CTL_REMOVE, devnr);

    # find or allocate a free loop device to use
    devnr = ioctl(cfd, LOOP_CTL_GET_FREE);

    sprintf(loopname, "/dev/loop%i", devnr);
    ffd = open("backing-file", O_RDWR);
    lfd = open(loopname, O_RDWR);
    err = ioctl(lfd, LOOP_SET_FD, ffd);

    Cc: Tejun Heo
    Cc: Karel Zak
    Signed-off-by: Kay Sievers
    Signed-off-by: Jens Axboe

    Kay Sievers
     
  • Replace the linked list, that keeps track of allocated devices, with an
    idr index to allow a more efficient lookup of devices.

    Cc: Tejun Heo
    Signed-off-by: Kay Sievers
    Signed-off-by: Jens Axboe

    Kay Sievers
     

27 Jul, 2011

4 commits

  • This allows us to move duplicated code in
    (atomic_inc_not_zero() for now) to

    Signed-off-by: Arun Sharma
    Reviewed-by: Eric Dumazet
    Cc: Ingo Molnar
    Cc: David Miller
    Cc: Eric Dumazet
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun Sharma
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (23 commits)
    ceph: document unlocked d_parent accesses
    ceph: explicitly reference rename old_dentry parent dir in request
    ceph: document locking for ceph_set_dentry_offset
    ceph: avoid d_parent in ceph_dentry_hash; fix ceph_encode_fh() hashing bug
    ceph: protect d_parent access in ceph_d_revalidate
    ceph: protect access to d_parent
    ceph: handle racing calls to ceph_init_dentry
    ceph: set dir complete frag after adding capability
    rbd: set blk_queue request sizes to object size
    ceph: set up readahead size when rsize is not passed
    rbd: cancel watch request when releasing the device
    ceph: ignore lease mask
    ceph: fix ceph_lookup_open intent usage
    ceph: only link open operations to directory unsafe list if O_CREAT|O_TRUNC
    ceph: fix bad parent_inode calc in ceph_lookup_open
    ceph: avoid carrying Fw cap during write into page cache
    libceph: don't time out osd requests that haven't been received
    ceph: report f_bfree based on kb_avail rather than diffing.
    ceph: only queue capsnap if caps are dirty
    ceph: fix snap writeback when racing with writes
    ...

    Linus Torvalds
     
  • This improves performance since more requests can be merged.

    Reviewed-by: Yehuda Sadeh
    Signed-off-by: Josh Durgin

    Josh Durgin
     
  • We were missing this cleanup, so when a device was released
    the osd didn't clean up its watchers list, so following notifications
    could be slow as osd needed to timeout on the client.

    Signed-off-by: Yehuda Sadeh

    Yehuda Sadeh
     

26 Jul, 2011

1 commit

  • * 'for-3.1/drivers' of git://git.kernel.dk/linux-block:
    cciss: do not attempt to read from a write-only register
    xen/blkback: Add module alias for autoloading
    xen/blkback: Don't let in-flight requests defer pending ones.
    bsg: fix address space warning from sparse
    bsg: remove unnecessary conditional expressions
    bsg: fix bsg_poll() to return POLLOUT properly

    Linus Torvalds
     

23 Jul, 2011

4 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (107 commits)
    vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp
    isofs: Remove global fs lock
    jffs2: fix IN_DELETE_SELF on overwriting rename() killing a directory
    fix IN_DELETE_SELF on overwriting rename() on ramfs et.al.
    mm/truncate.c: fix build for CONFIG_BLOCK not enabled
    fs:update the NOTE of the file_operations structure
    Remove dead code in dget_parent()
    AFS: Fix silly characters in a comment
    switch d_add_ci() to d_splice_alias() in "found negative" case as well
    simplify gfs2_lookup()
    jfs_lookup(): don't bother with . or ..
    get rid of useless dget_parent() in btrfs rename() and link()
    get rid of useless dget_parent() in fs/btrfs/ioctl.c
    fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
    drivers: fix up various ->llseek() implementations
    fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek
    Ext4: handle SEEK_HOLE/SEEK_DATA generically
    Btrfs: implement our own ->llseek
    fs: add SEEK_HOLE and SEEK_DATA flags
    reiserfs: make reiserfs default to barrier=flush
    ...

    Fix up trivial conflicts in fs/xfs/linux-2.6/xfs_super.c due to the new
    shrinker callout for the inode cache, that clashed with the xfs code to
    start the periodic workers later.

    Linus Torvalds
     
  • …rnel/git/tip/linux-2.6-tip

    * 'timers-cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    mips: Fix i8253 clockevent fallout
    i8253: Cleanup outb/inb magic
    arm: Footbridge: Use common i8253 clockevent
    mips: Use common i8253 clockevent
    x86: Use common i8253 clockevent
    i8253: Create common clockevent implementation
    i8253: Export i8253_lock unconditionally
    pcpskr: MIPS: Make config dependencies finer grained
    pcspkr: Cleanup Kconfig dependencies
    i8253: Move remaining content and delete asm/i8253.h
    i8253: Consolidate definitions of PIT_LATCH
    x86: i8253: Consolidate definitions of global_clock_event
    i8253: Alpha, PowerPC: Remove unused asm/8253pit.h
    alpha: i8253: Cleanup remaining users of i8253pit.h
    i8253: Remove I8253_LOCK config
    i8253: Make pcsp sound driver use the shared i8253_lock
    i8253: Make pcspkr input driver use the shared i8253_lock
    i8253: Consolidate all kernel definitions of i8253_lock
    i8253: Unify all kernel declarations of i8253_lock
    i8253: Create linux/i8253.h and use it in all 8253 related files

    Linus Torvalds
     
  • * 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6:
    dt: include linux/errno.h in linux/of_address.h
    of/address: Add of_find_matching_node_by_address helper
    dt: remove extra xsysace platform_driver registration
    tty/serial: Add devicetree support for nVidia Tegra serial ports
    dt: add empty of_property_read_u32[_array] for non-dt
    dt: bindings: move SEC node under new crypto/
    dt: add helper function to read u32 arrays
    tty/serial: change of_serial to use new of_property_read_u32() api
    dt: add 'const' for of_property_read_string parameter **out_string
    dt: add helper functions to read u32 and string property values
    tty: of_serial: support for 32 bit accesses
    dt: document the of_serial bindings
    dt/platform: allow device name to be overridden
    drivers/amba: create devices from device tree
    dt: add of_platform_populate() for creating device from the device tree
    dt: Add default match table for bus ids

    Linus Torvalds
     
  • * 'stable/drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
    xen/pciback: Have 'passthrough' option instead of XEN_PCIDEV_BACKEND_PASS and XEN_PCIDEV_BACKEND_VPCI
    xen/pciback: Remove the DEBUG option.
    xen/pciback: Drop two backends, squash and cleanup some code.
    xen/pciback: Print out the MSI/MSI-X (PIRQ) values
    xen/pciback: Don't setup an fake IRQ handler for SR-IOV devices.
    xen: rename pciback module to xen-pciback.
    xen/pciback: Fine-grain the spinlocks and fix BUG: scheduling while atomic cases.
    xen/pciback: Allocate IRQ handler for device that is shared with guest.
    xen/pciback: Disable MSI/MSI-X when reseting a device
    xen/pciback: guest SR-IOV support for PV guest
    xen/pciback: Register the owner (domain) of the PCI device.
    xen/pciback: Cleanup the driver based on checkpatch warnings and errors.
    xen/pciback: xen pci backend driver.
    xen: tmem: self-ballooning and frontswap-selfshrinking
    xen: Add module alias to autoload backend drivers
    xen: Populate xenbus device attributes
    xen: Add __attribute__((format(printf... where appropriate
    xen: prepare tmem shim to handle frontswap
    xen: allow enable use of VGA console on dom0

    Linus Torvalds
     

20 Jul, 2011

1 commit


16 Jul, 2011

1 commit


15 Jul, 2011

2 commits


14 Jul, 2011

1 commit

  • After commit 1c48a5c93, "dt: Eliminate
    of_platform_{,un}register_driver", the xsysace driver attempts to
    register two platform_drivers with the same name, which a) doesn't
    work, and b) isn't necessary. This patch merges the two
    platform_drivers.

    Reported-by: Daniel Hellstrom
    Signed-off-by: Grant Likely

    Grant Likely
     

09 Jul, 2011

1 commit


01 Jul, 2011

3 commits


30 Jun, 2011

7 commits


09 Jun, 2011

1 commit

  • Signed-off-by: Ralf Baechle
    Cc: linux-mips@linux-mips.org
    Link: http://lkml.kernel.org/r/20110601180610.054254048@duck.linux-mips.net
    Signed-off-by: Thomas Gleixner

    arch/arm/mach-footbridge/isa-timer.c | 2 +-
    arch/mips/cobalt/time.c | 2 +-
    arch/mips/jazz/irq.c | 2 +-
    arch/mips/kernel/i8253.c | 2 +-
    arch/mips/mti-malta/malta-time.c | 2 +-
    arch/mips/sgi-ip22/ip22-time.c | 2 +-
    arch/mips/sni/time.c | 2 +-
    arch/x86/kernel/apic/apic.c | 2 +-
    arch/x86/kernel/apm_32.c | 2 +-
    arch/x86/kernel/hpet.c | 2 +-
    arch/x86/kernel/i8253.c | 2 +-
    arch/x86/kernel/time.c | 2 +-
    drivers/block/hd.c | 2 +-
    drivers/clocksource/i8253.c | 2 +-
    drivers/input/gameport/gameport.c | 2 +-
    drivers/input/joystick/analog.c | 2 +-
    drivers/input/misc/pcspkr.c | 2 +-
    include/linux/i8253.h | 11 +++++++++++
    sound/drivers/pcsp/pcsp.h | 2 +-
    19 files changed, 29 insertions(+), 18 deletions(-)

    Ralf Baechle
     

04 Jun, 2011

1 commit

  • * 'for-linus' of git://git.kernel.dk/linux-block:
    block: Use hlist_entry() for io_context.cic_list.first
    cfq-iosched: Remove bogus check in queue_fail path
    xen/blkback: potential null dereference in error handling
    xen/blkback: don't call vbd_size() if bd_disk is NULL
    block: blkdev_get() should access ->bd_disk only after success
    CFQ: Fix typo and remove unnecessary semicolon
    block: remove unwanted semicolons
    Revert "block: Remove extra discard_alignment from hd_struct."
    nbd: adjust 'max_part' according to part_shift
    nbd: limit module parameters to a sane value
    nbd: pass MSG_* flags to kernel_recvmsg()
    block: improve the bio_add_page() and bio_add_pc_page() descriptions

    Linus Torvalds
     

02 Jun, 2011

1 commit

  • Jens' back-merge commit 698567f3fa79 ("Merge commit 'v2.6.39' into
    for-2.6.40/core") was incorrectly done, and re-introduced the
    DISK_EVENT_MEDIA_CHANGE lines that had been removed earlier in commits

    - 9fd097b14918 ("block: unexport DISK_EVENT_MEDIA_CHANGE for
    legacy/fringe drivers")

    - 7eec77a1816a ("ide: unexport DISK_EVENT_MEDIA_CHANGE for ide-gd
    and ide-cd")

    because of conflicts with the "g->flags" updates near-by by commit
    d4dc210f69bc ("block: don't block events on excl write for non-optical
    devices")

    As a result, we re-introduced the hanging behavior due to infinite disk
    media change reports.

    Tssk, tssk, people! Don't do back-merges at all, and *definitely* don't
    do them to hide merge conflicts from me - especially as I'm likely
    better at merging them than you are, since I do so many merges.

    Reported-by: Steven Rostedt
    Cc: Jens Axboe
    Signed-off-by: Linus Torvalds

    Linus Torvalds