20 Jul, 2012

12 commits

  • This has scsi_internal_device_unblock/scsi_target_unblock take
    the new state to set the devices as an argument instead of
    always setting to running. The patch also converts users of these
    functions.

    This allows the FC and iSCSI class to transition devices from blocked
    to transport-offline, so that when fast_io_fail/replacement_timeout
    has fired we do not set the devices back to running. Instead, we
    set them to SDEV_TRANSPORT_OFFLINE.

    Signed-off-by: Mike Christie
    Signed-off-by: James Bottomley

    Mike Christie
     
  • This patch adds a new state SDEV_TRANSPORT_OFFLINE. It will
    be used by transport classes to offline devices for cases like
    when the fast_io_fail/recovery_tmo fires. In those cases we
    want all IO to fail, and we have not yet escalated to dev_loss_tmo
    behavior where we are removing the devices.

    Currently to handle this state, transport classes are setting
    the scsi_device's state to running, setting their internal
    session/port structs state to something that indicates failed,
    and then failing IO from some transport check in the queuecommand.

    The reason for the new value is so that users can distinguish
    between a device failure that is a result of a transport problem
    vs the wide range of errors that devices get offlined for
    when a scsi command times out and we offline the devices there.
    It also fixes the confusion as to why the transport class is
    failing IO, but has set the device state from blocked to running.

    Signed-off-by: Mike Christie
    Signed-off-by: James Bottomley

    Mike Christie
     
  • Recent changes to add fcoe_sysfs caused libfcoe_init to call fcoe_transport_exit
    in a module initialization routine. The change resulted in the below error. This
    patch removes the __exit keyword from the fcoe_transport_exit definition such
    that it may be called from an __init routine.

    WARNING: drivers/scsi/fcoe/libfcoe.o(.init.text+0x21): Section mismatch in reference from the function init_module() to the function .exit.text:fcoe_transp
    exit()
    The function __init init_module() references
    a function __exit fcoe_transport_exit().
    This is often seen when error handling in the init function
    uses functionality in the exit path.
    The fix is often to remove the __exit annotation of
    fcoe_transport_exit() so it may be used outside an exit section.

    Signed-off-by: Mark Rustad
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Mark Rustad
     
  • bnx2fc had an assumption that the fcoe interface will always start on the vlan
    dev. However, some switch implementations (Eg., HP virtual connect FlexFabric)
    expects the fcoe interface to be started on physical interface. Do not error
    out if the netdev is not a vlan dev.

    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: James Bottomley

    Bhanu Prakash Gollapudi
     
  • Deduplication of formats and consolidating tests
    makes the object much smaller.

    Add bnx2fc_debug.c, add functions for a few logging
    functions (BNX2FC_IO_DBG, BNX2FC_TGT_DBG, BNX2FC_HBA_DBG).
    Use printf extension %pV.
    Add and use pr_fmt and pr_.
    Move the debug #include below structure definitions.

    $ size drivers/scsi/bnx2fc/built-in.o*
    text data bss dec hex filename
    101563 1165 24976 127704 1f2d8 drivers/scsi/bnx2fc/built-in.o.new
    138473 1109 33400 172982 2a3b6 drivers/scsi/bnx2fc/built-in.o.old

    Signed-off-by: Joe Perches
    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: James Bottomley

    Joe Perches
     
  • Since bnx2fc_percpu_thread_create() creates percpu kthread, it makes
    sense to use kthread_create_on_node() to get proper NUMA affinity for
    kthread stack.

    Signed-off-by: Eric Dumazet
    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: James Bottomley

    Eric Dumazet
     
  • scsi_wait_scan was introduced with asynchronous host scanning as a hack
    for distributions that weren't using proper udev based wait for root to
    appear in their initramfs scripts. In 2.6.30 Commit

    c751085943362143f84346d274e0011419c84202
    Author: Rafael J. Wysocki
    Date: Sun Apr 12 20:06:56 2009 +0200

    PM/Hibernate: Wait for SCSI devices scan to complete during resume

    Actually broke scsi_wait_scan because it renders
    scsi_complete_async_scans() a nop for modular SCSI if you include
    scsi_scans.h (which this module does).

    The lack of bug reports is sufficient proof that this module is no
    longer used.

    Cc: Jeff Mahoney
    Cc: Dave Jones
    Cc: maximilian attems
    Signed-off-by: James Bottomley

    James Bottomley
     
  • Updates newly added stats from fc_get_host_stats,
    added new function fc_exch_update_stats to
    update exches related stats from fc_exch.c
    by going thru internal ema_list elements.

    Signed-off-by: Vasu Dev
    Acked-by : Robert Love
    Tested-by: Ross Brattain
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • Adds stats to track FCP pkt and frame alloc
    failure.

    Signed-off-by: Vasu Dev
    Acked-by : Robert Love
    Tested-by: Ross Brattain
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • The libfc is used by fcoe but fcoe agnostic,
    and therefore should not have any fcoe references.

    So renaming fcoe_dev_stats from libfc as its for fc_stats.
    After that libfc is fcoe string free except some strings for
    Open-FCoE.org.

    Signed-off-by: Vasu Dev
    Acked-by : Robert Love
    Tested-by: Ross Brattain
    Acked-by: Bhanu Prakash Gollapudi
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • The libfc provides more flexibility and with that
    we can monitor some more FC specific stats for
    FC exches or FCP error cases, this patch add
    such new FC stats.

    The patch adds *only* FC specific new stats to
    existing fc_host attribute container.

    Added stats names are self explanatory as
    existing FC stats already has, however anyway
    still added commentary along their definition
    to describe them.

    Signed-off-by: Vasu Dev
    Acked-by : Robert Love
    Tested-by: Ross Brattain
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • Pull last minute Ceph fixes from Sage Weil:
    "The important one fixes a bug in the socket failure handling behavior
    that was turned up in some recent failure injection testing. The
    other two are minor bug fixes."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
    rbd: endian bug in rbd_req_cb()
    rbd: Fix ceph_snap_context size calculation
    libceph: fix messenger retry

    Linus Torvalds
     

19 Jul, 2012

20 commits

  • Pull three md bugfixes from NeilBrown:
    "One of the bugs was introduced in 3.5-rc1. Others have been there for
    longer."

    * tag 'md-3.5-fixes' of git://neil.brown.name/md:
    md/raid1: close some possible races on write errors during resync
    md: avoid crash when stopping md array races with closing other open fds.
    md: fix bug in handling of new_data_offset

    Linus Torvalds
     
  • Pull networking changes from David Miller:
    "Ok, we should be good to go now"

    1) We have to statically initialize the init_net device list head rather
    than do so in an initcall, otherwise netprio_cgroup crashes if it's
    built statically rather than modular (Mark D. Rustad)

    2) Fix SKB null oopser in CIPSO ipv4 option processing (Paul Moore)

    3) Qlogic maintainers update (Anirban Chakraborty)

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
    net: Statically initialize init_net.dev_base_head
    MAINTAINERS: Changes in qlcnic and qlge maintainers list
    cipso: don't follow a NULL pointer when setsockopt() is called

    Linus Torvalds
     
  • Pull HID update from Jiri Kosina:
    "A final round of changes for HID for 3.5: just device ID additions."

    * 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
    HID: hid-multitouch: add support for Zytronic panels
    HID: add Sennheiser BTD500USB device support
    HID: add battery quirk for Apple Wireless ANSI

    Linus Torvalds
     
  • The strcpy was being used to set the name of the board. Since the
    destination char* was read-only and the name is set statically at
    compile time; this was both wrong and redundant.

    The type of char* is changed to const char* to prevent future errors.

    Reported-by: Radek Masin
    Signed-off-by: Ezequiel Garcia
    [ Taking directly due to vacations - Linus ]
    Signed-off-by: Linus Torvalds

    Ezequiel Garcia
     
  • Signed-off-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Benjamin Tissoires
     
  • commit 4367af556133723d0f443e14ca8170d9447317cb
    md/raid1: clear bad-block record when write succeeds.

    Added a 'reschedule_retry' call possibility at the end of
    end_sync_write, but didn't add matching code at the end of
    sync_request_write. So if the writes complete very quickly, or
    scheduling makes it seem that way, then we can miss rescheduling
    the request and the resync could hang.

    Also commit 73d5c38a9536142e062c35997b044e89166e063b
    md: avoid races when stopping resync.

    Fix a race condition in this same code in end_sync_write but didn't
    make the change in sync_request_write.

    This patch updates sync_request_write to fix both of those.
    Patch is suitable for 3.1 and later kernels.

    Reported-by: Alexander Lyakas
    Original-version-by: Alexander Lyakas
    Cc: stable@vger.kernel.org
    Signed-off-by: NeilBrown

    NeilBrown
     
  • md will refuse to stop an array if any other fd (or mounted fs) is
    using it.
    When any fs is unmounted of when the last open fd is closed all
    pending IO will be flushed (e.g. sync_blockdev call in __blkdev_put)
    so there will be no pending IO to worry about when the array is
    stopped.

    However in order to send the STOP_ARRAY ioctl to stop the array one
    must first get and open fd on the block device.
    If some fd is being used to write to the block device and it is closed
    after mdadm open the block device, but before mdadm issues the
    STOP_ARRAY ioctl, then there will be no last-close on the md device so
    __blkdev_put will not call sync_blockdev.

    If this happens, then IO can still be in-flight while md tears down
    the array and bad things can happen (use-after-free and subsequent
    havoc).

    So in the case where do_md_stop is being called from an open file
    descriptor, call sync_block after taking the mutex to ensure there
    will be no new openers.

    This is needed when setting a read-write device to read-only too.

    Cc: stable@vger.kernel.org
    Reported-by: majianpeng
    Signed-off-by: NeilBrown

    NeilBrown
     
  • commit c6563a8c38fde3c1c7fc925a10bde3ca20799301
    md: add possibility to change data-offset for devices.

    introduced a 'new_data_offset' attribute which should normally
    be the same as 'data_offset', but can be explicitly set to a different
    value to allow a reshape operation to move the data.

    Unfortunately when the 'data_offset' is explicitly set through
    sysfs, the new_data_offset is not also set, so the two would become
    out-of-sync incorrectly.

    One result of this is that trying to set the 'size' after the
    'data_offset' would fail because it is not permitted to set the size
    when the 'data_offset' and 'new_data_offset' are different - as that
    can be confusing.
    Consequently when mdadm tried to do this while assembling an IMSM
    array it would fail.

    This bug was introduced in 3.5-rc1.

    Reported-by: Brian Downing
    Bisected-by: Brian Downing
    Tested-by: Brian Downing
    Signed-off-by: NeilBrown

    NeilBrown
     
  • Pull target fixes from Nicholas Bellinger:
    "This includes a bugfix from MDR to address a NULL pointer OOPs with
    FCoE aborts, along with a WRITE_SAME emulation bugfix for NOLB=0
    cases, and persistent reservation return cleanups from Roland.

    All three patches are CC'ed to stable."

    * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
    target: Fix range calculation in WRITE SAME emulation when num blocks == 0
    target: Clean up returning errors in PR handling code
    tcm_fc: Fix crash seen with aborts and large reads

    Linus Torvalds
     
  • The referenced html file does not exist anymore. Replace the URL with
    the current project homepage.

    Signed-off-by: Olaf Hering
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Hering
     
  • Commit 377780887 ("bug.h: need linux/kernel.h for TAINT_WARN.") broke
    all MIPS builds:

    CC arch/mips/kernel/machine_kexec.o
    include/linux/log2.h: In function '__ilog2_u32':
    include/linux/log2.h:34:2: error: implicit declaration of function 'fls' [-Werror=implicit-function-declaration]
    include/linux/log2.h: In function '__ilog2_u64':
    include/linux/log2.h:42:2: error: implicit declaration of function 'fls64' [-Werror=implicit-function-declaration]
    ...

    Signed-off-by: Yoichi Yuasa
    Tested-by: John Crispin
    Cc: Ralf Baechle
    Cc: David Daney
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yoichi Yuasa
     
  • Commit a7a20d103994 ("sd: limit the scope of the async probe domain")
    make the SCSI device probing run device discovery in it's own async
    domain.

    However, as a result, the partition detection was no longer synchronized
    by async_synchronize_full() (which, despite the name, only synchronizes
    the global async space, not all of them). Which in turn meant that
    "wait_for_device_probe()" would not wait for the SCSI partitions to be
    parsed.

    And "wait_for_device_probe()" was what the boot time init code relied on
    for mounting the root filesystem.

    Now, most people never noticed this, because not only is it
    timing-dependent, but modern distributions all use initrd. So the root
    filesystem isn't actually on a disk at all. And then before they
    actually mount the final disk filesystem, they will have loaded the
    scsi-wait-scan module, which not only does the expected
    wait_for_device_probe(), but also does scsi_complete_async_scans().

    [ Side note: scsi_complete_async_scans() had also been partially broken,
    but that was fixed in commit 43a8d39d0137 ("fix async probe
    regression"), so that same commit a7a20d103994 had actually broken
    setups even if you used scsi-wait-scan explicitly ]

    Solve this problem by just moving the scsi_complete_async_scans() call
    into wait_for_device_probe(). Everybody who wants to wait for device
    probing to finish really wants the SCSI probing to complete, so there's
    no reason not to do this.

    So now "wait_for_device_probe()" really does what the name implies, and
    properly waits for device probing to finish. This also removes the now
    unnecessary extra calls to scsi_complete_async_scans().

    Reported-and-tested-by: Artem S. Tashkinov
    Cc: Dan Williams
    Cc: Alan Stern
    Cc: James Bottomley
    Cc: Borislav Petkov
    Cc: linux-scsi
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Pull SELinux regression fixes from James Morris.

    Andrew Morton has a box that hit that open perms problem.

    I also renamed the "epollwakeup" selinux name for the new capability to
    be "block_suspend", to match the rename done by commit d9914cf66181
    ("PM: Rename CAP_EPOLLWAKEUP to CAP_BLOCK_SUSPEND").

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
    SELinux: do not check open perms if they are not known to policy
    SELinux: include definition of new capabilities

    Linus Torvalds
     
  • This change eliminates an initialization-order hazard most
    recently seen when netprio_cgroup is built into the kernel.

    With thanks to Eric Dumazet for catching a bug.

    Signed-off-by: Mark Rustad
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Rustad, Mark D
     
  • One more time/ntp fix pulled from Ingo Molnar.

    * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    ntp: Fix STA_INS/DEL clearing bug

    Linus Torvalds
     
  • The VIDIOC_DV_TIMINGS_CAP ioctl check wasn't added to determine_valid_ioctls().
    This caused this ioctl to always return -ENOTTY.

    The cause for this was that for 3.5 two patch series were merged, one
    changing V4L2 core ioctl handling and one adding new functionality, and
    some of the new functionality wasn't handled by the new V4L2 core code.

    Signed-off-by: Hans Verkuil
    [ Taking it directly due to vacations - Linus ]
    Signed-off-by: Linus Torvalds

    Hans Verkuil
     
  • Pull ARM SoC fixes for SPEAr from Olof Johansson:
    "These are arriving very late in the release cycle, but there has been
    a change of maintainers on the SPEAr platform and they have needed a
    while to get going.

    The patch count is higher than I would like at this point, but they're
    all relevant fixes and well-contained in their own platform code. I
    still think it's suitable 3.5 material and I don't think it should
    increase the need for a -rc8 since they are so contained."

    * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    ARM: SPEAr600: Fix timer interrupt definition in spear600.dtsi
    ARM: dts: SPEAr320: Boot the board in EXTENDED_MODE
    ARM: dts: SPEAr320: Fix compatible string
    Clk: SPEAr1340: Update sys clock parent array
    clk: SPEAr1340: Fix clk enable register for uart1 and i2c1.
    ARM: SPEAr13xx: Fix Interrupt bindings
    Clk:spear6xx:Fix: Rename clk ids within predefined limit
    Clk:spear3xx:Fix: Rename clk ids within predefined limit
    clk:spear1310:Fix: Rename clk ids within predefined limit
    clk:spear1340:Fix: Rename clk ids within predefined limit

    Linus Torvalds
     
  • Please apply.

    Thanks.

    Signed-off-by: Anirban Chakraborty
    Signed-off-by: David S. Miller

    Anirban Chakraborty
     
  • Pull CIFS fixes from Steve French.

    * git://git.samba.org/sfrench/cifs-2.6:
    cifs: always update the inode cache with the results from a FIND_*
    cifs: when CONFIG_HIGHMEM is set, serialize the read/write kmaps
    cifs: on CONFIG_HIGHMEM machines, limit the rsize/wsize to the kmap space
    Initialise mid_q_entry before putting it on the pending queue

    Linus Torvalds
     
  • As reported by Alan Cox, and verified by Lin Ming, when a user
    attempts to add a CIPSO option to a socket using the CIPSO_V4_TAG_LOCAL
    tag the kernel dies a terrible death when it attempts to follow a NULL
    pointer (the skb argument to cipso_v4_validate() is NULL when called via
    the setsockopt() syscall).

    This patch fixes this by first checking to ensure that the skb is
    non-NULL before using it to find the incoming network interface. In
    the unlikely case where the skb is NULL and the user attempts to add
    a CIPSO option with the _TAG_LOCAL tag we return an error as this is
    not something we want to allow.

    A simple reproducer, kindly supplied by Lin Ming, although you must
    have the CIPSO DOI #3 configure on the system first or you will be
    caught early in cipso_v4_validate():

    #include
    #include
    #include
    #include
    #include

    struct local_tag {
    char type;
    char length;
    char info[4];
    };

    struct cipso {
    char type;
    char length;
    char doi[4];
    struct local_tag local;
    };

    int main(int argc, char **argv)
    {
    int sockfd;
    struct cipso cipso = {
    .type = IPOPT_CIPSO,
    .length = sizeof(struct cipso),
    .local = {
    .type = 128,
    .length = sizeof(struct local_tag),
    },
    };

    memset(cipso.doi, 0, 4);
    cipso.doi[3] = 3;

    sockfd = socket(AF_INET, SOCK_DGRAM, 0);
    #define SOL_IP 0
    setsockopt(sockfd, SOL_IP, IP_OPTIONS,
    &cipso, sizeof(struct cipso));

    return 0;
    }

    CC: Lin Ming
    Reported-by: Alan Cox
    Signed-off-by: Paul Moore
    Signed-off-by: David S. Miller

    Paul Moore
     

18 Jul, 2012

8 commits