31 Mar, 2015

1 commit

  • Linux 3.19 commit 69c953c ("lib/lcm.c: lcm(n,0)=lcm(0,n) is 0, not n")
    caused blk_stack_limits() to not properly stack queue_limits for stacked
    devices (e.g. DM).

    Fix this regression by establishing lcm_not_zero() and switching
    blk_stack_limits() over to using it.

    DM uses blk_set_stacking_limits() to establish the initial top-level
    queue_limits that are then built up based on underlying devices' limits
    using blk_stack_limits(). In the case of optimal_io_size (io_opt)
    blk_set_stacking_limits() establishes a default value of 0. With commit
    69c953c, lcm(0, n) is no longer n, which compromises proper stacking of
    the underlying devices' io_opt.

    Test:
    $ modprobe scsi_debug dev_size_mb=10 num_tgts=1 opt_blks=1536
    $ cat /sys/block/sde/queue/optimal_io_size
    786432
    $ dmsetup create node --table "0 100 linear /dev/sde 0"

    Before this fix:
    $ cat /sys/block/dm-5/queue/optimal_io_size
    0

    After this fix:
    $ cat /sys/block/dm-5/queue/optimal_io_size
    786432

    Signed-off-by: Mike Snitzer
    Cc: stable@vger.kernel.org # 3.19+
    Acked-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Mike Snitzer
     

13 Feb, 2015

1 commit

  • We don't need all the stuff kernel.h pulls in; just compiler.h since
    export.h doesn't do necessary #includes. This removes more than 100
    dependencies.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     

11 Dec, 2014

2 commits


08 Mar, 2012

1 commit


26 Jul, 2011

1 commit

  • The symbol 'lcm' is exported to the kernel (EXPORT_SYMBOL_GPL).
    Pick up it's definition in to quiet the sparse noise:

    warning: symbol 'lcm' was not declared. Should it be static?

    Signed-off-by: H Hartley Sweeten
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    H Hartley Sweeten
     

15 Mar, 2010

1 commit

  • lcm() was defined to take integer-sized arguments. The supplied
    arguments are multiplied, however, causing us to overflow given
    sufficiently large input. That in turn led to incorrect optimal I/O
    size reporting in some cases (RAID over RAID).

    Switch lcm() over to unsigned long similar to gcd() and move the
    function from blk-settings.c to lib.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Martin K. Petersen