15 Jan, 2012

1 commit

  • Introduce a wrapper around scsi_cmd_ioctl that takes a block device.

    The function will then be enhanced to detect partition block devices
    and, in that case, subject the ioctls to whitelisting.

    Cc: linux-scsi@vger.kernel.org
    Cc: Jens Axboe
    Cc: James Bottomley
    Signed-off-by: Paolo Bonzini
    Signed-off-by: Linus Torvalds

    Paolo Bonzini
     

13 Jan, 2012

1 commit


04 Jan, 2012

1 commit

  • Move invalidate_bdev, block_sync_page into fs/block_dev.c. Export
    kill_bdev as well, so brd doesn't have to open code it. Reduce
    buffer_head.h requirement accordingly.

    Removed a rather large comment from invalidate_bdev, as it looked a bit
    obsolete to bother moving. The small comment replacing it says enough.

    Signed-off-by: Nick Piggin
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Al Viro
     

02 Aug, 2011

1 commit

  • The report has an ISO which has a very long manufacturer ID. It seems
    that Linux is wrong, not the ISO maker.

    Relax the check for the length of this field: emit a warning and truncate
    the incoming data to 2048 bytes rather than rejecting the entire thing.

    dvd_manufact.value isn't null-terminated. I'm not even sure if it's a
    string. The kernel doesn't apepar to use it anyway.

    Addresses https://bugzilla.kernel.org/show_bug.cgi?id=39062

    Reported-by:
    Tested-by:
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Jens Axboe

    Andrew Morton
     

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
     

21 May, 2011

1 commit

  • 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
     

29 Apr, 2011

1 commit

  • cdrom_open() called check_disk_change() after the rest of open path
    succeeded which leads to the following bizarre behavior.

    * After media change, if the device opened without O_NONBLOCK,
    open_for_data() naturally fails with -ENOMEDIA and
    check_disk_change() is never called. The media is known to be gone
    and the open failure makes it obvious to the userland but device
    invalidation never happens.

    * But if the device is opened with O_NONBLOCK, all the checks are
    bypassed and cdrom_open() doesn't notice that the media is not there
    and check_disk_change() is called and invalidation happens.

    There's nothing to be gained by avoiding calling check_disk_change()
    on open failure. Common cases end up calling check_disk_change()
    anyway. All we get is inconsistent behavior.

    Fix it by moving check_disk_change() invocation to the top of
    cdrom_open() so that it always gets called regardless of how the rest
    of open proceeds.

    Stable: 2.6.38

    Signed-off-by: Tejun Heo
    Reported-by: Amit Shah
    Tested-by: Amit Shah
    Cc: stable@kernel.org
    Signed-off-by: Jens Axboe

    Tejun Heo
     

22 Apr, 2011

3 commits

  • In-kernel disk event polling doesn't matter for legacy/fringe drivers
    and may lead to infinite event loop if ->check_events() implementation
    generates events on level condition instead of edge.

    Now that block layer supports suppressing exporting unlisted events,
    simply leaving disk->events cleared allows these drivers to keep the
    internal revalidation behavior intact while avoiding weird
    interactions with userland event handler.

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

    Tejun Heo
     
  • Disk event code automatically blocks events on excl write. This is
    primarily to avoid issuing polling commands while burning is in
    progress. This behavior doesn't fit other types of devices with
    removeable media where polling commands don't have adverse side
    effects and door locking usually doesn't exist.

    This patch introduces new genhd flag which controls the auto-blocking
    behavior and uses it to enable auto-blocking only on optical devices.

    Note for stable: 2.6.38 and later only

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

    Tejun Heo
     
  • cdrom_open() called check_disk_change() after the rest of open path
    succeeded which leads to the following bizarre behavior.

    * After media change, if the device opened without O_NONBLOCK,
    open_for_data() naturally fails with -ENOMEDIA and
    check_disk_change() is never called. The media is known to be gone
    and the open failure makes it obvious to the userland but device
    invalidation never happens.

    * But if the device is opened with O_NONBLOCK, all the checks are
    bypassed and cdrom_open() doesn't notice that the media is not there
    and check_disk_change() is called and invalidation happens.

    There's nothing to be gained by avoiding calling check_disk_change()
    on open failure. Common cases end up calling check_disk_change()
    anyway. All we get is inconsistent behavior.

    Fix it by moving check_disk_change() invocation to the top of
    cdrom_open() so that it always gets called regardless of how the rest
    of open proceeds.

    Note for stable: 2.6.38 and later only

    Cc: stable@kernel.org
    Signed-off-by: Tejun Heo
    Reported-by: Amit Shah
    Tested-by: Amit Shah
    Signed-off-by: Jens Axboe

    Tejun Heo
     

31 Mar, 2011

1 commit


10 Mar, 2011

1 commit


09 Feb, 2011

1 commit

  • Commit 93aae17af1172c40c6f74b7294e93a90c3cfaa5d ("sr: implement
    sr_check_events()") replaced the media_changed op with the
    check_events op in drivers/scsi/sr.c

    All users that check for the CDC_MEDIA_CHANGED capbility try both
    the check_events op and the media_changed op, but register_cdrom()
    was requiring media_changed.

    This patch fixes the capability checking.

    The cdrom_select_disc ioctl is also using the two operations, so
    they should be required for CDC_SELECT_DISC too.

    Signed-off-by: Simon Arlott
    Cc: Tejun Heo
    Cc: Kay Sievers
    Tested-by: Chris Clayton
    Signed-off-by: Jens Axboe

    Simon Arlott
     

14 Jan, 2011

1 commit

  • * 'for-2.6.38/core' of git://git.kernel.dk/linux-2.6-block: (43 commits)
    block: ensure that completion error gets properly traced
    blktrace: add missing probe argument to block_bio_complete
    block cfq: don't use atomic_t for cfq_group
    block cfq: don't use atomic_t for cfq_queue
    block: trace event block fix unassigned field
    block: add internal hd part table references
    block: fix accounting bug on cross partition merges
    kref: add kref_test_and_get
    bio-integrity: mark kintegrityd_wq highpri and CPU intensive
    block: make kblockd_workqueue smarter
    Revert "sd: implement sd_check_events()"
    block: Clean up exit_io_context() source code.
    Fix compile warnings due to missing removal of a 'ret' variable
    fs/block: type signature of major_to_index(int) to major_to_index(unsigned)
    block: convert !IS_ERR(p) && p to !IS_ERR_NOR_NULL(p)
    cfq-iosched: don't check cfqg in choose_service_tree()
    fs/splice: Pull buf->ops->confirm() from splice_from_pipe actors
    cdrom: export cdrom_check_events()
    sd: implement sd_check_events()
    sr: implement sr_check_events()
    ...

    Linus Torvalds
     

24 Dec, 2010

1 commit


17 Dec, 2010

2 commits

  • It's used by sr, so we need to export it.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • In principle, cdrom just needs to pass through ->check_events() but
    CDROM_MEDIA_CHANGED ioctl makes things a bit more complex. Just as
    with ->media_changed() support, cdrom code needs to buffer the events
    and serve them to ioctl and vfs as requested.

    As the code has to deal with both ->check_events() and
    ->media_changed(), and vfs and ioctl event buffering, this patch adds
    check_events caching on top of the existing cdi->mc_flags buffering.

    It may be a good idea to deprecate CDROM_MEDIA_CHANGED ioctl and
    remove all this mess.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jens Axboe

    Tejun Heo
     

27 Oct, 2010

1 commit


05 Oct, 2010

1 commit

  • The block device drivers have all gained new lock_kernel
    calls from a recent pushdown, and some of the drivers
    were already using the BKL before.

    This turns the BKL into a set of per-driver mutexes.
    Still need to check whether this is safe to do.

    file=$1
    name=$2
    if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
    sed -i '/include.*/d' ${file}
    else
    sed -i 's/include.*.*$/include /g' ${file}
    fi
    sed -i ${file} \
    -e "/^#include.*linux.mutex.h/,$ {
    1,/^\(static\|int\|long\)/ {
    /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

    } }" \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[ ]*cycle_kernel_lock();/d'
    else
    sed -i -e '/include.*\/d' ${file} \
    -e '/cycle_kernel_lock()/d'
    fi

    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

08 Aug, 2010

4 commits

  • The open and release block_device_operations are currently
    called with the BKL held. In order to change that, we must
    first make sure that all drivers that currently rely
    on this have no regressions.

    This blindly pushes the BKL into all .open and .release
    operations for all block drivers to prepare for the
    next step. The drivers can subsequently replace the BKL
    with their own locks or remove it completely when it can
    be shown that it is not needed.

    The functions blkdev_get and blkdev_put are the only
    remaining users of the big kernel lock in the block
    layer, besides a few uses in the ioctl code, none
    of which need to serialize with blkdev_{get,put}.

    Most of these two functions is also under the protection
    of bdev->bd_mutex, including the actual calls to
    ->open and ->release, and the common code does not
    access any global data structures that need the BKL.

    Signed-off-by: Arnd Bergmann
    Acked-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     
  • As a preparation for the removal of the big kernel
    lock in the block layer, this removes the BKL
    from the common ioctl handling code, moving it
    into every single driver still using it.

    Signed-off-by: Arnd Bergmann
    Acked-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     
  • - add pr_fmt.

    - convert printks to pr_

    - add if (0) and printf argument checking to cdinfo

    - coalesce consecutive printks to single pr_

    - fix a typo "back ground" to "background"

    - convert printks without level to pr_info

    - remove VIOCD_ prefixes and use pr_fmt/pr_

    - add a missing newline to an OS/400 message

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton

    Folded in tab indentation fix from Andrew.

    Signed-off-by: Jens Axboe

    Joe Perches
     
  • Remove all the trivial wrappers for the cmd_type and cmd_flags fields in
    struct requests. This allows much easier grepping for different request
    types instead of unwinding through macros.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

19 May, 2010

1 commit


26 Feb, 2010

2 commits


10 Dec, 2009

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (137 commits)
    sh: include empty zero page in romImage
    sh: Make associative cache writes fatal on all SH-4A parts.
    sh: Drop associative writes for SH-4 cache flushes.
    sh: Partial revert of copy/clear_user_highpage() optimizations.
    sh: Add default uImage rule for se7724, ap325rxa, and migor.
    sh: allow runtime pm without suspend/resume callbacks
    sh: mach-ecovec24: Remove un-defined settings for VPU
    sh: mach-ecovec24: LCDC drive ability become high
    sh: fix sh7724 VEU3F resource size
    serial: sh-sci: Fix too early port disabling.
    sh: pfc: pr_info() -> pr_debug() cleanups.
    sh: pfc: Convert from ctrl_xxx() to __raw_xxx() I/O routines.
    sh: Improve kfr2r09 serial port setup code
    sh: Break out SuperH PFC code
    sh: Move KEYSC header file
    sh: convert /proc/cpu/aligmnent, /proc/cpu/kernel_alignment to seq_file
    sh: Add CPG save/restore code for sh7724 R-standby
    sh: Add SDHI power control support to Ecovec
    mfd: Add power control platform data to SDHI driver
    sh: mach-ecovec24: modify address map
    ...

    Linus Torvalds
     

19 Nov, 2009

1 commit


12 Nov, 2009

1 commit

  • Now that sys_sysctl is a wrapper around /proc/sys all of
    the binary sysctl support elsewhere in the tree is
    dead code.

    Cc: Jens Axboe
    Cc: Corey Minyard
    Cc: Greg Kroah-Hartman
    Cc: Matt Mackall
    Cc: Herbert Xu
    Cc: Neil Brown
    Cc: "James E.J. Bottomley"
    Acked-by: Clemens Ladisch for drivers/char/hpet.c
    Signed-off-by: Eric W. Biederman

    Eric W. Biederman
     

13 Oct, 2009

1 commit

  • PHYSADDR() is gone, and completely unecessary in all of the cases the
    gdrom driver was using it. Kill off all references to it, and change the
    one legitimate use over to virt_to_phys() instead.

    Signed-off-by: Paul Mundt

    Paul Mundt
     

24 Sep, 2009

1 commit

  • It's unused.

    It isn't needed -- read or write flag is already passed and sysctl
    shouldn't care about the rest.

    It _was_ used in two places at arch/frv for some reason.

    Signed-off-by: Alexey Dobriyan
    Cc: David Howells
    Cc: "Eric W. Biederman"
    Cc: Al Viro
    Cc: Ralf Baechle
    Cc: Martin Schwidefsky
    Cc: Ingo Molnar
    Cc: "David S. Miller"
    Cc: James Morris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

22 Sep, 2009

1 commit


23 May, 2009

3 commits


20 May, 2009

1 commit


11 May, 2009

4 commits

  • Till now block layer allowed two separate modes of request execution.
    A request is always acquired from the request queue via
    elv_next_request(). After that, drivers are free to either dequeue it
    or process it without dequeueing. Dequeue allows elv_next_request()
    to return the next request so that multiple requests can be in flight.

    Executing requests without dequeueing has its merits mostly in
    allowing drivers for simpler devices which can't do sg to deal with
    segments only without considering request boundary. However, the
    benefit this brings is dubious and declining while the cost of the API
    ambiguity is increasing. Segment based drivers are usually for very
    old or limited devices and as converting to dequeueing model isn't
    difficult, it doesn't justify the API overhead it puts on block layer
    and its more modern users.

    Previous patches converted all block low level drivers to dequeueing
    model. This patch completes the API transition by...

    * renaming elv_next_request() to blk_peek_request()

    * renaming blkdev_dequeue_request() to blk_start_request()

    * adding blk_fetch_request() which is combination of peek and start

    * disallowing completion of queued (not started) requests

    * applying new API to all LLDs

    Renamings are for consistency and to break out of tree code so that
    it's apparent that out of tree drivers need updating.

    [ Impact: block request issue API cleanup, no functional change ]

    Signed-off-by: Tejun Heo
    Cc: Rusty Russell
    Cc: James Bottomley
    Cc: Mike Miller
    Cc: unsik Kim
    Cc: Paul Clements
    Cc: Tim Waugh
    Cc: Geert Uytterhoeven
    Cc: David S. Miller
    Cc: Laurent Vivier
    Cc: Jeff Garzik
    Cc: Jeremy Fitzhardinge
    Cc: Grant Likely
    Cc: Adrian McMenamin
    Cc: Stephen Rothwell
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Borislav Petkov
    Cc: Sergei Shtylyov
    Cc: Alex Dubov
    Cc: Pierre Ossman
    Cc: David Woodhouse
    Cc: Markus Lidel
    Cc: Stefan Weinhuber
    Cc: Martin Schwidefsky
    Cc: Pete Zaitcev
    Cc: FUJITA Tomonori
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • gdrom already dequeues and fully completes requests on normal path and
    the error paths can be easily converted to do so too. Clean it up and
    dequeue requests on error paths too.

    While at it remove superflous blk_fs_request() && !blk_rq_sectors()
    condition check.

    [ Impact: dequeue in-flight request, cleanup ]

    Signed-off-by: Tejun Heo
    Cc: Adrian McMenamin
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • plat-omap/mailbox, floppy, viocd, mspro_block, i2o_block and
    mmc/card/queue are already pretty close to dequeueing model and can be
    converted with simple changes. Convert them.

    While at it,

    * xen-blkfront: !fs check moved downwards to share dequeue call with
    normal path.

    * mspro_block: __blk_end_request(..., blk_rq_cur_byte()) converted to
    __blk_end_request_cur()

    * mmc/card/queue: loop of __blk_end_request() converted to
    __blk_end_request_all()

    [ Impact: dequeue in-flight request ]

    Signed-off-by: Tejun Heo
    Cc: Rusty Russell
    Cc: Jeremy Fitzhardinge
    Cc: Stephen Rothwell
    Cc: Alex Dubov
    Cc: Markus Lidel
    Cc: Pierre Ossman
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • With recent cleanups, there is no place where low level driver
    directly manipulates request fields. This means that the 'hard'
    request fields always equal the !hard fields. Convert all
    rq->sectors, nr_sectors and current_nr_sectors references to
    accessors.

    While at it, drop superflous blk_rq_pos() < 0 test in swim.c.

    [ Impact: use pos and nr_sectors accessors ]

    Signed-off-by: Tejun Heo
    Acked-by: Geert Uytterhoeven
    Tested-by: Grant Likely
    Acked-by: Grant Likely
    Tested-by: Adrian McMenamin
    Acked-by: Adrian McMenamin
    Acked-by: Mike Miller
    Cc: James Bottomley
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Borislav Petkov
    Cc: Sergei Shtylyov
    Cc: Eric Moore
    Cc: Alan Stern
    Cc: FUJITA Tomonori
    Cc: Pete Zaitcev
    Cc: Stephen Rothwell
    Cc: Paul Clements
    Cc: Tim Waugh
    Cc: Jeff Garzik
    Cc: Jeremy Fitzhardinge
    Cc: Alex Dubov
    Cc: David Woodhouse
    Cc: Martin Schwidefsky
    Cc: Dario Ballabio
    Cc: David S. Miller
    Cc: Rusty Russell
    Cc: unsik Kim
    Cc: Laurent Vivier
    Signed-off-by: Jens Axboe

    Tejun Heo