1. 29 6月, 2017 1 次提交
  2. 26 4月, 2017 2 次提交
  3. 25 4月, 2017 2 次提交
  4. 09 4月, 2017 6 次提交
  5. 08 4月, 2017 2 次提交
  6. 07 4月, 2017 2 次提交
  7. 09 3月, 2017 1 次提交
  8. 02 3月, 2017 1 次提交
    • D
      scsi: sd: Check for unaligned partial completion · c46f0917
      Damien Le Moal 提交于
      Commit <f2e767bb> ("mpt3sas: Force request partial completion
      alignment") was not considering the case of commands not operating on
      logical block size units (e.g. REQ_OP_ZONE_REPORT and its 64B aligned
      partial replies). In this case, forcing alignment of resid to the device
      logical block size can break the command result, e.g. in the case of
      REQ_OP_ZONE_REPORT, the exact number of zone reported by the device.
      
      Move the partial completion alignement check of mpt3sas to a generic
      implementation in sd_done(). The check is added within the default
      section of the initial req_op() switch case so that the report and reset
      zone commands are ignored. In addition, as sd_done() is not called for
      passthrough requests, resid corrections are not done as intended by the
      initial mpt3sas patch.
      
      Fixes: f2e767bb ("mpt3sas: Force request partial completion alignment")
      Cc: <stable@vger.kernel.org> # v4.10
      Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      c46f0917
  9. 24 2月, 2017 1 次提交
  10. 23 2月, 2017 3 次提交
  11. 02 2月, 2017 1 次提交
    • D
      scsi, block: fix duplicate bdi name registration crashes · 0dba1314
      Dan Williams 提交于
      Warnings of the following form occur because scsi reuses a devt number
      while the block layer still has it referenced as the name of the bdi
      [1]:
      
       WARNING: CPU: 1 PID: 93 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x62/0x80
       sysfs: cannot create duplicate filename '/devices/virtual/bdi/8:192'
       [..]
       Call Trace:
        dump_stack+0x86/0xc3
        __warn+0xcb/0xf0
        warn_slowpath_fmt+0x5f/0x80
        ? kernfs_path_from_node+0x4f/0x60
        sysfs_warn_dup+0x62/0x80
        sysfs_create_dir_ns+0x77/0x90
        kobject_add_internal+0xb2/0x350
        kobject_add+0x75/0xd0
        device_add+0x15a/0x650
        device_create_groups_vargs+0xe0/0xf0
        device_create_vargs+0x1c/0x20
        bdi_register+0x90/0x240
        ? lockdep_init_map+0x57/0x200
        bdi_register_owner+0x36/0x60
        device_add_disk+0x1bb/0x4e0
        ? __pm_runtime_use_autosuspend+0x5c/0x70
        sd_probe_async+0x10d/0x1c0
        async_run_entry_fn+0x39/0x170
      
      This is a brute-force fix to pass the devt release information from
      sd_probe() to the locations where we register the bdi,
      device_add_disk(), and unregister the bdi, blk_cleanup_queue().
      
      Thanks to Omar for the quick reproducer script [2]. This patch survives
      where an unmodified kernel fails in a few seconds.
      
      [1]: https://marc.info/?l=linux-scsi&m=147116857810716&w=4
      [2]: http://marc.info/?l=linux-block&m=148554717109098&w=2
      
      Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
      Cc: Bart Van Assche <bart.vanassche@sandisk.com>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Jan Kara <jack@suse.cz>
      Reported-by: NOmar Sandoval <osandov@osandov.com>
      Tested-by: NOmar Sandoval <osandov@fb.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      0dba1314
  12. 01 2月, 2017 1 次提交
  13. 28 1月, 2017 1 次提交
  14. 27 1月, 2017 1 次提交
    • B
      Revert "sd: remove __data_len hack for WRITE SAME" · 08965c2e
      Bart Van Assche 提交于
      This patch reverts commit f80de881 and avoids that sending a
      WRITE SAME command to the iSCSI initiator triggers the following:
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000014
      TARGET_CORE[iSCSI]: Expected Transfer Length: 260096 does not match SCSI CDB Length: 512 for SAM Opcode: 0x41
      IP: iscsi_tcp_segment_done+0x20b/0x310 [libiscsi_tcp]
      
      Oops: 0000 [#1] SMP
      Modules linked in: target_core_user uio target_core_iblock target_core_file iscsi_target_mod target_core_mod netconsole configfs crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel aes_x86_64 crypto_simd cryptd glue_helper virtio_console virtio_rng virtio_balloon serio_raw i2c_piix4 acpi_cpufreq button iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ext4 jbd2 mbcache virtio_blk virtio_net psmouse floppy drm_kms_helper syscopyarea
      sysfillrect sysimgblt fb_sys_fops ttm drm virtio_pci
      CPU: 2 PID: 5 Comm: kworker/u8:0 Not tainted 4.10.0-rc5-debug+ #3
      Workqueue: iscsi_q_0 iscsi_xmitworker [libiscsi]
      RIP: 0010:iscsi_tcp_segment_done+0x20b/0x310 [libiscsi_tcp]
      Call Trace:
       iscsi_sw_tcp_xmit_segment+0x84/0x120 [iscsi_tcp]
       iscsi_sw_tcp_pdu_xmit+0x51/0x180 [iscsi_tcp]
       iscsi_tcp_task_xmit+0xb3/0x290 [libiscsi_tcp]
       iscsi_xmit_task+0x4e/0xc0 [libiscsi]
       iscsi_xmitworker+0x243/0x330 [libiscsi]
       process_one_work+0x1d8/0x4b0
       worker_thread+0x49/0x4a0
       kthread+0x102/0x140
      
      Fixes: f80de881 ("sd: remove __data_len hack for WRITE SAME")
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Hannes Reinecke <hare@suse.com>
      Cc: Sagi Grimberg <sagi@grimberg.me>
      Cc: Jens Axboe <axboe@fb.com>
      Cc: Lee Duncan <lduncan@suse.com>
      Cc: Chris Leech <cleech@redhat.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Acked-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      08965c2e
  15. 21 1月, 2017 1 次提交
  16. 18 1月, 2017 2 次提交
  17. 14 1月, 2017 1 次提交
  18. 25 12月, 2016 1 次提交
  19. 09 12月, 2016 1 次提交
    • C
      block: improve handling of the magic discard payload · f9d03f96
      Christoph Hellwig 提交于
      Instead of allocating a single unused biovec for discard requests, send
      them down without any payload.  Instead we allow the driver to add a
      "special" payload using a biovec embedded into struct request (unioned
      over other fields never used while in the driver), and overloading
      the number of segments for this case.
      
      This has a couple of advantages:
      
       - we don't have to allocate the bio_vec
       - the amount of special casing for discard requests in the block
         layer is significantly reduced
       - using this same scheme for other request types is trivial,
         which will be important for implementing the new WRITE_ZEROES
         op on devices where it actually requires a payload (e.g. SCSI)
       - we can get rid of playing games with the request length, as
         we'll never touch it and completions will work just fine
       - it will allow us to support ranged discard operations in the
         future by merging non-contiguous discard bios into a single
         request
       - last but not least it removes a lot of code
      
      This patch is the common base for my WIP series for ranges discards and to
      remove discard_zeroes_data in favor of always using REQ_OP_WRITE_ZEROES,
      so it would be good to get it in quickly.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      f9d03f96
  20. 09 11月, 2016 1 次提交
  21. 28 10月, 2016 2 次提交
    • C
      block: better op and flags encoding · ef295ecf
      Christoph Hellwig 提交于
      Now that we don't need the common flags to overflow outside the range
      of a 32-bit type we can encode them the same way for both the bio and
      request fields.  This in addition allows us to place the operation
      first (and make some room for more ops while we're at it) and to
      stop having to shift around the operation values.
      
      In addition this allows passing around only one value in the block layer
      instead of two (and eventuall also in the file systems, but we can do
      that later) and thus clean up a lot of code.
      
      Last but not least this allows decreasing the size of the cmd_flags
      field in struct request to 32-bits.  Various functions passing this
      value could also be updated, but I'd like to avoid the churn for now.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      ef295ecf
    • C
      block: split out request-only flags into a new namespace · e8064021
      Christoph Hellwig 提交于
      A lot of the REQ_* flags are only used on struct requests, and only of
      use to the block layer and a few drivers that dig into struct request
      internals.
      
      This patch adds a new req_flags_t rq_flags field to struct request for
      them, and thus dramatically shrinks the number of common requests.  It
      also removes the unfortunate situation where we have to fit the fields
      from the same enum into 32 bits for struct bio and 64 bits for
      struct request.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NShaun Tancheff <shaun.tancheff@seagate.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      e8064021
  22. 19 10月, 2016 1 次提交
    • H
      sd: Implement support for ZBC devices · 89d94756
      Hannes Reinecke 提交于
      Implement ZBC support functions to setup zoned disks, both
      host-managed and host-aware models. Only zoned disks that satisfy
      the following conditions are supported:
      1) All zones are the same size, with the exception of an eventual
         last smaller runt zone.
      2) For host-managed disks, reads are unrestricted (reads are not
         failed due to zone or write pointer alignement constraints).
      Zoned disks that do not satisfy these 2 conditions are setup with
      a capacity of 0 to prevent their use.
      
      The function sd_zbc_read_zones, called from sd_revalidate_disk,
      checks that the device satisfies the above two constraints. This
      function may also change the disk capacity previously set by
      sd_read_capacity for devices reporting only the capacity of
      conventional zones at the beginning of the LBA range (i.e. devices
      reporting rc_basis set to 0).
      
      The capacity message output was moved out of sd_read_capacity into
      a new function sd_print_capacity to include this eventual capacity
      change by sd_zbc_read_zones. This new function also includes a call
      to sd_zbc_print_zones to display the number of zones and zone size
      of the device.
      Signed-off-by: NHannes Reinecke <hare@suse.de>
      
      [Damien: * Removed zone cache support
               * Removed mapping of discard to reset write pointer command
               * Modified sd_zbc_read_zones to include checks that the
                 device satisfies the kernel constraints
               * Implemeted REPORT ZONES setup and post-processing based
                 on code from Shaun Tancheff <shaun.tancheff@seagate.com>
               * Removed confusing use of 512B sector units in functions
                 interface]
      Signed-off-by: NDamien Le Moal <damien.lemoal@hgst.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NShaun Tancheff <shaun.tancheff@seagate.com>
      Tested-by: NShaun Tancheff <shaun.tancheff@seagate.com>
      Acked-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      89d94756
  23. 15 9月, 2016 1 次提交
  24. 19 7月, 2016 1 次提交
  25. 28 6月, 2016 1 次提交
    • D
      block: convert to device_add_disk() · 0d52c756
      Dan Williams 提交于
      For block drivers that specify a parent device, convert them to use
      device_add_disk().
      
      This conversion was done with the following semantic patch:
      
          @@
          struct gendisk *disk;
          expression E;
          @@
      
          - disk->driverfs_dev = E;
          ...
          - add_disk(disk);
          + device_add_disk(E, disk);
      
          @@
          struct gendisk *disk;
          expression E1, E2;
          @@
      
          - disk->driverfs_dev = E1;
          ...
          E2 = disk;
          ...
          - add_disk(E2);
          + device_add_disk(E1, E2);
      
      ...plus some manual fixups for a few missed conversions.
      
      Cc: Jens Axboe <axboe@fb.com>
      Cc: Keith Busch <keith.busch@intel.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      0d52c756
  26. 08 6月, 2016 2 次提交