1. 26 11月, 2015 1 次提交
  2. 12 11月, 2015 1 次提交
    • G
      sd: Clear PS bit before Mode Select. · 2c5d16d6
      Gabriel Krisman Bertazi 提交于
      According to SPC-4, in a Mode Select, the PS bit in Mode Pages is
      reserved and must be set to 0 by the driver.  In the sd implementation,
      function cache_type_store does a Mode Sense, which might set the PS bit
      on the read buffer, followed by a Mode Select, which receives the same
      buffer, without explicitly clearing the PS bit.  So, in cases where
      target supports saving the Mode Page to a non-volatile location, we end
      up doing a Mode Select with the PS bit set, which could cause an illegal
      request error if the target is checking this.
      
      This was observed on a new firmware change, which was subsequently
      reverted, but this changes sd.c to be more compliant with SPC-4.
      
      This patch clears the PS bit in the buffer returned by Mode Select,
      right before it is used in the Mode Select command.
      Signed-off-by: NGabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      2c5d16d6
  3. 13 8月, 2015 1 次提交
  4. 17 7月, 2015 1 次提交
  5. 25 5月, 2015 1 次提交
  6. 19 5月, 2015 1 次提交
  7. 17 4月, 2015 1 次提交
  8. 11 4月, 2015 1 次提交
    • J
      sd, mmc, virtio_blk, string_helpers: fix block size units · b9f28d86
      James Bottomley 提交于
      The current string_get_size() overflows when the device size goes over
      2^64 bytes because the string helper routine computes the suffix from
      the size in bytes.  However, the entirety of Linux thinks in terms of
      blocks, not bytes, so this will artificially induce an overflow on very
      large devices.  Fix this by making the function string_get_size() take
      blocks and the block size instead of bytes.  This should allow us to
      keep working until the current SCSI standard overflows.
      
      Also fix virtio_blk and mmc (both of which were also artificially
      multiplying by the block size to pass a byte side to string_get_size()).
      
      The mathematics of this is pretty simple:  we're taking a product of
      size in blocks (S) and block size (B) and trying to re-express this in
      exponential form: S*B = R*N^E (where N, the exponent is either 1000 or
      1024) and R < N.  Mathematically, S = RS*N^ES and B=RB*N^EB, so if RS*RB
      < N it's easy to see that S*B = RS*RB*N^(ES+EB).  However, if RS*BS > N,
      we can see that this can be re-expressed as RS*BS = R*N (where R =
      RS*BS/N < N) so the whole exponent becomes R*N^(ES+EB+1)
      
      [jejb: fix incorrect 32 bit do_div spotted by kbuild test robot <fengguang.wu@intel.com>]
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      b9f28d86
  9. 19 3月, 2015 1 次提交
  10. 02 2月, 2015 1 次提交
  11. 09 1月, 2015 1 次提交
  12. 30 12月, 2014 1 次提交
  13. 25 11月, 2014 3 次提交
  14. 12 11月, 2014 6 次提交
  15. 05 10月, 2014 1 次提交
    • M
      block: disable entropy contributions for nonrot devices · b277da0a
      Mike Snitzer 提交于
      Clear QUEUE_FLAG_ADD_RANDOM in all block drivers that set
      QUEUE_FLAG_NONROT.
      
      Historically, all block devices have automatically made entropy
      contributions.  But as previously stated in commit e2e1a148 ("block: add
      sysfs knob for turning off disk entropy contributions"):
          - On SSD disks, the completion times aren't as random as they
            are for rotational drives. So it's questionable whether they
            should contribute to the random pool in the first place.
          - Calling add_disk_randomness() has a lot of overhead.
      
      There are more reliable sources for randomness than non-rotational block
      devices.  From a security perspective it is better to err on the side of
      caution than to allow entropy contributions from unreliable "random"
      sources.
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      b277da0a
  16. 01 10月, 2014 1 次提交
  17. 16 9月, 2014 2 次提交
  18. 26 7月, 2014 3 次提交
  19. 18 7月, 2014 12 次提交