Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 May 2012 23:30:26 +0000 (16:30 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 May 2012 23:30:26 +0000 (16:30 -0700)
Pull two networking fixes from David S. Miller:

1) Thanks to Willy Tarreau and Eric Dumazet, we've unlocked a bug that's
   been present in do_tcp_sendpages() since that function was written in
   2002.

   When we block to wait for memory we have to unconditionally try and
   push out pending TCP data, otherwise we can block for an unreasonably
   long amount of time.

2) Fix deadlock in e1000, fixes kernel bugzilla 43132

   From Tushar Dave.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  e1000: Prevent reset task killing itself.
  tcp: do_tcp_sendpages() must try to push data out on oom conditions

drivers/acpi/bus.c
drivers/acpi/power.c
drivers/acpi/scan.c
drivers/pci/pci-acpi.c
drivers/target/target_core_file.c
drivers/target/target_core_pr.c

index 3263b68..3188da3 100644 (file)
@@ -250,6 +250,10 @@ static int __acpi_bus_set_power(struct acpi_device *device, int state)
                return -ENODEV;
        }
 
+       /* For D3cold we should execute _PS3, not _PS4. */
+       if (state == ACPI_STATE_D3_COLD)
+               object_name[3] = '3';
+
        /*
         * Transition Power
         * ----------------
index 330bb4d..0500f71 100644 (file)
@@ -660,7 +660,7 @@ int acpi_power_on_resources(struct acpi_device *device, int state)
 
 int acpi_power_transition(struct acpi_device *device, int state)
 {
-       int result;
+       int result = 0;
 
        if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3_COLD))
                return -EINVAL;
@@ -679,8 +679,11 @@ int acpi_power_transition(struct acpi_device *device, int state)
         * (e.g. so the device doesn't lose power while transitioning).  Then,
         * we dereference all power resources used in the current list.
         */
-       result = acpi_power_on_list(&device->power.states[state].resources);
-       if (!result)
+       if (state < ACPI_STATE_D3_COLD)
+               result = acpi_power_on_list(
+                       &device->power.states[state].resources);
+
+       if (!result && device->power.state < ACPI_STATE_D3_COLD)
                acpi_power_off_list(
                        &device->power.states[device->power.state].resources);
 
index 7417267..85cbfdc 100644 (file)
@@ -908,6 +908,10 @@ static int acpi_bus_get_power_flags(struct acpi_device *device)
        device->power.states[ACPI_STATE_D3].flags.valid = 1;
        device->power.states[ACPI_STATE_D3].power = 0;
 
+       /* Set D3cold's explicit_set flag if _PS3 exists. */
+       if (device->power.states[ACPI_STATE_D3_HOT].flags.explicit_set)
+               device->power.states[ACPI_STATE_D3_COLD].flags.explicit_set = 1;
+
        acpi_bus_init_power(device);
 
        return 0;
index 1929c0c..61e2fef 100644 (file)
@@ -223,7 +223,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
                [PCI_D0] = ACPI_STATE_D0,
                [PCI_D1] = ACPI_STATE_D1,
                [PCI_D2] = ACPI_STATE_D2,
-               [PCI_D3hot] = ACPI_STATE_D3_HOT,
+               [PCI_D3hot] = ACPI_STATE_D3,
                [PCI_D3cold] = ACPI_STATE_D3
        };
        int error = -EINVAL;
index 7ed58e2..f286955 100644 (file)
@@ -169,6 +169,7 @@ static struct se_device *fd_create_virtdevice(
        inode = file->f_mapping->host;
        if (S_ISBLK(inode->i_mode)) {
                struct request_queue *q;
+               unsigned long long dev_size;
                /*
                 * 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.
@@ -183,13 +184,12 @@ static struct se_device *fd_create_virtdevice(
                 * one (1) logical sector from underlying struct block_device
                 */
                fd_dev->fd_block_size = bdev_logical_block_size(inode->i_bdev);
-               fd_dev->fd_dev_size = (i_size_read(file->f_mapping->host) -
+               dev_size = (i_size_read(file->f_mapping->host) -
                                       fd_dev->fd_block_size);
 
                pr_debug("FILEIO: Using size: %llu bytes from struct"
                        " block_device blocks: %llu logical_block_size: %d\n",
-                       fd_dev->fd_dev_size,
-                       div_u64(fd_dev->fd_dev_size, fd_dev->fd_block_size),
+                       dev_size, div_u64(dev_size, fd_dev->fd_block_size),
                        fd_dev->fd_block_size);
        } else {
                if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
@@ -605,10 +605,20 @@ static u32 fd_get_device_type(struct se_device *dev)
 static sector_t fd_get_blocks(struct se_device *dev)
 {
        struct fd_dev *fd_dev = dev->dev_ptr;
-       unsigned long long blocks_long = div_u64(fd_dev->fd_dev_size,
-                       dev->se_sub_dev->se_dev_attrib.block_size);
+       struct file *f = fd_dev->fd_file;
+       struct inode *i = f->f_mapping->host;
+       unsigned long long dev_size;
+       /*
+        * When using a file that references an underlying struct block_device,
+        * ensure dev_size is always based on the current inode size in order
+        * to handle underlying block_device resize operations.
+        */
+       if (S_ISBLK(i->i_mode))
+               dev_size = (i_size_read(i) - fd_dev->fd_block_size);
+       else
+               dev_size = fd_dev->fd_dev_size;
 
-       return blocks_long;
+       return div_u64(dev_size, dev->se_sub_dev->se_dev_attrib.block_size);
 }
 
 static struct se_subsystem_api fileio_template = {
index 86f0c3b..c3148b1 100644 (file)
@@ -220,6 +220,9 @@ int target_scsi2_reservation_release(struct se_task *task)
        if (dev->dev_reserved_node_acl != sess->se_node_acl)
                goto out_unlock;
 
+       if (dev->dev_res_bin_isid != sess->sess_bin_isid)
+               goto out_unlock;
+
        dev->dev_reserved_node_acl = NULL;
        dev->dev_flags &= ~DF_SPC2_RESERVATIONS;
        if (dev->dev_flags & DF_SPC2_RESERVATIONS_WITH_ISID) {