Merge branch 'for-linus' into for-3.18/core
authorJens Axboe <axboe@fb.com>
Thu, 11 Sep 2014 15:31:18 +0000 (09:31 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 11 Sep 2014 15:31:18 +0000 (09:31 -0600)
A bit of churn on the for-linus side that would be nice to have
in the core bits for 3.18, so pull it in to catch us up and make
forward progress easier.

Signed-off-by: Jens Axboe <axboe@fb.com>
Conflicts:
block/scsi_ioctl.c

1  2 
block/blk-core.c
block/blk-mq.c
block/cfq-iosched.c
block/scsi_ioctl.c
drivers/scsi/scsi_lib.c
fs/btrfs/disk-io.c

Simple merge
diff --cc block/blk-mq.c
Simple merge
Simple merge
index a8b0d02084485d933d4fb6b490411e2874621c86,9b8eaeca6a794b5be8e732567aceffbe6ab6ebdb..abb2e65b24ccb4cbd64e0194d5bdaf9751e2b145
@@@ -317,16 -314,23 +314,23 @@@ static int sg_io(struct request_queue *
        if (hdr->flags & SG_FLAG_Q_AT_HEAD)
                at_head = 1;
  
+       ret = -ENOMEM;
        rq = blk_get_request(q, writing ? WRITE : READ, GFP_KERNEL);
 -      if (!rq)
 -              goto out;
 +      if (IS_ERR(rq))
 +              return PTR_ERR(rq);
        blk_rq_set_block_pc(rq);
  
-       if (blk_fill_sghdr_rq(q, rq, hdr, mode)) {
-               blk_put_request(rq);
-               return -EFAULT;
+       if (hdr->cmd_len > BLK_MAX_CDB) {
+               rq->cmd = kzalloc(hdr->cmd_len, GFP_KERNEL);
+               if (!rq->cmd)
+                       goto out_put_request;
        }
  
+       ret = -EFAULT;
+       if (blk_fill_sghdr_rq(q, rq, hdr, mode))
+               goto out_free_cdb;
+       ret = 0;
        if (hdr->iovec_count) {
                size_t iov_data_len;
                struct iovec *iov = NULL;
  
        hdr->duration = jiffies_to_msecs(jiffies - start_time);
  
-       return blk_complete_sghdr_rq(rq, hdr, bio);
- out:
+       ret = blk_complete_sghdr_rq(rq, hdr, bio);
+ out_free_cdb:
+       if (rq->cmd != rq->__cmd)
+               kfree(rq->cmd);
+ out_put_request:
        blk_put_request(rq);
 -out:
        return ret;
  }
  
@@@ -448,10 -457,11 +456,11 @@@ int sg_scsi_ioctl(struct request_queue 
        }
  
        rq = blk_get_request(q, in_len ? WRITE : READ, __GFP_WAIT);
 -      if (!rq) {
 -              err = -ENOMEM;
 +      if (IS_ERR(rq)) {
 +              err = PTR_ERR(rq);
-               goto error_free_buffer;
+               goto error;
        }
+       blk_rq_set_block_pc(rq);
  
        cmdlen = COMMAND_SIZE(opcode);
  
Simple merge
Simple merge