1. 25 1月, 2021 1 次提交
    • C
      block: add a hard-readonly flag to struct gendisk · 52f019d4
      Christoph Hellwig 提交于
      Commit 20bd1d02 ("scsi: sd: Keep disk read-only when re-reading
      partition") addressed a long-standing problem with user read-only
      policy being overridden as a result of a device-initiated revalidate.
      The commit has since been reverted due to a regression that left some
      USB devices read-only indefinitely.
      
      To fix the underlying problems with revalidate we need to keep track
      of hardware state and user policy separately.
      
      The gendisk has been updated to reflect the current hardware state set
      by the device driver. This is done to allow returning the device to
      the hardware state once the user clears the BLKROSET flag.
      
      The resulting semantics are as follows:
      
       - If BLKROSET sets a given partition read-only, that partition will
         remain read-only even if the underlying storage stack initiates a
         revalidate. However, the BLKRRPART ioctl will cause the partition
         table to be dropped and any user policy on partitions will be lost.
      
       - If BLKROSET has not been set, both the whole disk device and any
         partitions will reflect the current write-protect state of the
         underlying device.
      
      Based on a patch from Martin K. Petersen <martin.petersen@oracle.com>.
      Reported-by: NOleksii Kurochko <olkuroch@cisco.com>
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201221Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NMing Lei <ming.lei@redhat.com>
      Reviewed-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      52f019d4
  2. 02 12月, 2020 16 次提交
  3. 16 11月, 2020 4 次提交
  4. 13 11月, 2020 1 次提交
  5. 24 9月, 2020 1 次提交
  6. 10 9月, 2020 2 次提交
  7. 02 9月, 2020 6 次提交
  8. 18 7月, 2020 1 次提交
    • B
      blk-cgroup: show global disk stats in root cgroup io.stat · ef45fe47
      Boris Burkov 提交于
      In order to improve consistency and usability in cgroup stat accounting,
      we would like to support the root cgroup's io.stat.
      
      Since the root cgroup has processes doing io even if the system has no
      explicitly created cgroups, we need to be careful to avoid overhead in
      that case.  For that reason, the rstat algorithms don't handle the root
      cgroup, so just turning the file on wouldn't give correct statistics.
      
      To get around this, we simulate flushing the iostat struct by filling it
      out directly from global disk stats. The result is a root cgroup io.stat
      file consistent with both /proc/diskstats and io.stat.
      
      Note that in order to collect the disk stats, we needed to iterate over
      devices. To facilitate that, we had to change the linkage of a disk_type
      to external so that it can be used from blk-cgroup.c to iterate over
      disks.
      Suggested-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NBoris Burkov <boris@bur.io>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      ef45fe47
  9. 24 6月, 2020 2 次提交
  10. 27 5月, 2020 2 次提交
  11. 13 5月, 2020 2 次提交
  12. 05 5月, 2020 1 次提交
  13. 21 4月, 2020 1 次提交