25 Oct, 2018

4 commits

  • Change the request queue handler to use common handling routines same
    as the control queue handler.

    Signed-off-by: Bijan Mottahedeh
    Signed-off-by: Michael S. Tsirkin

    Bijan Mottahedeh
     
  • Prepare to change the request queue handler to use common handling
    routines.

    Signed-off-by: Bijan Mottahedeh
    Signed-off-by: Michael S. Tsirkin

    Bijan Mottahedeh
     
  • The vhost-scsi driver currently does not handle any control queue
    operations. In particular, vhost_scsi_ctl_handle_kick, merely prints out
    a debug message but does nothing else. This can cause guest VMs to hang.

    As part of SCSI recovery from an error, e.g., an I/O timeout, the SCSI
    midlayer attempts to abort the failed operation. The SCSI virtio driver
    translates the abort to a SCSI TMF request that gets put on the control
    queue (virtscsi_abort -> virtscsi_tmf). The SCSI virtio driver then
    waits indefinitely for this request to be completed, but it never will
    because vhost-scsi never responds to that request.

    To avoid a hang, always respond to control queue operations; explicitly
    reject TMF requests, and return a no-op response to event requests.

    Signed-off-by: Bijan Mottahedeh
    Signed-off-by: Michael S. Tsirkin

    Bijan Mottahedeh
     
  • Commands with protection information included were not truncating the
    protection iov_iter to the number of protection bytes in the command.
    This resulted in vhost_scsi mis-calculating the size of the protection
    SGL in vhost_scsi_calc_sgls(), and including both the protection and
    data SG entries in the protection SGL.

    Fixes: 09b13fa8c1a1 ("vhost/scsi: Add ANY_LAYOUT support in vhost_scsi_handle_vq")
    Signed-off-by: Greg Edwards
    Signed-off-by: Michael S. Tsirkin
    Fixes: 09b13fa8c1a1093e9458549ac8bb203a7c65c62a
    Cc: stable@vger.kernel.org
    Reviewed-by: Paolo Bonzini

    Greg Edwards
     

24 Aug, 2018

1 commit

  • Pull virtio updates from Michael Tsirkin:
    "virtio, vhost: fixes, tweaks

    No new features but a bunch of tweaks such as switching balloon from
    oom notifier to shrinker"

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    vhost/scsi: increase VHOST_SCSI_PREALLOC_PROT_SGLS to 2048
    vhost: allow vhost-scsi driver to be built-in
    virtio: pci-legacy: Validate queue pfn
    virtio: mmio-v1: Validate queue PFN
    virtio_balloon: replace oom notifier with shrinker
    virtio-balloon: kzalloc the vb struct
    virtio-balloon: remove BUG() in init_vqs

    Linus Torvalds
     

22 Aug, 2018

1 commit

  • The current value of VHOST_SCSI_PREALLOC_PROT_SGLS is too small to
    accommodate larger I/Os, e.g. 16-32 MiB, when the VIRTIO_SCSI_F_T10_PI
    feature bit is negotiated and the backing store supports T10 PI.

    vhost-scsi rejects the command with errors like:

    [ 59.581317] vhost_scsi_calc_sgls: requested sgl_count: 1820 exceeds pre-allocated max_sgls: 512

    Signed-off-by: Greg Edwards
    Signed-off-by: Michael S. Tsirkin

    Greg Edwards
     

03 Aug, 2018

2 commits

  • This converts drivers that were only calling transport_deregister_session
    to use target_remove_session. The calling of
    transport_deregister_session_configfs via target_remove_session for these
    types of drivers is ok, because they were not exporting info from fields
    like sess_acl_list, sess->se_tpg and sess->fabric_sess_ptr from configfs
    accessible functions, so they will see no difference.

    Signed-off-by: Mike Christie
    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Cc: Felipe Balbi
    Cc: Sebastian Andrzej Siewior
    Cc: Andrzej Pietrasiewicz
    Cc: Michael S. Tsirkin
    Cc: Juergen Gross
    Signed-off-by: Martin K. Petersen

    Mike Christie
     
  • Rename target_alloc_session to target_setup_session to avoid confusion with
    the other transport session allocation function that only allocates the
    session and because the target_alloc_session does so much more. It
    allocates the session, sets up the nacl and registers the session.

    The next patch will then add a remove function to match the setup in this
    one, so it should make sense for all drivers, except iscsi, to just call
    those 2 functions to setup and remove a session.

    iscsi will continue to be the odd driver.

    Signed-off-by: Mike Christie
    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Cc: Chris Boot
    Cc: Bryant G. Ly
    Cc: Michael Cyr
    Cc:
    Cc: Johannes Thumshirn
    Cc: Felipe Balbi
    Cc: Sebastian Andrzej Siewior
    Cc: Andrzej Pietrasiewicz
    Cc: Michael S. Tsirkin
    Cc: Juergen Gross
    Signed-off-by: Martin K. Petersen

    Mike Christie
     

03 Jul, 2018

1 commit

  • Since most target drivers do not use the second fabric_make_tpg() argument
    ("group") and since it is trivial to derive the group pointer from the wwn
    pointer, do not pass the group pointer to fabric_make_tpg().

    Signed-off-by: Bart Van Assche
    Reviewed-by: Mike Christie
    Cc: Felipe Balbi
    Cc: Hannes Reinecke
    Cc: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     

20 Jun, 2018

2 commits

  • The sbitmap and the percpu_ida perform essentially the same task,
    allocating tags for commands. The sbitmap outperforms the percpu_ida as
    documented here: https://lkml.org/lkml/2014/4/22/553

    The sbitmap interface is a little harder to use, but being able to remove
    the percpu_ida code and getting better performance justifies the additional
    complexity.

    Signed-off-by: Matthew Wilcox
    Acked-by: Felipe Balbi # f_tcm
    Reviewed-by: Jens Axboe
    Signed-off-by: Martin K. Petersen

    Matthew Wilcox
     
  • Introduce target_free_tag() and convert all drivers to use it.

    Signed-off-by: Matthew Wilcox
    Reviewed-by: Jens Axboe
    Signed-off-by: Martin K. Petersen

    Matthew Wilcox
     

13 Jun, 2018

2 commits

  • The kzalloc() function has a 2-factor argument form, kcalloc(). This
    patch replaces cases of:

    kzalloc(a * b, gfp)

    with:
    kcalloc(a * b, gfp)

    as well as handling cases of:

    kzalloc(a * b * c, gfp)

    with:

    kzalloc(array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    kzalloc_array(array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    kzalloc(4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    kzalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    kzalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    kzalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    - kzalloc
    + kcalloc
    (
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    kzalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    kzalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    kzalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    kzalloc(sizeof(THING) * C2, ...)
    |
    kzalloc(sizeof(TYPE) * C2, ...)
    |
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(C1 * C2, ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     
  • The kmalloc() function has a 2-factor argument form, kmalloc_array(). This
    patch replaces cases of:

    kmalloc(a * b, gfp)

    with:
    kmalloc_array(a * b, gfp)

    as well as handling cases of:

    kmalloc(a * b * c, gfp)

    with:

    kmalloc(array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    kmalloc_array(array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    kmalloc(4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The tools/ directory was manually excluded, since it has its own
    implementation of kmalloc().

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    kmalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    kmalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    kmalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    - kmalloc
    + kmalloc_array
    (
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    kmalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    kmalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kmalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kmalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    kmalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    kmalloc(C1 * C2 * C3, ...)
    |
    kmalloc(
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kmalloc(
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kmalloc(
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    kmalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    kmalloc(sizeof(THING) * C2, ...)
    |
    kmalloc(sizeof(TYPE) * C2, ...)
    |
    kmalloc(C1 * C2 * C3, ...)
    |
    kmalloc(C1 * C2, ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

01 Feb, 2018

1 commit

  • In commit ea5d404655ba ("vhost: fix release path lockdep checks"),
    Michael added a flag to check whether we should hold a lock in
    vhost_dev_cleanup(), however, in commit 47283bef7ed3 ("vhost: move
    memory pointer to VQs"), RCU operations have been replaced by
    mutex, we can remove the no-longer-used `locked' parameter now.

    Signed-off-by: Caspar Zhang
    Signed-off-by: Michael S. Tsirkin

    夷则(Caspar)
     

31 Jan, 2018

1 commit


18 Nov, 2017

1 commit

  • Pull iov_iter updates from Al Viro:

    - bio_{map,copy}_user_iov() series; those are cleanups - fixes from the
    same pile went into mainline (and stable) in late September.

    - fs/iomap.c iov_iter-related fixes

    - new primitive - iov_iter_for_each_range(), which applies a function
    to kernel-mapped segments of an iov_iter.

    Usable for kvec and bvec ones, the latter does kmap()/kunmap() around
    the callback. _Not_ usable for iovec- or pipe-backed iov_iter; the
    latter is not hard to fix if the need ever appears, the former is by
    design.

    Another related primitive will have to wait for the next cycle - it
    passes page + offset + size instead of pointer + size, and that one
    will be usable for everything _except_ kvec. Unfortunately, that one
    didn't get exposure in -next yet, so...

    - a bit more lustre iov_iter work, including a use case for
    iov_iter_for_each_range() (checksum calculation)

    - vhost/scsi leak fix in failure exit

    - misc cleanups and detritectomy...

    * 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (21 commits)
    iomap_dio_actor(): fix iov_iter bugs
    switch ksocknal_lib_recv_...() to use of iov_iter_for_each_range()
    lustre: switch struct ksock_conn to iov_iter
    vhost/scsi: switch to iov_iter_get_pages()
    fix a page leak in vhost_scsi_iov_to_sgl() error recovery
    new primitive: iov_iter_for_each_range()
    lnet_return_rx_credits_locked: don't abuse list_entry
    xen: don't open-code iov_iter_kvec()
    orangefs: remove detritus from struct orangefs_kiocb_s
    kill iov_shorten()
    bio_alloc_map_data(): do bmd->iter setup right there
    bio_copy_user_iov(): saner bio size calculation
    bio_map_user_iov(): get rid of copying iov_iter
    bio_copy_from_iter(): get rid of copying iov_iter
    move more stuff down into bio_copy_user_iov()
    blk_rq_map_user_iov(): move iov_iter_advance() down
    bio_map_user_iov(): get rid of the iov_for_each()
    bio_map_user_iov(): move alignment check into the main loop
    don't rely upon subsequent bio_add_pc_page() calls failing
    ... and with iov_iter_get_pages_alloc() it becomes even simpler
    ...

    Linus Torvalds
     

17 Nov, 2017

1 commit


15 Nov, 2017

1 commit


25 Oct, 2017

1 commit

  • …READ_ONCE()/WRITE_ONCE()

    Please do not apply this to mainline directly, instead please re-run the
    coccinelle script shown below and apply its output.

    For several reasons, it is desirable to use {READ,WRITE}_ONCE() in
    preference to ACCESS_ONCE(), and new code is expected to use one of the
    former. So far, there's been no reason to change most existing uses of
    ACCESS_ONCE(), as these aren't harmful, and changing them results in
    churn.

    However, for some features, the read/write distinction is critical to
    correct operation. To distinguish these cases, separate read/write
    accessors must be used. This patch migrates (most) remaining
    ACCESS_ONCE() instances to {READ,WRITE}_ONCE(), using the following
    coccinelle script:

    ----
    // Convert trivial ACCESS_ONCE() uses to equivalent READ_ONCE() and
    // WRITE_ONCE()

    // $ make coccicheck COCCI=/home/mark/once.cocci SPFLAGS="--include-headers" MODE=patch

    virtual patch

    @ depends on patch @
    expression E1, E2;
    @@

    - ACCESS_ONCE(E1) = E2
    + WRITE_ONCE(E1, E2)

    @ depends on patch @
    expression E;
    @@

    - ACCESS_ONCE(E)
    + READ_ONCE(E)
    ----

    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: davem@davemloft.net
    Cc: linux-arch@vger.kernel.org
    Cc: mpe@ellerman.id.au
    Cc: shuah@kernel.org
    Cc: snitzer@redhat.com
    Cc: thor.thayer@linux.intel.com
    Cc: tj@kernel.org
    Cc: viro@zeniv.linux.org.uk
    Cc: will.deacon@arm.com
    Link: http://lkml.kernel.org/r/1508792849-3115-19-git-send-email-paulmck@linux.vnet.ibm.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Mark Rutland
     

12 Oct, 2017

2 commits


14 Jul, 2017

1 commit

  • Pull SCSI target updates from Nicholas Bellinger:
    "It's been usually busy for summer, with most of the efforts centered
    around TCMU developments and various target-core + fabric driver bug
    fixing activities. Not particularly large in terms of LoC, but lots of
    smaller patches from many different folks.

    The highlights include:

    - ibmvscsis logical partition manager support (Michael Cyr + Bryant
    Ly)

    - Convert target/iblock WRITE_SAME to blkdev_issue_zeroout (hch +
    nab)

    - Add support for TMR percpu LUN reference counting (nab)

    - Fix a potential deadlock between EXTENDED_COPY and iscsi shutdown
    (Bart)

    - Fix COMPARE_AND_WRITE caw_sem leak during se_cmd quiesce (Jiang Yi)

    - Fix TMCU module removal (Xiubo Li)

    - Fix iser-target OOPs during login failure (Andrea Righi + Sagi)

    - Breakup target-core free_device backend driver callback (mnc)

    - Perform TCMU add/delete/reconfig synchronously (mnc)

    - Fix TCMU multiple UIO open/close sequences (mnc)

    - Fix TCMU CHECK_CONDITION sense handling (mnc)

    - Fix target-core SAM_STAT_BUSY + TASK_SET_FULL handling (mnc + nab)

    - Introduce TYPE_ZBC support in PSCSI (Damien Le Moal)

    - Fix possible TCMU memory leak + OOPs when recalculating cmd base
    size (Xiubo Li + Bryant Ly + Damien Le Moal + mnc)

    - Add login_keys_workaround attribute for non RFC initiators (Robert
    LeBlanc + Arun Easi + nab)"

    * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (68 commits)
    iscsi-target: Add login_keys_workaround attribute for non RFC initiators
    Revert "qla2xxx: Fix incorrect tcm_qla2xxx_free_cmd use during TMR ABORT"
    tcmu: clean up the code and with one small fix
    tcmu: Fix possbile memory leak / OOPs when recalculating cmd base size
    target: export lio pgr/alua support as device attr
    target: Fix return sense reason in target_scsi3_emulate_pr_out
    target: Fix cmd size for PR-OUT in passthrough_parse_cdb
    tcmu: Fix dev_config_store
    target: pscsi: Introduce TYPE_ZBC support
    target: Use macro for WRITE_VERIFY_32 operation codes
    target: fix SAM_STAT_BUSY/TASK_SET_FULL handling
    target: remove transport_complete
    pscsi: finish cmd processing from pscsi_req_done
    tcmu: fix sense handling during completion
    target: add helper to copy sense to se_cmd buffer
    target: do not require a transport_complete for SCF_TRANSPORT_TASK_SENSE
    target: make device_mutex and device_list static
    tcmu: Fix flushing cmd entry dcache page
    tcmu: fix multiple uio open/close sequences
    tcmu: drop configured check in destroy
    ...

    Linus Torvalds
     

13 Jul, 2017

1 commit

  • __GFP_REPEAT was designed to allow retry-but-eventually-fail semantic to
    the page allocator. This has been true but only for allocations
    requests larger than PAGE_ALLOC_COSTLY_ORDER. It has been always
    ignored for smaller sizes. This is a bit unfortunate because there is
    no way to express the same semantic for those requests and they are
    considered too important to fail so they might end up looping in the
    page allocator for ever, similarly to GFP_NOFAIL requests.

    Now that the whole tree has been cleaned up and accidental or misled
    usage of __GFP_REPEAT flag has been removed for !costly requests we can
    give the original flag a better name and more importantly a more useful
    semantic. Let's rename it to __GFP_RETRY_MAYFAIL which tells the user
    that the allocator would try really hard but there is no promise of a
    success. This will work independent of the order and overrides the
    default allocator behavior. Page allocator users have several levels of
    guarantee vs. cost options (take GFP_KERNEL as an example)

    - GFP_KERNEL & ~__GFP_RECLAIM - optimistic allocation without _any_
    attempt to free memory at all. The most light weight mode which even
    doesn't kick the background reclaim. Should be used carefully because
    it might deplete the memory and the next user might hit the more
    aggressive reclaim

    - GFP_KERNEL & ~__GFP_DIRECT_RECLAIM (or GFP_NOWAIT)- optimistic
    allocation without any attempt to free memory from the current
    context but can wake kswapd to reclaim memory if the zone is below
    the low watermark. Can be used from either atomic contexts or when
    the request is a performance optimization and there is another
    fallback for a slow path.

    - (GFP_KERNEL|__GFP_HIGH) & ~__GFP_DIRECT_RECLAIM (aka GFP_ATOMIC) -
    non sleeping allocation with an expensive fallback so it can access
    some portion of memory reserves. Usually used from interrupt/bh
    context with an expensive slow path fallback.

    - GFP_KERNEL - both background and direct reclaim are allowed and the
    _default_ page allocator behavior is used. That means that !costly
    allocation requests are basically nofail but there is no guarantee of
    that behavior so failures have to be checked properly by callers
    (e.g. OOM killer victim is allowed to fail currently).

    - GFP_KERNEL | __GFP_NORETRY - overrides the default allocator behavior
    and all allocation requests fail early rather than cause disruptive
    reclaim (one round of reclaim in this implementation). The OOM killer
    is not invoked.

    - GFP_KERNEL | __GFP_RETRY_MAYFAIL - overrides the default allocator
    behavior and all allocation requests try really hard. The request
    will fail if the reclaim cannot make any progress. The OOM killer
    won't be triggered.

    - GFP_KERNEL | __GFP_NOFAIL - overrides the default allocator behavior
    and all allocation requests will loop endlessly until they succeed.
    This might be really dangerous especially for larger orders.

    Existing users of __GFP_REPEAT are changed to __GFP_RETRY_MAYFAIL
    because they already had their semantic. No new users are added.
    __alloc_pages_slowpath is changed to bail out for __GFP_RETRY_MAYFAIL if
    there is no progress and we have already passed the OOM point.

    This means that all the reclaim opportunities have been exhausted except
    the most disruptive one (the OOM killer) and a user defined fallback
    behavior is more sensible than keep retrying in the page allocator.

    [akpm@linux-foundation.org: fix arch/sparc/kernel/mdesc.c]
    [mhocko@suse.com: semantic fix]
    Link: http://lkml.kernel.org/r/20170626123847.GM11534@dhcp22.suse.cz
    [mhocko@kernel.org: address other thing spotted by Vlastimil]
    Link: http://lkml.kernel.org/r/20170626124233.GN11534@dhcp22.suse.cz
    Link: http://lkml.kernel.org/r/20170623085345.11304-3-mhocko@kernel.org
    Signed-off-by: Michal Hocko
    Acked-by: Vlastimil Babka
    Cc: Alex Belits
    Cc: Chris Wilson
    Cc: Christoph Hellwig
    Cc: Darrick J. Wong
    Cc: David Daney
    Cc: Johannes Weiner
    Cc: Mel Gorman
    Cc: NeilBrown
    Cc: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Hocko
     

09 Jun, 2017

1 commit


20 Jan, 2017

2 commits

  • This is to silence an uninitialized variable warning in debug output.
    The problem is this line:

    pr_debug("vhost_get_vq_desc: head: %d, out: %u in: %u\n",
    head, out, in);

    If "head == vq->num" is true on the first iteration then "out" and "in"
    aren't initialized. We handle that a few lines after the printk. I was
    tempted to just delete the pr_debug() but I decided to just initialize
    them to zero instead.

    Also checkpatch.pl complains if variables are declared as just
    "unsigned" without the "int".

    Signed-off-by: Dan Carpenter
    Signed-off-by: Michael S. Tsirkin

    Dan Carpenter
     
  • Declare target_core_fabric_ops strucrues as const as they are only
    passed as an argument to the functions target_register_template and
    target_unregister_template. The arguments are of type const struct
    target_core_fabric_ops *, so target_core_fabric_ops structures having
    this property can be declared const.
    Done using Coccinelle:

    @r disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct target_core_fabric_ops i@p={...};

    @ok@
    position p;
    identifier r.i;
    @@
    (
    target_register_template(&i@p)
    |
    target_unregister_template(&i@p)
    )
    @bad@
    position p!={r.p,ok.p};
    identifier r.i;
    @@
    i@p

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    +const
    struct target_core_fabric_ops i;

    File size before: drivers/vhost/scsi.o
    text data bss dec hex filename
    18063 2985 40 21088 5260 drivers/vhost/scsi.o

    File size after: drivers/vhost/scsi.o
    text data bss dec hex filename
    18479 2601 40 21120 5280 drivers/vhost/scsi.o

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Michael S. Tsirkin
    Acked-by: Jason Wang

    Bhumika Goyal
     

17 Dec, 2016

1 commit

  • Pull vfs updates from Al Viro:

    - more ->d_init() stuff (work.dcache)

    - pathname resolution cleanups (work.namei)

    - a few missing iov_iter primitives - copy_from_iter_full() and
    friends. Either copy the full requested amount, advance the iterator
    and return true, or fail, return false and do _not_ advance the
    iterator. Quite a few open-coded callers converted (and became more
    readable and harder to fuck up that way) (work.iov_iter)

    - several assorted patches, the big one being logfs removal

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    logfs: remove from tree
    vfs: fix put_compat_statfs64() does not handle errors
    namei: fold should_follow_link() with the step into not-followed link
    namei: pass both WALK_GET and WALK_MORE to should_follow_link()
    namei: invert WALK_PUT logics
    namei: shift interpretation of LOOKUP_FOLLOW inside should_follow_link()
    namei: saner calling conventions for mountpoint_last()
    namei.c: get rid of user_path_parent()
    switch getfrag callbacks to ..._full() primitives
    make skb_add_data,{_nocache}() and skb_copy_to_page_nocache() advance only on success
    [iov_iter] new primitives - copy_from_iter_full() and friends
    don't open-code file_inode()
    ceph: switch to use of ->d_init()
    ceph: unify dentry_operations instances
    lustre: switch to use of ->d_init()

    Linus Torvalds
     

16 Dec, 2016

1 commit

  • Remove the unused but set variable se_tpg in vhost_scsi_nexus_cb() to
    fix the following GCC warning when building with 'W=1':

    drivers/vhost/scsi.c:1752:26: warning: variable ‘se_tpg’ set but not used

    Signed-off-by: Tobias Klauser
    Signed-off-by: Michael S. Tsirkin

    Tobias Klauser
     

06 Dec, 2016

1 commit

  • copy_from_iter_full(), copy_from_iter_full_nocache() and
    csum_and_copy_from_iter_full() - counterparts of copy_from_iter()
    et.al., advancing iterator only in case of successful full copy
    and returning whether it had been successful or not.

    Convert some obvious users. *NOTE* - do not blindly assume that
    something is a good candidate for those unless you are sure that
    not advancing iov_iter in failure case is the right thing in
    this case. Anything that does short read/short write kind of
    stuff (or is in a loop, etc.) is unlikely to be a good one.

    Signed-off-by: Al Viro

    Al Viro
     

23 Aug, 2016

1 commit

  • The address of the iovec &vq->iov[out] is not guaranteed to contain the scsi
    command's response iovec throughout the lifetime of the command. Rather, it
    is more likely to contain an iovec from an immediately following command
    after looping back around to vhost_get_vq_desc(). Pass along the iovec
    entirely instead.

    Fixes: 79c14141a487 ("vhost/scsi: Convert completion path to use copy_to_iter")
    Cc: stable@vger.kernel.org
    Signed-off-by: Benjamin Coddington
    Signed-off-by: Michael S. Tsirkin

    Benjamin Coddington
     

10 May, 2016

2 commits

  • Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • Turns out the template and thus many drivers got the return value wrong:
    0 means the fabrics driver needs to put a session reference, which no
    driver except for the iSCSI target drivers did. Fortunately none of these
    drivers supports explicit Node ACLs, so the bug was harmless.

    Even without that only qla2xxx and iscsi every did real work in
    shutdown_session, so get rid of the boilerplate code in all other
    drivers.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     

23 Mar, 2016

1 commit

  • Pull SCSI target updates from Nicholas Bellinger:
    "The highlights this round include:

    - Add target_alloc_session() w/ callback helper for doing se_session
    allocation + tag + se_node_acl lookup. (HCH + nab)

    - Tree-wide fabric driver conversion to use target_alloc_session()

    - Convert sbp-target to use percpu_ida tag pre-allocation, and
    TARGET_SCF_ACK_KREF I/O krefs (Chris Boot + nab)

    - Convert usb-gadget to use percpu_ida tag pre-allocation, and
    TARGET_SCF_ACK_KREF I/O krefs (Andrzej Pietrasiewicz + nab)

    - Convert xen-scsiback to use percpu_ida tag pre-allocation, and
    TARGET_SCF_ACK_KREF I/O krefs (Juergen Gross + nab)

    - Convert tcm_fc to use TARGET_SCF_ACK_KREF I/O + TMR krefs

    - Convert ib_srpt to use percpu_ida tag pre-allocation

    - Add DebugFS node for qla2xxx target sess list (Quinn)

    - Rework iser-target connection termination (Jenny + Sagi)

    - Convert iser-target to new CQ API (HCH)

    - Add pass-through WRITE_SAME support for IBLOCK (Mike Christie)

    - Introduce data_bitmap for asynchronous access of data area (Sheng
    Yang + Andy)

    - Fix target_release_cmd_kref shutdown comp leak (Himanshu Madhani)

    Also, there is a separate PULL request coming for cxgb4 NIC driver
    prerequisites for supporting hw iscsi segmentation offload (ISO), that
    will be the base for a number of v4.7 developments involving
    iscsi-target hw offloads"

    * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (36 commits)
    target: Fix target_release_cmd_kref shutdown comp leak
    target: Avoid DataIN transfers for non-GOOD SAM status
    target/user: Report capability of handling out-of-order completions to userspace
    target/user: Fix size_t format-spec build warning
    target/user: Don't free expired command when time out
    target/user: Introduce data_bitmap, replace data_length/data_head/data_tail
    target/user: Free data ring in unified function
    target/user: Use iovec[] to describe continuous area
    target: Remove enum transport_lunflags_table
    target/iblock: pass WRITE_SAME to device if possible
    iser-target: Kill the ->isert_cmd back pointer in struct iser_tx_desc
    iser-target: Kill struct isert_rdma_wr
    iser-target: Convert to new CQ API
    iser-target: Split and properly type the login buffer
    iser-target: Remove ISER_RECV_DATA_SEG_LEN
    iser-target: Remove impossible condition from isert_wait_conn
    iser-target: Remove redundant wait in release_conn
    iser-target: Rework connection termination
    iser-target: Separate flows for np listeners and connections cma events
    iser-target: Add new state ISER_CONN_BOUND to isert_conn
    ...

    Linus Torvalds
     

11 Mar, 2016

1 commit


02 Mar, 2016

1 commit

  • Looking at how callers use this, maybe we should just rename init_used
    to vhost_vq_init_access. The _used suffix was a hint that we
    access the vq used ring. But maybe what callers care about is
    that it must be called after access_ok.

    Also, this function manipulates the vq->is_le field which isn't related
    to the vq used ring.

    This patch simply renames vhost_init_used() to vhost_vq_init_access() as
    suggested by Michael.

    No behaviour change.

    Signed-off-by: Greg Kurz
    Signed-off-by: Michael S. Tsirkin

    Greg Kurz
     

14 Nov, 2015

1 commit

  • Pull SCSI target updates from Nicholas Bellinger:
    "This series contains HCH's changes to absorb configfs attribute
    ->show() + ->store() function pointer usage from it's original
    tree-wide consumers, into common configfs code.

    It includes usb-gadget, target w/ drivers, netconsole and ocfs2
    changes to realize the improved simplicity, that now renders the
    original include/target/configfs_macros.h CPP magic for fabric drivers
    and others, unnecessary and obsolete.

    And with common code in place, new configfs attributes can be added
    easier than ever before.

    Note, there are further improvements in-flight from other folks for
    v4.5 code in configfs land, plus number of target fixes for post -rc1
    code"

    In the meantime, a new user of the now-removed old configfs API came in
    through the char/misc tree in commit 7bd1d4093c2f ("stm class: Introduce
    an abstraction for System Trace Module devices").

    This merge resolution comes from Alexander Shishkin, who updated his stm
    class tracing abstraction to account for the removal of the old
    show_attribute and store_attribute methods in commit 517982229f78
    ("configfs: remove old API") from this pull. As Alexander says about
    that patch:

    "There's no need to keep an extra wrapper structure per item and the
    awkward show_attribute/store_attribute item ops are no longer needed.

    This patch converts policy code to the new api, all the while making
    the code quite a bit smaller and easier on the eyes.

    Signed-off-by: Alexander Shishkin "

    That patch was folded into the merge so that the tree should be fully
    bisectable.

    * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (23 commits)
    configfs: remove old API
    ocfs2/cluster: use per-attribute show and store methods
    ocfs2/cluster: move locking into attribute store methods
    netconsole: use per-attribute show and store methods
    target: use per-attribute show and store methods
    spear13xx_pcie_gadget: use per-attribute show and store methods
    dlm: use per-attribute show and store methods
    usb-gadget/f_serial: use per-attribute show and store methods
    usb-gadget/f_phonet: use per-attribute show and store methods
    usb-gadget/f_obex: use per-attribute show and store methods
    usb-gadget/f_uac2: use per-attribute show and store methods
    usb-gadget/f_uac1: use per-attribute show and store methods
    usb-gadget/f_mass_storage: use per-attribute show and store methods
    usb-gadget/f_sourcesink: use per-attribute show and store methods
    usb-gadget/f_printer: use per-attribute show and store methods
    usb-gadget/f_midi: use per-attribute show and store methods
    usb-gadget/f_loopback: use per-attribute show and store methods
    usb-gadget/ether: use per-attribute show and store methods
    usb-gadget/f_acm: use per-attribute show and store methods
    usb-gadget/f_hid: use per-attribute show and store methods
    ...

    Linus Torvalds
     

14 Oct, 2015

1 commit

  • This also allows to remove the target-specific old configfs macros, and
    gets rid of the target_core_fabric_configfs.h header which only had one
    function declaration left that could be moved to a better place.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Nicholas Bellinger
    Acked-by: Nicholas Bellinger
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     

19 Sep, 2015

1 commit


16 Sep, 2015

1 commit


06 Aug, 2015

1 commit

  • With well over 200+ users of this api, there are a mere 12 users that
    actually checked the return value of this function. And all of them
    really didn't do anything with that information as the system or module
    was shutting down no matter what.

    So stop pretending like it matters, and just return void from
    misc_deregister(). If something goes wrong in the call, you will get a
    WARNING splat in the syslog so you know how to fix up your driver.
    Other than that, there's nothing that can go wrong.

    Cc: Alasdair Kergon
    Cc: Neil Brown
    Cc: Oleg Drokin
    Cc: Andreas Dilger
    Cc: "Michael S. Tsirkin"
    Cc: Wim Van Sebroeck
    Cc: Christine Caulfield
    Cc: David Teigland
    Cc: Mark Fasheh
    Acked-by: Joel Becker
    Acked-by: Alexandre Belloni
    Acked-by: Alessandro Zummo
    Acked-by: Mike Snitzer
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman