01 Nov, 2011

1 commit

  • Standardize the style for compiler based printf format verification.
    Standardized the location of __printf too.

    Done via script and a little typing.

    $ grep -rPl --include=*.[ch] -w "__attribute__" * | \
    grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
    xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'

    [akpm@linux-foundation.org: revert arch bits]
    Signed-off-by: Joe Perches
    Cc: "Kirill A. Shutemov"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     

01 Jul, 2011

1 commit


13 Jun, 2011

1 commit


30 May, 2011

1 commit

  • It was not a good idea to start dereferencing disk->queue from
    the fs sysfs strategy for displaying discard alignment. We ran
    into first a NULL pointer deref, and after fixing that we sometimes
    see unvalid disk->queue pointer values.

    Since discard is the only one of the bunch actually looking into
    the queue, just revert the change.

    This reverts commit 23ceb5b7719e9276d4fa72a3ecf94dd396755276.

    Conflicts:
    fs/partitions/check.c

    Jens Axboe
     

28 May, 2011

1 commit

  • * 'for-linus' of git://git.kernel.dk/linux-2.6-block:
    loop: export module parameters
    block: export blk_{get,put}_queue()
    block: remove unused variable in bio_attempt_front_merge()
    block: always allocate genhd->ev if check_events is implemented
    brd: export module parameters
    brd: fix comment on initial device creation
    brd: handle on-demand devices correctly
    brd: limit 'max_part' module param to DISK_MAX_PARTS
    brd: get rid of unused members from struct brd_device
    block: fix oops on !disk->queue and sysfs discard alignment display

    Linus Torvalds
     

27 May, 2011

2 commits

  • The kernel automatically evaluates partition tables of storage devices.
    The code for evaluating GUID partitions (in fs/partitions/efi.c) contains
    a bug that causes a kernel oops on certain corrupted GUID partition
    tables.

    This bug has security impacts, because it allows, for example, to
    prepare a storage device that crashes a kernel subsystem upon connecting
    the device (e.g., a "USB Stick of (Partial) Death").

    crc = efi_crc32((const unsigned char *) (*gpt), le32_to_cpu((*gpt)->header_size));

    computes a CRC32 checksum over gpt covering (*gpt)->header_size bytes.
    There is no validation of (*gpt)->header_size before the efi_crc32 call.

    A corrupted partition table may have large values for (*gpt)->header_size.
    In this case, the CRC32 computation access memory beyond the memory
    allocated for gpt, which may cause a kernel heap overflow.

    Validate value of GUID partition table header size.

    [akpm@linux-foundation.org: fix layout and indenting]
    Signed-off-by: Timo Warns
    Cc: Matt Domsch
    Cc: Eugene Teo
    Cc: Dave Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Timo Warns
     
  • Eric Dumazet reports:

    ----

    At boot, I have a crash in part_discard_alignment_show+0x1b/0x50

    CR2 : 000006ac

    fault in : mov 0x2c(%rcx),%edx

    I suspect commit 23ceb5b7719e9276d4 (block: Remove extra
    discard_alignment from hd_struct) being in fault

    ----

    Not quite known how ->queue can be NULL while the sysfs entry
    exists, but lets play it safe and check for a NULL queue.
    The rest of the sysfs show strategies in check.c do not dereference
    disk->queue.

    Reported-by: Eric Dumazet
    Signed-off-by: Jens Axboe

    Jens Axboe
     

26 May, 2011

1 commit

  • * 'for-2.6.40/core' of git://git.kernel.dk/linux-2.6-block: (40 commits)
    cfq-iosched: free cic_index if cfqd allocation fails
    cfq-iosched: remove unused 'group_changed' in cfq_service_tree_add()
    cfq-iosched: reduce bit operations in cfq_choose_req()
    cfq-iosched: algebraic simplification in cfq_prio_to_maxrq()
    blk-cgroup: Initialize ioc->cgroup_changed at ioc creation time
    block: move bd_set_size() above rescan_partitions() in __blkdev_get()
    block: call elv_bio_merged() when merged
    cfq-iosched: Make IO merge related stats per cpu
    cfq-iosched: Fix a memory leak of per cpu stats for root group
    backing-dev: Kill set but not used var in bdi_debug_stats_show()
    block: get rid of on-stack plugging debug checks
    blk-throttle: Make no throttling rule group processing lockless
    blk-cgroup: Make cgroup stat reset path blkg->lock free for dispatch stats
    blk-cgroup: Make 64bit per cpu stats safe on 32bit arch
    blk-throttle: Make dispatch stats per cpu
    blk-throttle: Free up a group only after one rcu grace period
    blk-throttle: Use helper function to add root throtl group to lists
    blk-throttle: Introduce a helper function to fill in device details
    blk-throttle: Dynamically allocate root group
    blk-cgroup: Allow sleeping while dynamically allocating a group
    ...

    Linus Torvalds
     

24 May, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    b43: fix comment typo reqest -> request
    Haavard Skinnemoen has left Atmel
    cris: typo in mach-fs Makefile
    Kconfig: fix copy/paste-ism for dell-wmi-aio driver
    doc: timers-howto: fix a typo ("unsgined")
    perf: Only include annotate.h once in tools/perf/util/ui/browsers/annotate.c
    md, raid5: Fix spelling error in comment ('Ofcourse' --> 'Of course').
    treewide: fix a few typos in comments
    regulator: change debug statement be consistent with the style of the rest
    Revert "arm: mach-u300/gpio: Fix mem_region resource size miscalculations"
    audit: acquire creds selectively to reduce atomic op overhead
    rtlwifi: don't touch with treewide double semicolon removal
    treewide: cleanup continuations and remove logging message whitespace
    ath9k_hw: don't touch with treewide double semicolon removal
    include/linux/leds-regulator.h: fix syntax in example code
    tty: fix typo in descripton of tty_termios_encode_baud_rate
    xtensa: remove obsolete BKL kernel option from defconfig
    m68k: fix comment typo 'occcured'
    arch:Kconfig.locks Remove unused config option.
    treewide: remove extra semicolons
    ...

    Linus Torvalds
     

21 May, 2011

2 commits

  • As Ben Hutchings discovered [1], the patch for CVE-2011-1017 (buffer
    overflow in ldm_frag_add) is not sufficient. The original patch in
    commit c340b1d64000 ("fs/partitions/ldm.c: fix oops caused by corrupted
    partition table") does not consider that, for subsequent fragments,
    previously allocated memory is used.

    [1] http://lkml.org/lkml/2011/5/6/407

    Reported-by: Ben Hutchings
    Signed-off-by: Timo Warns
    Signed-off-by: Linus Torvalds

    Timo Warns
     
  • Since for-2.6.40/core was forked off the 2.6.39 devel tree, we've
    had churn in the core area that makes it difficult to handle
    patches for eg cfq or blk-throttle. Instead of requiring that they
    be based in older versions with bugs that have been fixed later
    in the rc cycle, merge in 2.6.39 final.

    Also fixes up conflicts in the below files.

    Conflicts:
    drivers/block/paride/pcd.c
    drivers/cdrom/viocd.c
    drivers/ide/ide-cd.c

    Signed-off-by: Jens Axboe

    Jens Axboe
     

09 May, 2011

1 commit

  • Stephen reports:

    -----

    After merging the block tree, today's linux-next build (x86_64
    allmodconfig) produced this warning:

    fs/partitions/check.c: In function 'part_discard_alignment_show':
    fs/partitions/check.c:263: warning: format '%u' expects type 'unsigned int', but argument 3 has type 'long long unsigned int'

    Introduced by commit ("block: Remove extra discard_alignment from
    hd_struct")

    -----

    Fix it up by just removing the cast, we return an int already.

    Reported-by: Stephen Rothwell
    Signed-off-by: Jens Axboe

    Jens Axboe
     

07 May, 2011

1 commit


06 May, 2011

1 commit


26 Apr, 2011

1 commit


15 Apr, 2011

1 commit

  • The kernel automatically evaluates partition tables of storage devices.
    The code for evaluating LDM partitions (in fs/partitions/ldm.c) contains
    a bug that causes a kernel oops on certain corrupted LDM partitions.
    A kernel subsystem seems to crash, because, after the oops, the kernel no
    longer recognizes newly connected storage devices.

    The patch validates the value of vblk_size.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Timo Warns
    Cc: Eugene Teo
    Cc: Harvey Harrison
    Cc: Richard Russon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Timo Warns
     

10 Apr, 2011

1 commit

  • When the kernel does partition detection, on certain configurations with
    external fibre channel raid systems (e.g. clariion from EMC) the read
    would fail. And "ldm_validate_partition_table(): Disk read failed"
    messages are printed to the console.

    But the failure to read is not a critical error. Now since the message
    is flagged as KERN_CRIT, it gets printed even when booting with the
    "quiet" kernel parameter. Fix it by using KERN_INFO, as the failure to
    read here is not really an error.

    Signed-off-by: Nikanth Karthikesan
    Reported-by : Klaus Hartmann
    Signed-off-by: Anton Altaparmakov
    Signed-off-by: Jiri Kosina

    Nikanth Karthikesan
     

31 Mar, 2011

1 commit


25 Mar, 2011

1 commit

  • * 'for-2.6.39/core' of git://git.kernel.dk/linux-2.6-block: (65 commits)
    Documentation/iostats.txt: bit-size reference etc.
    cfq-iosched: removing unnecessary think time checking
    cfq-iosched: Don't clear queue stats when preempt.
    blk-throttle: Reset group slice when limits are changed
    blk-cgroup: Only give unaccounted_time under debug
    cfq-iosched: Don't set active queue in preempt
    block: fix non-atomic access to genhd inflight structures
    block: attempt to merge with existing requests on plug flush
    block: NULL dereference on error path in __blkdev_get()
    cfq-iosched: Don't update group weights when on service tree
    fs: assign sb->s_bdi to default_backing_dev_info if the bdi is going away
    block: Require subsystems to explicitly allocate bio_set integrity mempool
    jbd2: finish conversion from WRITE_SYNC_PLUG to WRITE_SYNC and explicit plugging
    jbd: finish conversion from WRITE_SYNC_PLUG to WRITE_SYNC and explicit plugging
    fs: make fsync_buffers_list() plug
    mm: make generic_writepages() use plugging
    blk-cgroup: Add unaccounted time to timeslice_used.
    block: fixup plugging stubs for !CONFIG_BLOCK
    block: remove obsolete comments for blkdev_issue_zeroout.
    blktrace: Use rq->cmd_flags directly in blk_add_trace_rq.
    ...

    Fix up conflicts in fs/{aio.c,super.c}

    Linus Torvalds
     

22 Mar, 2011

1 commit


16 Mar, 2011

1 commit

  • It turns out that while a maximum of 8 partitions may be what people
    "should" have had, you can actually fit up to 18 entries(*) in a sector.

    And some people clearly were taking advantage of that, like Michael
    Cree, who had ten partitions on one of his OSF disks.

    (*) The OSF partition data starts at byte offset 64 in the first sector,
    and the array of 16-byte partition entries start at offset 148 in
    the on-disk partition structure.

    Reported-by: Michael Cree
    Cc: stable@kernel.org (v2.6.38)
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

15 Mar, 2011

1 commit

  • The kernel automatically evaluates partition tables of storage devices.
    The code for evaluating OSF partitions contains a bug that leaks data
    from kernel heap memory to userspace for certain corrupted OSF
    partitions.

    In more detail:

    for (i = 0 ; i < le16_to_cpu(label->d_npartitions); i++, partition++) {

    iterates from 0 to d_npartitions - 1, where d_npartitions is read from
    the partition table without validation and partition is a pointer to an
    array of at most 8 d_partitions.

    Add the proper and obvious validation.

    Signed-off-by: Timo Warns
    Cc: stable@kernel.org
    [ Changed the patch trivially to not repeat the whole le16_to_cpu()
    thing, and to use an explicit constant for the magic value '8' ]
    Signed-off-by: Linus Torvalds

    Timo Warns
     

26 Feb, 2011

1 commit

  • The kernel automatically evaluates partition tables of storage devices.
    The code for evaluating LDM partitions (in fs/partitions/ldm.c) contains
    a bug that causes a kernel oops on certain corrupted LDM partitions. A
    kernel subsystem seems to crash, because, after the oops, the kernel no
    longer recognizes newly connected storage devices.

    The patch changes ldm_parse_vmdb() to Validate the value of vblk_size.

    Signed-off-by: Timo Warns
    Cc: Eugene Teo
    Acked-by: Richard Russon
    Cc: Harvey Harrison
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Timo Warns
     

18 Feb, 2011

1 commit


13 Jan, 2011

1 commit


07 Jan, 2011

1 commit


05 Jan, 2011

1 commit

  • /proc/diskstats would display a strange output as follows.

    $ cat /proc/diskstats |grep sda
    8 0 sda 90524 7579 102154 20464 0 0 0 0 0 14096 20089
    8 1 sda1 19085 1352 21841 4209 0 0 0 0 4294967064 15689 4293424691
    ~~~~~~~~~~
    8 2 sda2 71252 3624 74891 15950 0 0 0 0 232 23995 1562390
    8 3 sda3 54 487 2188 92 0 0 0 0 0 88 92
    8 4 sda4 4 0 8 0 0 0 0 0 0 0 0
    8 5 sda5 81 2027 2130 138 0 0 0 0 0 87 137

    Its reason is the wrong way of accounting hd_struct->in_flight. When a bio is
    merged into a request belongs to different partition by ELEVATOR_FRONT_MERGE.

    The detailed root cause is as follows.

    Assuming that there are two partition, sda1 and sda2.

    1. A request for sda2 is in request_queue. Hence sda1's hd_struct->in_flight
    is 0 and sda2's one is 1.

    | hd_struct->in_flight
    ---------------------------
    sda1 | 0
    sda2 | 1
    ---------------------------

    2. A bio belongs to sda1 is issued and is merged into the request mentioned on
    step1 by ELEVATOR_BACK_MERGE. The first sector of the request is changed
    from sda2 region to sda1 region. However the two partition's
    hd_struct->in_flight are not changed.

    | hd_struct->in_flight
    ---------------------------
    sda1 | 0
    sda2 | 1
    ---------------------------

    3. The request is finished and blk_account_io_done() is called. In this case,
    sda2's hd_struct->in_flight, not a sda1's one, is decremented.

    | hd_struct->in_flight
    ---------------------------
    sda1 | -1
    sda2 | 1
    ---------------------------

    The patch fixes the problem by caching the partition lookup
    inside the request structure, hence making sure that the increment
    and decrement will always happen on the same partition struct. This
    also speeds up IO with accounting enabled, since it cuts down on
    the number of lookups we have to do.

    Also add a refcount to struct hd_struct to keep the partition in
    memory as long as users exist. We use kref_test_and_get() to ensure
    we don't add a reference to a partition which is going away.

    Signed-off-by: Jerome Marchand
    Signed-off-by: Yasuaki Ishimatsu
    Cc: stable@kernel.org
    Signed-off-by: Jens Axboe

    Jerome Marchand
     

17 Dec, 2010

1 commit


28 Nov, 2010

1 commit


16 Nov, 2010

1 commit


13 Nov, 2010

1 commit

  • Over time, block layer has accumulated a set of APIs dealing with bdev
    open, close, claim and release.

    * blkdev_get/put() are the primary open and close functions.

    * bd_claim/release() deal with exclusive open.

    * open/close_bdev_exclusive() are combination of open and claim and
    the other way around, respectively.

    * bd_link/unlink_disk_holder() to create and remove holder/slave
    symlinks.

    * open_by_devnum() wraps bdget() + blkdev_get().

    The interface is a bit confusing and the decoupling of open and claim
    makes it impossible to properly guarantee exclusive access as
    in-kernel open + claim sequence can disturb the existing exclusive
    open even before the block layer knows the current open if for another
    exclusive access. Reorganize the interface such that,

    * blkdev_get() is extended to include exclusive access management.
    @holder argument is added and, if is @FMODE_EXCL specified, it will
    gain exclusive access atomically w.r.t. other exclusive accesses.

    * blkdev_put() is similarly extended. It now takes @mode argument and
    if @FMODE_EXCL is set, it releases an exclusive access. Also, when
    the last exclusive claim is released, the holder/slave symlinks are
    removed automatically.

    * bd_claim/release() and close_bdev_exclusive() are no longer
    necessary and either made static or removed.

    * bd_link_disk_holder() remains the same but bd_unlink_disk_holder()
    is no longer necessary and removed.

    * open_bdev_exclusive() becomes a simple wrapper around lookup_bdev()
    and blkdev_get(). It also has an unexpected extra bdev_read_only()
    test which probably should be moved into blkdev_get().

    * open_by_devnum() is modified to take @holder argument and pass it to
    blkdev_get().

    Most of bdev open/close operations are unified into blkdev_get/put()
    and most exclusive accesses are tested atomically at the open time (as
    it should). This cleans up code and removes some, both valid and
    invalid, but unnecessary all the same, corner cases.

    open_bdev_exclusive() and open_by_devnum() can use further cleanup -
    rename to blkdev_get_by_path() and blkdev_get_by_devt() and drop
    special features. Well, let's leave them for another day.

    Most conversions are straight-forward. drbd conversion is a bit more
    involved as there was some reordering, but the logic should stay the
    same.

    Signed-off-by: Tejun Heo
    Acked-by: Neil Brown
    Acked-by: Ryusuke Konishi
    Acked-by: Mike Snitzer
    Acked-by: Philipp Reisner
    Cc: Peter Osterlund
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Jan Kara
    Cc: Andrew Morton
    Cc: Andreas Dilger
    Cc: "Theodore Ts'o"
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Alex Elder
    Cc: Christoph Hellwig
    Cc: dm-devel@redhat.com
    Cc: drbd-dev@lists.linbit.com
    Cc: Leo Chen
    Cc: Scott Branden
    Cc: Chris Mason
    Cc: Steven Whitehouse
    Cc: Dave Kleikamp
    Cc: Joern Engel
    Cc: reiserfs-devel@vger.kernel.org
    Cc: Alexander Viro

    Tejun Heo
     

11 Nov, 2010

1 commit


25 Oct, 2010

3 commits

  • * 'for-linus' of git://git.kernel.dk/linux-2.6-block:
    Revert "block: fix accounting bug on cross partition merges"

    Linus Torvalds
     
  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    Update broken web addresses in arch directory.
    Update broken web addresses in the kernel.
    Revert "drivers/usb: Remove unnecessary return's from void functions" for musb gadget
    Revert "Fix typo: configuation => configuration" partially
    ida: document IDA_BITMAP_LONGS calculation
    ext2: fix a typo on comment in ext2/inode.c
    drivers/scsi: Remove unnecessary casts of private_data
    drivers/s390: Remove unnecessary casts of private_data
    net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data
    drivers/infiniband: Remove unnecessary casts of private_data
    drivers/gpu/drm: Remove unnecessary casts of private_data
    kernel/pm_qos_params.c: Remove unnecessary casts of private_data
    fs/ecryptfs: Remove unnecessary casts of private_data
    fs/seq_file.c: Remove unnecessary casts of private_data
    arm: uengine.c: remove C99 comments
    arm: scoop.c: remove C99 comments
    Fix typo configue => configure in comments
    Fix typo: configuation => configuration
    Fix typo interrest[ing|ed] => interest[ing|ed]
    Fix various typos of valid in comments
    ...

    Fix up trivial conflicts in:
    drivers/char/ipmi/ipmi_si_intf.c
    drivers/usb/gadget/rndis.c
    net/irda/irnet/irnet_ppp.c

    Linus Torvalds
     
  • This reverts commit 7681bfeeccff5efa9eb29bf09249a3c400b15327.

    Conflicts:

    include/linux/genhd.h

    It has numerous issues with the cleanup path and non-elevator
    devices. Revert it for now so we can come up with a clean
    version without rushing things.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

23 Oct, 2010

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (31 commits)
    driver core: Display error codes when class suspend fails
    Driver core: Add section count to memory_block struct
    Driver core: Add mutex for adding/removing memory blocks
    Driver core: Move find_memory_block routine
    hpilo: Despecificate driver from iLO generation
    driver core: Convert link_mem_sections to use find_memory_block_hinted.
    driver core: Introduce find_memory_block_hinted which utilizes kset_find_obj_hinted.
    kobject: Introduce kset_find_obj_hinted.
    driver core: fix build for CONFIG_BLOCK not enabled
    driver-core: base: change to new flag variable
    sysfs: only access bin file vm_ops with the active lock
    sysfs: Fail bin file mmap if vma close is implemented.
    FW_LOADER: fix kconfig dependency warning on HOTPLUG
    uio: Statically allocate uio_class and use class .dev_attrs.
    uio: Support 2^MINOR_BITS minors
    uio: Cleanup irq handling.
    uio: Don't clear driver data
    uio: Fix lack of locking in init_uio_class
    SYSFS: Allow boot time switching between deprecated and modern sysfs layout
    driver core: remove CONFIG_SYSFS_DEPRECATED_V2 but keep it for block devices
    ...

    Linus Torvalds
     
  • I have some systems which need legacy sysfs due to old tools that are
    making assumptions that a directory can never be a symlink to another
    directory, and it's a big hazzle to compile separate kernels for them.

    This patch turns CONFIG_SYSFS_DEPRECATED into a run time option
    that can be switched on/off the kernel command line. This way
    the same binary can be used in both cases with just a option
    on the command line.

    The old CONFIG_SYSFS_DEPRECATED_V2 option is still there to set
    the default. I kept the weird name to not break existing
    config files.

    Also the compat code can be still completely disabled by undefining
    CONFIG_SYSFS_DEPRECATED_SWITCH -- just the optimizer takes
    care of this now instead of lots of ifdefs. This makes the code
    look nicer.

    v2: This is an updated version on top of Kay's patch to only
    handle the block devices. I tested it on my old systems
    and that seems to work.

    Cc: axboe@kernel.dk
    Signed-off-by: Andi Kleen
    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     

19 Oct, 2010

1 commit

  • /proc/diskstats would display a strange output as follows.

    $ cat /proc/diskstats |grep sda
    8 0 sda 90524 7579 102154 20464 0 0 0 0 0 14096 20089
    8 1 sda1 19085 1352 21841 4209 0 0 0 0 4294967064 15689 4293424691
    ~~~~~~~~~~
    8 2 sda2 71252 3624 74891 15950 0 0 0 0 232 23995 1562390
    8 3 sda3 54 487 2188 92 0 0 0 0 0 88 92
    8 4 sda4 4 0 8 0 0 0 0 0 0 0 0
    8 5 sda5 81 2027 2130 138 0 0 0 0 0 87 137

    Its reason is the wrong way of accounting hd_struct->in_flight. When a bio is
    merged into a request belongs to different partition by ELEVATOR_FRONT_MERGE.

    The detailed root cause is as follows.

    Assuming that there are two partition, sda1 and sda2.

    1. A request for sda2 is in request_queue. Hence sda1's hd_struct->in_flight
    is 0 and sda2's one is 1.

    | hd_struct->in_flight
    ---------------------------
    sda1 | 0
    sda2 | 1
    ---------------------------

    2. A bio belongs to sda1 is issued and is merged into the request mentioned on
    step1 by ELEVATOR_BACK_MERGE. The first sector of the request is changed
    from sda2 region to sda1 region. However the two partition's
    hd_struct->in_flight are not changed.

    | hd_struct->in_flight
    ---------------------------
    sda1 | 0
    sda2 | 1
    ---------------------------

    3. The request is finished and blk_account_io_done() is called. In this case,
    sda2's hd_struct->in_flight, not a sda1's one, is decremented.

    | hd_struct->in_flight
    ---------------------------
    sda1 | -1
    sda2 | 1
    ---------------------------

    The patch fixes the problem by caching the partition lookup
    inside the request structure, hence making sure that the increment
    and decrement will always happen on the same partition struct. This
    also speeds up IO with accounting enabled, since it cuts down on
    the number of lookups we have to do.

    When reloading partition tables, quiesce IO to ensure that no
    request references to the partition struct exists. When it is safe
    to free the partition table, the IO for that device is restarted
    again.

    Signed-off-by: Yasuaki Ishimatsu
    Cc: stable@kernel.org
    Signed-off-by: Jens Axboe

    Yasuaki Ishimatsu
     

18 Oct, 2010

1 commit

  • The patch below updates broken web addresses in the kernel

    Signed-off-by: Justin P. Mattock
    Cc: Maciej W. Rozycki
    Cc: Geert Uytterhoeven
    Cc: Finn Thain
    Cc: Randy Dunlap
    Cc: Matt Turner
    Cc: Dimitry Torokhov
    Cc: Mike Frysinger
    Acked-by: Ben Pfaff
    Acked-by: Hans J. Koch
    Reviewed-by: Finn Thain
    Signed-off-by: Jiri Kosina

    Justin P. Mattock
     

15 Sep, 2010

1 commit