1. 06 1月, 2016 1 次提交
  2. 25 9月, 2015 1 次提交
    • G
      cdrom: Random writing support for BD-RE media · f7e7868b
      Georgios Toptsidis 提交于
      Recently, i bought a blu-ray writer and noticed that while cdrecord
      worked perfectly, random writing didn't work on rewritable bd-re media.
      For example, dd if=/dev/zero of=/dev/sr0 bs=32768 count=2 gave the usual
      "read-only file system" message.
      
      After checking if the problem lies with my burner or firmware, i grep-ed
      the kernel source for EROFS. One of the results was in the cdrom driver.
      
      I tried to follow the function chain and ended in the cdrom_is_dvd_rw
      function where writing is permitted only for DVD-RAM and DVD+RW media.
      I added a new case label for 0x43 which is the profile name of BD-RE
      and now it works correctly for BD-RE too.
      
      Maybe there is a better way of implementing this, like a new function
      checking for blu-ray support and called from cdrom_open_write like
      it happens for mrw and dvdram media, but adding the case label worked.
      
      Thank you for your time.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      f7e7868b
  3. 29 8月, 2014 1 次提交
    • J
      block,scsi: fixup blk_get_request dead queue scenarios · a492f075
      Joe Lawrence 提交于
      The blk_get_request function may fail in low-memory conditions or during
      device removal (even if __GFP_WAIT is set). To distinguish between these
      errors, modify the blk_get_request call stack to return the appropriate
      ERR_PTR. Verify that all callers check the return status and consider
      IS_ERR instead of a simple NULL pointer check.
      
      For consistency, make a similar change to the blk_mq_alloc_request leg
      of blk_get_request.  It may fail if the queue is dead, or the caller was
      unwilling to wait.
      Signed-off-by: NJoe Lawrence <joe.lawrence@stratus.com>
      Acked-by: Jiri Kosina <jkosina@suse.cz> [for pktdvd]
      Acked-by: Boaz Harrosh <bharrosh@panasas.com> [for osd]
      Reviewed-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      a492f075
  4. 07 6月, 2014 1 次提交
  5. 06 6月, 2014 1 次提交
    • J
      block: add blk_rq_set_block_pc() · f27b087b
      Jens Axboe 提交于
      With the optimizations around not clearing the full request at alloc
      time, we are leaving some of the needed init for REQ_TYPE_BLOCK_PC
      up to the user allocating the request.
      
      Add a blk_rq_set_block_pc() that sets the command type to
      REQ_TYPE_BLOCK_PC, and properly initializes the members associated
      with this type of request. Update callers to use this function instead
      of manipulating rq->cmd_type directly.
      
      Includes fixes from Christoph Hellwig <hch@lst.de> for my half-assed
      attempt.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      f27b087b
  6. 06 5月, 2014 12 次提交
  7. 04 7月, 2013 1 次提交
    • J
      drivers/cdrom/cdrom.c: use kzalloc() for failing hardware · 542db015
      Jonathan Salwan 提交于
      In drivers/cdrom/cdrom.c mmc_ioctl_cdrom_read_data() allocates a memory
      area with kmalloc in line 2885.
      
        2885         cgc->buffer = kmalloc(blocksize, GFP_KERNEL);
        2886         if (cgc->buffer == NULL)
        2887                 return -ENOMEM;
      
      In line 2908 we can find the copy_to_user function:
      
        2908         if (!ret && copy_to_user(arg, cgc->buffer, blocksize))
      
      The cgc->buffer is never cleaned and initialized before this function.
      If ret = 0 with the previous basic block, it's possible to display some
      memory bytes in kernel space from userspace.
      
      When we read a block from the disk it normally fills the ->buffer but if
      the drive is malfunctioning there is a chance that it would only be
      partially filled.  The result is an leak information to userspace.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      542db015
  8. 09 2月, 2012 1 次提交
  9. 06 2月, 2012 1 次提交
  10. 15 1月, 2012 1 次提交
  11. 13 1月, 2012 1 次提交
  12. 04 1月, 2012 1 次提交
  13. 02 8月, 2011 1 次提交
  14. 29 4月, 2011 1 次提交
    • T
      cdrom: always check_disk_change() on open · bf2253a6
      Tejun Heo 提交于
      cdrom_open() called check_disk_change() after the rest of open path
      succeeded which leads to the following bizarre behavior.
      
      * After media change, if the device opened without O_NONBLOCK,
        open_for_data() naturally fails with -ENOMEDIA and
        check_disk_change() is never called.  The media is known to be gone
        and the open failure makes it obvious to the userland but device
        invalidation never happens.
      
      * But if the device is opened with O_NONBLOCK, all the checks are
        bypassed and cdrom_open() doesn't notice that the media is not there
        and check_disk_change() is called and invalidation happens.
      
      There's nothing to be gained by avoiding calling check_disk_change()
      on open failure.  Common cases end up calling check_disk_change()
      anyway.  All we get is inconsistent behavior.
      
      Fix it by moving check_disk_change() invocation to the top of
      cdrom_open() so that it always gets called regardless of how the rest
      of open proceeds.
      
      Stable: 2.6.38
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NAmit Shah <amit.shah@redhat.com>
      Tested-by: NAmit Shah <amit.shah@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      bf2253a6
  15. 22 4月, 2011 1 次提交
    • T
      cdrom: always check_disk_change() on open · ea6949b6
      Tejun Heo 提交于
      cdrom_open() called check_disk_change() after the rest of open path
      succeeded which leads to the following bizarre behavior.
      
      * After media change, if the device opened without O_NONBLOCK,
        open_for_data() naturally fails with -ENOMEDIA and
        check_disk_change() is never called.  The media is known to be gone
        and the open failure makes it obvious to the userland but device
        invalidation never happens.
      
      * But if the device is opened with O_NONBLOCK, all the checks are
        bypassed and cdrom_open() doesn't notice that the media is not there
        and check_disk_change() is called and invalidation happens.
      
      There's nothing to be gained by avoiding calling check_disk_change()
      on open failure.  Common cases end up calling check_disk_change()
      anyway.  All we get is inconsistent behavior.
      
      Fix it by moving check_disk_change() invocation to the top of
      cdrom_open() so that it always gets called regardless of how the rest
      of open proceeds.
      
      Note for stable: 2.6.38 and later only
      
      Cc: stable@kernel.org
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NAmit Shah <amit.shah@redhat.com>
      Tested-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      ea6949b6
  16. 31 3月, 2011 1 次提交
  17. 09 2月, 2011 1 次提交
  18. 17 12月, 2010 2 次提交
    • J
      cdrom: export cdrom_check_events() · 30a7caab
      Jens Axboe 提交于
      It's used by sr, so we need to export it.
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      30a7caab
    • T
      cdrom: add ->check_events() support · 2d921729
      Tejun Heo 提交于
      In principle, cdrom just needs to pass through ->check_events() but
      CDROM_MEDIA_CHANGED ioctl makes things a bit more complex.  Just as
      with ->media_changed() support, cdrom code needs to buffer the events
      and serve them to ioctl and vfs as requested.
      
      As the code has to deal with both ->check_events() and
      ->media_changed(), and vfs and ioctl event buffering, this patch adds
      check_events caching on top of the existing cdi->mc_flags buffering.
      
      It may be a good idea to deprecate CDROM_MEDIA_CHANGED ioctl and
      remove all this mess.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      2d921729
  19. 08 8月, 2010 1 次提交
  20. 19 11月, 2009 1 次提交
  21. 12 11月, 2009 1 次提交
    • E
      sysctl drivers: Remove dead binary sysctl support · 894d2491
      Eric W. Biederman 提交于
      Now that sys_sysctl is a wrapper around /proc/sys all of
      the binary sysctl support elsewhere in the tree is
      dead code.
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Corey Minyard <minyard@acm.org>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Neil Brown <neilb@suse.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@suse.de>
      Acked-by: Clemens Ladisch <clemens@ladisch.de> for drivers/char/hpet.c
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      894d2491
  22. 24 9月, 2009 1 次提交
  23. 23 5月, 2009 1 次提交
  24. 29 12月, 2008 2 次提交
  25. 12 12月, 2008 1 次提交
  26. 21 10月, 2008 2 次提交