1. 09 8月, 2010 1 次提交
    • J
      drivers/ide: Use memdup_user · 7d543d84
      Julia Lawall 提交于
      Use memdup_user when user data is immediately copied into the
      allocated region.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      expression from,to,size,flag;
      position p;
      identifier l1,l2;
      @@
      
      -  to = \(kmalloc@p\|kzalloc@p\)(size,flag);
      +  to = memdup_user(from,size);
         if (
      -      to==NULL
      +      IS_ERR(to)
                       || ...) {
         <+... when != goto l1;
      -  -ENOMEM
      +  PTR_ERR(to)
         ...+>
         }
      -  if (copy_from_user(to, from, size) != 0) {
      -    <+... when != goto l2;
      -    -EFAULT
      -    ...+>
      -  }
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7d543d84
  2. 07 4月, 2010 1 次提交
    • M
      ide: Fix IDE taskfile with cfq scheduler · 720fc22a
      Mikulas Patocka 提交于
      When ide taskfile access is being used (for example with hdparm --security
      commands) and cfq scheduler is selected, the scheduler crashes on BUG in
      cfq_put_request.
      
      The reason is that the cfq scheduler is tracking counts of read and write
      requests separately; the ide-taskfile subsystem allocates a read request and
      then flips the flag to make it a write request. The counters in cfq will
      mismatch.
      
      This patch changes ide-taskfile to allocate the READ or WRITE request as
      required and don't change the flag later.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      720fc22a
  3. 08 8月, 2009 4 次提交
  4. 07 6月, 2009 1 次提交
  5. 18 5月, 2009 1 次提交
  6. 11 5月, 2009 1 次提交
  7. 28 4月, 2009 1 次提交
    • T
      ide-taskfile: don't abuse rq->buffer · d868ca24
      Tejun Heo 提交于
      Impact: rq->buffer usage cleanup
      
      ide_raw_taskfile() directly uses rq->buffer to carry pointer to the
      data buffer.  This complicates both block interface and ide backend
      request handling.  Use blk_rq_map_kern() instead and drop special
      handling for REQ_TYPE_ATA_TASKFILE from ide_map_sg().
      
      Note that REQ_RW setting is moved upwards as blk_rq_map_kern() uses it
      to initialize bio rw flag.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      d868ca24
  8. 19 4月, 2009 1 次提交
    • T
      ide-taskfile: don't abuse rq->buffer · eace4cb0
      Tejun Heo 提交于
      Impact: rq->buffer usage cleanup
      
      ide_raw_taskfile() directly uses rq->buffer to carry pointer to the
      data buffer.  This complicates both block interface and ide backend
      request handling.  Use blk_rq_map_kern() instead and drop special
      handling for REQ_TYPE_ATA_TASKFILE from ide_map_sg().
      
      Note that REQ_RW setting is moved upwards as blk_rq_map_kern() uses it
      to initialize bio rw flag.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      eace4cb0
  9. 08 4月, 2009 5 次提交
  10. 01 4月, 2009 6 次提交
  11. 27 3月, 2009 18 次提交