Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 Mar 2011 04:06:13 +0000 (21:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 Mar 2011 04:06:13 +0000 (21:06 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (55 commits)
  [SCSI] tcm_loop: Add multi-fabric Linux/SCSI LLD fabric module
  [SCSI] qla4xxx: Use polling mode for disable interrupt mailbox completion
  [SCSI] Revert "[SCSI] Retrieve the Caching mode page"
  [SCSI] bnx2fc: IO completion not processed due to missed wakeup
  [SCSI] qla4xxx: Update driver version to 5.02.00-k6
  [SCSI] qla4xxx: masking required bits of add_fw_options during initialization
  [SCSI] qla4xxx: added new function qla4xxx_relogin_all_devices
  [SCSI] qla4xxx: add support for ql4xsess_recovery_tmo cmd line param
  [SCSI] qla4xxx: Add support for ql4xmaxqdepth command line parameter
  [SCSI] qla4xxx: cleanup function qla4xxx_process_ddb_changed
  [SCSI] qla4xxx: Prevent other port reinitialization during remove_adapter
  [SCSI] qla4xxx: remove unused ddb flag DF_NO_RELOGIN
  [SCSI] qla4xxx: cleanup DDB relogin logic during initialization
  [SCSI] qla4xxx: Do not retry ISP82XX initialization if H/W state is failed
  [SCSI] qla4xxx: Do not send mbox command if FW is in failed state
  [SCSI] qla4xxx: cleanup qla4xxx_initialize_ddb_list()
  [SCSI] ses: add subenclosure support
  [SCSI] bnx2fc: Bump version to 1.0.1
  [SCSI] bnx2fc: Remove unnecessary module state checks
  [SCSI] bnx2fc: Fix MTU issue by using static MTU
  ...

1  2 
drivers/target/target_core_iblock.c

@@@ -129,10 -129,11 +129,11 @@@ static struct se_device *iblock_create_
        struct request_queue *q;
        struct queue_limits *limits;
        u32 dev_flags = 0;
+       int ret = -EINVAL;
  
        if (!(ib_dev)) {
                printk(KERN_ERR "Unable to locate struct iblock_dev parameter\n");
-               return 0;
+               return ERR_PTR(ret);
        }
        memset(&dev_limits, 0, sizeof(struct se_dev_limits));
        /*
        ib_dev->ibd_bio_set = bioset_create(32, 64);
        if (!(ib_dev->ibd_bio_set)) {
                printk(KERN_ERR "IBLOCK: Unable to create bioset()\n");
-               return 0;
+               return ERR_PTR(-ENOMEM);
        }
        printk(KERN_INFO "IBLOCK: Created bio_set()\n");
        /*
  
        bd = blkdev_get_by_path(ib_dev->ibd_udev_path,
                                FMODE_WRITE|FMODE_READ|FMODE_EXCL, ib_dev);
-       if (IS_ERR(bd))
+       if (IS_ERR(bd)) {
+               ret = PTR_ERR(bd);
                goto failed;
+       }
        /*
         * Setup the local scope queue_limits from struct request_queue->limits
         * to pass into transport_add_device_to_core_hba() as struct se_dev_limits.
         * the QUEUE_FLAG_DISCARD bit for UNMAP/WRITE_SAME in SCSI + TRIM
         * in ATA and we need to set TPE=1
         */
-       if (blk_queue_discard(bdev_get_queue(bd))) {
-               struct request_queue *q = bdev_get_queue(bd);
+       if (blk_queue_discard(q)) {
                DEV_ATTRIB(dev)->max_unmap_lba_count =
                                q->limits.max_discard_sectors;
                /*
@@@ -212,7 -213,7 +213,7 @@@ failed
        ib_dev->ibd_bd = NULL;
        ib_dev->ibd_major = 0;
        ib_dev->ibd_minor = 0;
-       return NULL;
+       return ERR_PTR(ret);
  }
  
  static void iblock_free_device(void *p)
@@@ -391,8 -392,9 +392,8 @@@ static int iblock_do_task(struct se_tas
  {
        struct se_device *dev = task->task_se_cmd->se_dev;
        struct iblock_req *req = IBLOCK_REQ(task);
 -      struct iblock_dev *ibd = (struct iblock_dev *)req->ib_dev;
 -      struct request_queue *q = bdev_get_queue(ibd->ibd_bd);
        struct bio *bio = req->ib_bio, *nbio = NULL;
 +      struct blk_plug plug;
        int rw;
  
        if (task->task_data_direction == DMA_TO_DEVICE) {
                rw = READ;
        }
  
 +      blk_start_plug(&plug);
        while (bio) {
                nbio = bio->bi_next;
                bio->bi_next = NULL;
                submit_bio(rw, bio);
                bio = nbio;
        }
 +      blk_finish_plug(&plug);
  
 -      if (q->unplug_fn)
 -              q->unplug_fn(q);
        return PYX_TRANSPORT_SENT_TO_TRANSPORT;
  }
  
@@@ -467,7 -469,7 +468,7 @@@ static ssize_t iblock_set_configfs_dev_
                                               const char *page, ssize_t count)
  {
        struct iblock_dev *ib_dev = se_dev->se_dev_su_ptr;
-       char *orig, *ptr, *opts;
+       char *orig, *ptr, *arg_p, *opts;
        substring_t args[MAX_OPT_ARGS];
        int ret = 0, arg, token;
  
                                ret = -EEXIST;
                                goto out;
                        }
-                       ret = snprintf(ib_dev->ibd_udev_path, SE_UDEV_PATH_LEN,
-                               "%s", match_strdup(&args[0]));
+                       arg_p = match_strdup(&args[0]);
+                       if (!arg_p) {
+                               ret = -ENOMEM;
+                               break;
+                       }
+                       snprintf(ib_dev->ibd_udev_path, SE_UDEV_PATH_LEN,
+                                       "%s", arg_p);
+                       kfree(arg_p);
                        printk(KERN_INFO "IBLOCK: Referencing UDEV path: %s\n",
                                        ib_dev->ibd_udev_path);
                        ib_dev->ibd_flags |= IBDF_HAS_UDEV_PATH;