]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 Nov 2016 19:33:28 +0000 (11:33 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 Nov 2016 19:33:28 +0000 (11:33 -0800)
Pull CIFS fixes from Steve French:
 "A few misc important cifs fixes, including a fix for a 4.9 regression
  in posix_acl xattr handling"

* 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
  CIFS: iterate over posix acl xattr entry correctly in ACL_to_cifs_posix()
  Call echo service immediately after socket reconnect
  CIFS: Fix BUG() in calc_seckey()

drivers/scsi/be2iscsi/be_mgmt.c
drivers/scsi/hpsa.c
drivers/scsi/hpsa.h
drivers/scsi/libfc/fc_lport.c
drivers/scsi/mpt3sas/mpt3sas_scsih.c
mm/huge_memory.c
mm/mremap.c

index aebc4ddb3060ee177c06ec9f11b62a021c346f10..ac05317bba7f3342d016e581b91ae6feffa18eff 100644 (file)
@@ -1083,7 +1083,7 @@ unsigned int beiscsi_boot_get_sinfo(struct beiscsi_hba *phba)
        nonemb_cmd = &phba->boot_struct.nonemb_cmd;
        nonemb_cmd->size = sizeof(*resp);
        nonemb_cmd->va = pci_alloc_consistent(phba->ctrl.pdev,
-                                             sizeof(nonemb_cmd->size),
+                                             nonemb_cmd->size,
                                              &nonemb_cmd->dma);
        if (!nonemb_cmd->va) {
                mutex_unlock(&ctrl->mbox_lock);
index d007ec18179af9789a12e6ca7c9f5878374dc593..a1d6ab76a51418f9a4f26ecbb76529ea1b775835 100644 (file)
@@ -2009,7 +2009,7 @@ static struct hpsa_scsi_dev_t *lookup_hpsa_scsi_dev(struct ctlr_info *h,
 
 static int hpsa_slave_alloc(struct scsi_device *sdev)
 {
-       struct hpsa_scsi_dev_t *sd;
+       struct hpsa_scsi_dev_t *sd = NULL;
        unsigned long flags;
        struct ctlr_info *h;
 
@@ -2026,7 +2026,8 @@ static int hpsa_slave_alloc(struct scsi_device *sdev)
                        sd->target = sdev_id(sdev);
                        sd->lun = sdev->lun;
                }
-       } else
+       }
+       if (!sd)
                sd = lookup_hpsa_scsi_dev(h, sdev_channel(sdev),
                                        sdev_id(sdev), sdev->lun);
 
@@ -3840,6 +3841,7 @@ static int hpsa_update_device_info(struct ctlr_info *h,
                sizeof(this_device->vendor));
        memcpy(this_device->model, &inq_buff[16],
                sizeof(this_device->model));
+       this_device->rev = inq_buff[2];
        memset(this_device->device_id, 0,
                sizeof(this_device->device_id));
        if (hpsa_get_device_id(h, scsi3addr, this_device->device_id, 8,
@@ -3929,10 +3931,14 @@ static void figure_bus_target_lun(struct ctlr_info *h,
 
        if (!is_logical_dev_addr_mode(lunaddrbytes)) {
                /* physical device, target and lun filled in later */
-               if (is_hba_lunid(lunaddrbytes))
+               if (is_hba_lunid(lunaddrbytes)) {
+                       int bus = HPSA_HBA_BUS;
+
+                       if (!device->rev)
+                               bus = HPSA_LEGACY_HBA_BUS;
                        hpsa_set_bus_target_lun(device,
-                                       HPSA_HBA_BUS, 0, lunid & 0x3fff);
-               else
+                                       bus, 0, lunid & 0x3fff);
+               else
                        /* defer target, lun assignment for physical devices */
                        hpsa_set_bus_target_lun(device,
                                        HPSA_PHYSICAL_DEVICE_BUS, -1, -1);
index 82cdfad874f3aa363d4989837d2b9455c8e0acdb..9ea162de80dcfa976b737cf209c4570de6003888 100644 (file)
@@ -69,6 +69,7 @@ struct hpsa_scsi_dev_t {
        u64 sas_address;
        unsigned char vendor[8];        /* bytes 8-15 of inquiry data */
        unsigned char model[16];        /* bytes 16-31 of inquiry data */
+       unsigned char rev;              /* byte 2 of inquiry data */
        unsigned char raid_level;       /* from inquiry page 0xC1 */
        unsigned char volume_offline;   /* discovered via TUR or VPD */
        u16 queue_depth;                /* max queue_depth for this device */
@@ -402,6 +403,7 @@ struct offline_device_entry {
 #define HPSA_RAID_VOLUME_BUS           1
 #define HPSA_EXTERNAL_RAID_VOLUME_BUS  2
 #define HPSA_HBA_BUS                   0
+#define HPSA_LEGACY_HBA_BUS            3
 
 /*
        Send the command to the hardware
index 04ce7cfb6d1b6272d26ce138a9b11ee952a20d6f..50c71678a156e8f32d833575de49379e5cd3a151 100644 (file)
@@ -308,7 +308,7 @@ struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *shost)
        fc_stats = &lport->host_stats;
        memset(fc_stats, 0, sizeof(struct fc_host_statistics));
 
-       fc_stats->seconds_since_last_reset = (lport->boot_time - jiffies) / HZ;
+       fc_stats->seconds_since_last_reset = (jiffies - lport->boot_time) / HZ;
 
        for_each_possible_cpu(cpu) {
                struct fc_stats *stats;
index 91b70bc46e7f184ece7d81ac233cb5957b080943..1c4744e78173bc0f78383b8f6cf901715b946d34 100644 (file)
@@ -3885,6 +3885,11 @@ _scsih_temp_threshold_events(struct MPT3SAS_ADAPTER *ioc,
        }
 }
 
+static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
+{
+       return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
+}
+
 /**
  * _scsih_flush_running_cmds - completing outstanding commands.
  * @ioc: per adapter object
@@ -3906,6 +3911,9 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc)
                if (!scmd)
                        continue;
                count++;
+               if (ata_12_16_cmd(scmd))
+                       scsi_internal_device_unblock(scmd->device,
+                                                       SDEV_RUNNING);
                mpt3sas_base_free_smid(ioc, smid);
                scsi_dma_unmap(scmd);
                if (ioc->pci_error_recovery)
@@ -4010,11 +4018,6 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
            SAM_STAT_CHECK_CONDITION;
 }
 
-static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
-{
-       return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
-}
-
 /**
  * scsih_qcmd - main scsi request entry point
  * @scmd: pointer to scsi command object
index eff3de359d50a30588abf70676dc6993c751471d..d4a6e40015128c626f606e339474d8b23d90607e 100644 (file)
@@ -1456,9 +1456,9 @@ bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr,
                new_ptl = pmd_lockptr(mm, new_pmd);
                if (new_ptl != old_ptl)
                        spin_lock_nested(new_ptl, SINGLE_DEPTH_NESTING);
-               if (pmd_present(*old_pmd) && pmd_dirty(*old_pmd))
-                       force_flush = true;
                pmd = pmdp_huge_get_and_clear(mm, old_addr, old_pmd);
+               if (pmd_present(pmd) && pmd_dirty(pmd))
+                       force_flush = true;
                VM_BUG_ON(!pmd_none(*new_pmd));
 
                if (pmd_move_must_withdraw(new_ptl, old_ptl) &&
index 6ccecc03f56ad05940484a481c5a092f1ad245ef..30d7d2482eea1d04cf72b03bcd54d1d293f666e4 100644 (file)
@@ -149,14 +149,18 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd,
                if (pte_none(*old_pte))
                        continue;
 
+               pte = ptep_get_and_clear(mm, old_addr, old_pte);
                /*
-                * We are remapping a dirty PTE, make sure to
-                * flush TLB before we drop the PTL for the
+                * If we are remapping a dirty PTE, make sure
+                * to flush TLB before we drop the PTL for the
                 * old PTE or we may race with page_mkclean().
+                *
+                * This check has to be done after we removed the
+                * old PTE from page tables or another thread may
+                * dirty it after the check and before the removal.
                 */
-               if (pte_present(*old_pte) && pte_dirty(*old_pte))
+               if (pte_present(pte) && pte_dirty(pte))
                        force_flush = true;
-               pte = ptep_get_and_clear(mm, old_addr, old_pte);
                pte = move_pte(pte, new_vma->vm_page_prot, old_addr, new_addr);
                pte = move_soft_dirty_pte(pte);
                set_pte_at(mm, new_addr, new_pte, pte);