10 Oct, 2007

1 commit

  • As bi_end_io is only called once when the reqeust is complete,
    the 'size' argument is now redundant. Remove it.

    Now there is no need for bio_endio to subtract the size completed
    from bi_size. So don't do that either.

    While we are at it, change bi_end_io to return void.

    Signed-off-by: Neil Brown
    Signed-off-by: Jens Axboe

    NeilBrown
     

22 Jul, 2007

1 commit

  • Flush workqueue before releasing bioset and mopools in dm-crypt. There can
    be finished but not yet released request.

    Call chain causing oops:
    run workqueue
    dec_pending
    bio_endio(...);

    mempool_free(io, cc->io_pool);

    This usually happens when cryptsetup create temporary
    luks mapping in the beggining of crypt device activation.

    When dm-core calls destructor crypt_dtr, no new request
    are possible.

    Signed-off-by: Milan Broz
    Cc: Chuck Ebbert
    Cc: Patrick McHardy
    Acked-by: Alasdair G Kergon
    Cc: Christophe Saout
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Milan Broz
     

13 Jul, 2007

2 commits

  • This patch causes device-mapper to reject any barrier requests. This is done
    since most of the targets won't handle this correctly anyway. So until the
    situation improves it is better to reject these requests at the first place.
    Since barrier requests won't get to the targets, the checks there can be
    removed.

    Cc: stable@kernel.org
    Signed-off-by: Stefan Bader
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Linus Torvalds

    Stefan Bader
     
  • Use new KMEM_CACHE() macro and make the newly-exposed structure names more
    meaningful. Also remove some superfluous casts and inlines (let a modern
    compiler be the judge).

    Acked-by: Christoph Lameter
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Linus Torvalds

    Alasdair G Kergon
     

10 May, 2007

6 commits

  • 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
     
  • Disable barriers in dm-crypt because of current workqueue processing can
    reorder requests.

    This must be addresed later but for now disabling barriers is needed to
    prevent data corruption.

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

    Milan Broz
     

30 Apr, 2007

1 commit

  • Currently we scale the mempool sizes depending on memory installed
    in the machine, except for the bio pool itself which sits at a fixed
    256 entry pre-allocation.

    There's really no point in "optimizing" this OOM path, we just need
    enough preallocated to make progress. A single unit is enough, lets
    scale it down to 2 just to be on the safe side.

    This patch saves ~150kb of pinned kernel memory on a 32-bit box.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

09 Dec, 2006

2 commits

  • Update existing targets to use the new symbols for return values from target
    map and end_io functions.

    There is no effect on behaviour.

    Test results:
    Done build test without errors.

    Signed-off-by: Kiyoshi Ueda
    Signed-off-by: Jun'ichi Nomura
    Signed-off-by: Alasdair G Kergon
    Cc: dm-devel@redhat.com
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kiyoshi Ueda
     
  • This facility provides three entry points:

    ilog2() Log base 2 of unsigned long
    ilog2_u32() Log base 2 of u32
    ilog2_u64() Log base 2 of u64

    These facilities can either be used inside functions on dynamic data:

    int do_something(long q)
    {
    ...;
    y = ilog2(x)
    ...;
    }

    Or can be used to statically initialise global variables with constant values:

    unsigned n = ilog2(27);

    When performing static initialisation, the compiler will report "error:
    initializer element is not constant" if asked to take a log of zero or of
    something not reducible to a constant. They treat negative numbers as
    unsigned.

    When not dealing with a constant, they fall back to using fls() which permits
    them to use arch-specific log calculation instructions - such as BSR on
    x86/x86_64 or SCAN on FRV - if available.

    [akpm@osdl.org: MMC fix]
    Signed-off-by: David Howells
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Herbert Xu
    Cc: David Howells
    Cc: Wojtek Kaniewski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     

08 Dec, 2006

2 commits

  • * master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (48 commits)
    [NETFILTER]: Fix non-ANSI func. decl.
    [TG3]: Identify Serdes devices more clearly.
    [TG3]: Use msleep.
    [TG3]: Use netif_msg_*.
    [TG3]: Allow partial speed advertisement.
    [TG3]: Add TG3_FLG2_IS_NIC flag.
    [TG3]: Add 5787F device ID.
    [TG3]: Fix Phy loopback.
    [WANROUTER]: Kill kmalloc debugging code.
    [TCP] inet_twdr_hangman: Delete unnecessary memory barrier().
    [NET]: Memory barrier cleanups
    [IPSEC]: Fix inetpeer leak in ipv4 xfrm dst entries.
    audit: disable ipsec auditing when CONFIG_AUDITSYSCALL=n
    audit: Add auditing to ipsec
    [IRDA] irlan: Fix compile warning when CONFIG_PROC_FS=n
    [IrDA]: Incorrect TTP header reservation
    [IrDA]: PXA FIR code device model conversion
    [GENETLINK]: Fix misplaced command flags.
    [NETLIK]: Add a pointer to the Generic Netlink wiki page.
    [IPV6] RAW: Don't release unlocked sock.
    ...

    Linus Torvalds
     
  • Replace all uses of kmem_cache_t with struct kmem_cache.

    The patch was generated using the following script:

    #!/bin/sh
    #
    # Replace one string by another in all the kernel sources.
    #

    set -e

    for file in `find * -name "*.c" -o -name "*.h"|xargs grep -l $1`; do
    quilt add $file
    sed -e "1,\$s/$1/$2/g" $file >/tmp/$$
    mv /tmp/$$ $file
    quilt refresh
    done

    The script was run like this

    sh replace kmem_cache_t "struct kmem_cache"

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

07 Dec, 2006

3 commits


22 Nov, 2006

1 commit


31 Oct, 2006

1 commit

  • Fix dm-crypt after the block cipher API changes to correctly return the
    backwards compatible cipher-chainmode[-ivmode] format for "dmsetup
    table".

    Signed-off-by: Christophe Saout
    Cc: Alasdair G Kergon
    Cc: Herbert Xu
    Signed-off-by: Linus Torvalds

    diff linux-2.6.19-rc3.orig/drivers/md/dm-crypt.c linux-2.6.19-rc3/drivers/md/dm-crypt.c

    Christophe Saout
     

21 Oct, 2006

1 commit

  • Separate out the concept of "queue congestion" from "backing-dev congestion".
    Congestion is a backing-dev concept, not a queue concept.

    The blk_* congestion functions are retained, as wrappers around the core
    backing-dev congestion functions.

    This proper layering is needed so that NFS can cleanly use the congestion
    functions, and so that CONFIG_BLOCK=n actually links.

    Cc: "Thomas Maier"
    Cc: "Jens Axboe"
    Cc: Trond Myklebust
    Cc: David Howells
    Cc: Peter Osterlund
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

03 Oct, 2006

5 commits

  • In the low memory situation dm-crypt needs to use a private mempool of bios to
    avoid blocking.

    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 is designed to help dm-crypt comply with the
    new constraints imposed by the following patch in -mm:
    md-dm-reduce-stack-usage-with-stacked-block-devices.patch

    Under low memory the existing implementation relies upon waiting for I/O
    submitted recursively to generic_make_request() completing before the original
    generic_make_request() call can return.

    This patch moves the I/O submission to a workqueue so the original
    generic_make_request() can return immediately.

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

    Milan Broz
     
  • Restructure the dm-crypt write processing in preparation for workqueue changes
    in the next patches.

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

    Milan Broz
     
  • Restructure part of the dm-crypt code in preparation for workqueue changes.

    Use 'base_bio' or 'clone' variable names consistently throughout. No
    functional changes are included in this patch.

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

    Milan Broz
     
  • Add the facility to wipe the encryption key from memory (for example while a
    laptop is suspended) and reinstate it later (when the laptop gets resumed).

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

    Milan Broz
     

21 Sep, 2006

3 commits


27 Jun, 2006

1 commit


28 Mar, 2006

1 commit

  • We don't know what type sector_t has. Sometimes it's unsigned long, sometimes
    it's unsigned long long. For example on ppc64 it's unsigned long with
    CONFIG_LBD=n and on x86_64 it's unsigned long long with CONFIG_LBD=n.

    The way to handle all of this is to always use unsigned long long and to
    always typecast the sector_t when printing it.

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

    Andrew Morton
     

27 Mar, 2006

2 commits


15 Jan, 2006

1 commit


07 Jan, 2006

1 commit


30 Oct, 2005

1 commit


28 Oct, 2005

1 commit


09 Oct, 2005

1 commit

  • - added typedef unsigned int __nocast gfp_t;

    - replaced __nocast uses for gfp flags with gfp_t - it gives exactly
    the same warnings as far as sparse is concerned, doesn't change
    generated code (from gcc point of view we replaced unsigned int with
    typedef) and documents what's going on far better.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

02 Sep, 2005

1 commit


22 Jun, 2005

1 commit