10 May, 2007

40 commits

  • Since nonboot CPUs are now disabled after tasks and devices have been
    frozen and the CPU hotplug infrastructure is used for this purpose, we need
    special CPU hotplug notifications that will help the CPU-hotplug-aware
    subsystems distinguish normal CPU hotplug events from CPU hotplug events
    related to a system-wide suspend or resume operation in progress. This
    patch introduces such notifications and causes them to be used during
    suspend and resume transitions. It also changes all of the
    CPU-hotplug-aware subsystems to take these notifications into consideration
    (for now they are handled in the same way as the corresponding "normal"
    ones).

    [oleg@tv-sign.ru: cleanups]
    Signed-off-by: Rafael J. Wysocki
    Cc: Gautham R Shenoy
    Cc: Pavel Machek
    Signed-off-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     
  • It's very common for file systems to need to zero part or all of a page,
    the simplist way is just to use kmap_atomic() and memset(). There's
    actually a library function in include/linux/highmem.h that does exactly
    that, but it's confusingly named memclear_highpage_flush(), which is
    descriptive of *how* it does the work rather than what the *purpose* is.
    So this patchset renames the function to zero_user_page(), and calls it
    from the various places that currently open code it.

    This first patch introduces the new function call, and converts all the
    core kernel callsites, both the open-coded ones and the old
    memclear_highpage_flush() ones. Following this patch is a series of
    conversions for each file system individually, per AKPM, and finally a
    patch deprecating the old call. The diffstat below shows the entire
    patchset.

    [akpm@linux-foundation.org: fix a few things]
    Signed-off-by: Nate Diller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nate Diller
     
  • usbatm_do_heavy_init() calls allow_signal() which plays with parent process's
    ->sighand.

    Signed-off-by: Oleg Nesterov
    Acked-by: Duncan Sands
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • flush_work(wq, work) doesn't need the first parameter, we can use cwq->wq
    (this was possible from the very beginnig, I missed this). So we can unify
    flush_work_keventd and flush_work.

    Also, rename flush_work() to cancel_work_sync() and fix all callers.
    Perhaps this is not the best name, but "flush_work" is really bad.

    (akpm: this is why the earlier patches bypassed maintainers)

    Signed-off-by: Oleg Nesterov
    Cc: Jeff Garzik
    Cc: "David S. Miller"
    Cc: Jens Axboe
    Cc: Tejun Heo
    Cc: Auke Kok ,
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • (akpm: bypassed maintainers, sorry. There are other patches which depend on
    this)

    Cc: "Maciej W. Rozycki"
    Cc: David Howells
    Cc: Jeff Garzik
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • (akpm: bypassed maintainers, sorry. There are other patches which depend on
    this)

    Cc: "Maciej W. Rozycki"
    Cc: David Howells
    Cc: Jeff Garzik
    Cc: Oleg Nesterov
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Switch e1000 over to flush_work_keventd(). This probably fixes a netdev-close
    versus linkwatch rtnl_lock() deadlock which nobody knew about.

    (akpm: bypassed maintainers, sorry. There are other patches which depend on
    this)

    Cc: "Maciej W. Rozycki"
    Cc: David Howells
    Cc: "David S. Miller"
    Cc: Jeff Garzik
    Acked-by: Auke Kok
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Convert tg3 over to flush_work_keventd(). Remove nasty now-unneeded deadlock
    avoidance logic.

    (akpm: bypassed maintainers, sorry. There are other patches which depend on
    this)

    Cc: "Maciej W. Rozycki"
    Cc: David Howells
    Cc: "David S. Miller"
    Cc: Michael Chan
    Cc: Jeff Garzik
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Now that the cpu_is_xxx() macros are available both on AVR32 and AT91, we can
    remove a couple of #ifdefs from this driver. One of them is actually wrong --
    new_1 should be set on AVR32 but isn't. This causes the bus clock to run at
    twice the speed it is configured to.

    Signed-off-by: Haavard Skinnemoen
    Cc: David Brownell
    Acked-by: Andrew Victor
    Cc: Nicolas Ferre
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Haavard Skinnemoen
     
  • Fix tty_set_ldisc in tty_io.c so that tty->receive_room is only cleared if
    actually changing line disciplines.

    Without this fix a problem occurs when requesting the line discipline to
    change to the same line discipline. In this case tty->receive_room is
    cleared but ldisc->open() is not called to set tty->receive_room back to a
    sane value. The result is that tty->receive_room is stuck at 0 preventing
    the tty flip buffer from passing receive data to the line discipline.

    For example: a switch from N_TTY to N_TTY followed by a select() call for
    read input results in data never being received because tty->receive_room
    is stuck at zero.

    A switch from N_TTY to N_TTY followed by a read() call works because the
    read() call itself sets tty->receive_room correctly (but select does not).

    Previously (< 2.6.18) this was not a problem because the tty flip buffer
    pushed data to the line discipline without regard for tty->receive room.

    Signed-off-by: Paul Fulghum
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Fulghum
     
  • [akpm@linux-foundation.org: fix it]
    Signed-off-by: WANG Cong
    Cc: Paul Clements
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    WANG Cong
     
  • Driver for the on-chip hardware random number generator on PA Semi
    PA6T-1682M.

    Signed-off-by: Egor Martovetsky
    Signed-off-by: Olof Johansson
    Signed-off-by: Michael Buesch
    Cc: Paul Mackerras
    Cc: Kumar Gala
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olof Johansson
     
  • Cleanup using bitrev8 in cm4000_cs driver.

    Cc: Harald Welte
    Signed-off-by: Akinobu Mita
    Cc: Dominik Brodowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This patch fixes error paths in module_init and probe functions in cm4000_cs
    and cm4040_cs drivers.

    Cc: Harald Welte
    Signed-off-by: Akinobu Mita
    Cc: Dominik Brodowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • The MCA bus has a few "integrated" functions, which are effectively virtual
    slots on the bus. The problem is that these special functions don't have
    dedicated pos IDs, so we have to manufacture ids for them outside the pos
    space ... and these ids can't be matched by the standard matching function,
    so add a special registration that requests a list of pos ids or a particular
    integrated function.

    Signed-off-by: James Bottomley
    Signed-off-by: Linus Torvalds

    James Bottomley
     
  • There's a bug in the MCA bus matching algorithm in that it promotes from
    signed short to int before comparing with the actual id and does sign
    extension on anything > 0x7fff (which means that pos ids > 0x7fff never get
    correctly matched).

    Signed-off-by: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    James Bottomley
     
  • [ With Johannes Berg ]

    Separate the hibernation (aka suspend to disk code) from the other suspend
    code. In particular:

    * Remove the definitions related to hibernation from include/linux/pm.h
    * Introduce struct hibernation_ops and a new hibernate() function to hibernate
    the system, defined in include/linux/suspend.h
    * Separate suspend code in kernel/power/main.c from hibernation-related code
    in kernel/power/disk.c and kernel/power/user.c (with the help of
    hibernation_ops)
    * Switch ACPI (the only user of pm_ops.pm_disk_mode) to hibernation_ops

    Signed-off-by: Rafael J. Wysocki
    Cc: Greg KH
    Cc: Pavel Machek
    Cc: Nigel Cunningham
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     
  • This patch removes the possibility of having uninitialized log state if the
    log device has failed.

    When a mirror resumes operation, it calls 'resume' on the logging module. If
    disk based logging is being used, the log device is read to fill in the log
    state. If the log device has failed, we cannot simply return, because this
    would leave the in-memory log state uninitialized. Instead, we assume all
    regions are out-of-sync and reset the log state. Failure to do this could
    result in the logging code reporting a region as in-sync, even though it
    isn't; which could result in a corrupted mirror.

    Signed-off-by: Jonathan Brassow
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonathan Brassow
     
  • The call to rh_in_sync() in do_reads() should be allowed to block. It is in
    the mirror worker thread which already permits blocking operations. This will
    be needed to support clustered mirroring which will perform network
    operations.

    Signed-off-by: Jonathan Brassow
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonathan Brassow
     
  • With the code as it is, it is possible for oustanding clear region requests
    never to get flushed when a mirror is deactivated or suspended. This means
    there will always be some resync work required when a mirror is activated,
    even though it may very well be in-sync.

    Always requesting the flush doesn't hurt us. This is because the log tracks
    whether any changes occurred and, if not, no flush is performed.

    Signed-off-by: Jonathan Brassow
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonathan Brassow
     
  • New device-mapper target that can delay I/O (for testing). Reads can be
    separated from writes, redirected to different underlying devices and delayed
    by differing amounts of time.

    Signed-off-by: Heinz Mauelshagen
    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heinz Mauelshagen
     
  • More bio_list helper functions for new targets (including dm-delay and
    dm-loop) to manipulate lists of bios.

    Signed-off-by: Heinz Mauelshagen
    Signed-off-by: Bryn Reeves
    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heinz Mauelshagen
     
  • Remove old dm-io interface.

    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Milan Broz
     
  • This patch ports dm-raid1.c to the new dm-io interface.

    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Milan Broz
     
  • This patch ports dm-log.c to the new dm-io interface in order to make it
    scalable to have a large number of persistent dirty logs active in parallel.

    Signed-off-by: Heinz Mauelshagen
    Cc: Milan Broz
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heinz Mauelshagen
     
  • This patch ports dm-exception-store.c to the new, scalable dm_io() interface.

    It replaces dm_io_get()/dm_io_put() by
    dm_io_client_create()/dm_io_client_destroy() calls and
    dm_io_sync_vm() by dm_io() to achive this.

    Signed-off-by: Heinz Mauelshagen
    Cc: Milan Broz
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heinz Mauelshagen
     
  • This patch ports kcopyd.c to the new, scalable dm_io() interface.

    Signed-off-by: Milan Broz
    Signed-off-by: Heinz Mauelshagen
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Milan Broz
     
  • Add a new API to dm-io.c that uses a private mempool and bio_set for each
    client.

    The new functions to use are dm_io_client_create(), dm_io_client_destroy(),
    dm_io_client_resize() and dm_io().

    Signed-off-by: Heinz Mauelshagen
    Signed-off-by: Alasdair G Kergon
    Cc: Milan Broz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heinz Mauelshagen
     
  • Introduce struct dm_io_client to prepare for per-client mempools and bio_sets.

    Temporary functions bios() and io_pool() choose between the per-client
    structures and the global ones so the old and new interfaces can co-exist.

    Make error_bits optional.

    Signed-off-by: Heinz Mauelshagen
    Signed-off-by: Alasdair G Kergon
    Cc: Milan Broz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heinz Mauelshagen
     
  • Delay decrementing the 'struct io' reference count until after the bio has
    been freed so that a bio destructor function may reference it. Required by a
    later patch.

    Signed-off-by: Heinz Mauelshagen
    Signed-off-by: Alasdair G Kergon
    Cc: Milan Broz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heinz Mauelshagen
     
  • This patch adds the ability to specify desired features in the mirror
    constructor/mapping table.

    The first feature of interest is "handle_errors". Currently, mirroring will
    ignore any I/O errors from the devices. Subsequent patches will check for
    this flag and handle the errors. If flag/feature is not present, mirror will
    do nothing - maintaining backwards compatibility.

    Signed-off-by: Jonathan E Brassow
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonathan E Brassow
     
  • This patch reports the status of the log device so that userspace can detect
    the error and take appropriate action.

    Signed-off-by: Jonathan E Brassow
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonathan E Brassow
     
  • This patch gives the disk logging code the ability to store the fact that an
    error occured on the log device. In addition, an event is raised when an
    error is encountered during I/O to the log device.

    Signed-off-by: Jonathan E Brassow
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonathan E Brassow
     
  • Allow check_device_area to succeed if a device has an i_size of zero. This
    addresses an issue seen on DASD devices setting up a multipath table for paths
    in online and offline state.

    Signed-off-by: Mike Anderson
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Anderson
     
  • Make the mapped device structure accessible to hardware handlers so error
    messages can include the device name.

    Signed-off-by: Edward Goggin
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Edward Goggin
     
  • Add a new IV generation method 'null' to read old filesystem images created
    with SuSE's loop_fish2 module.

    Signed-off-by: Ludwig Nussel
    Acked-By: Christophe Saout
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ludwig Nussel
     
  • Allocate smaller clones

    With the previous dm-crypt fixes, there is no need for the clone bios to have
    the same bvec size as the original - we just need to make them big enough for
    the remaining number of pages. The only requirement is that we clear the
    "out" index in convert_context, so that crypt_convert starts storing data at
    the right position within the clone bio.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Alasdair G Kergon
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • Get rid of first_clone in dm-crypt

    This gets rid of first_clone, which is not really needed. Apparently, cloned
    bios used to share their bvec some time way in the past - this is no longer
    the case. Contrarily, this even hurts us if we try to create a clone off
    first_clone after it has completed, and crypt_endio has destroyed its bvec.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Alasdair G Kergon
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • Do not access the bio after generic_make_request

    We should never access a bio after generic_make_request - there's no guarantee
    it still exists.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Alasdair G Kergon
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • Call clone_init early

    We need to call clone_init as early as possible - at least before call
    bio_put(clone) in any error path. Otherwise, the destructor will try to
    dereference bi_private, which may still be NULL.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch