~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-proposed

« back to all changes in this revision

Viewing changes to drivers/net/bonding/bond_sysfs.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Ubuntu: 3.2.0-42.67, Ubuntu: 3.2.0-41.66
  • Date: 2013-05-09 16:38:26 UTC
  • Revision ID: package-import@ubuntu.com-20130509163826-0mnjjhh306ifeq8y
Tags: 3.2.0-1431.40
* Release Tracking Bug
  - LP: #1177488

[ Paolo Pisati ]

* rebased on Ubuntu-3.2.0-42.67

[ Ubuntu: 3.2.0-42.67 ]

* Release Tracking Bug
  - LP: #1177080
* SAUCE: (no-up) x86: reboot: Make Dell Optiplex 390 use reboot=pci
  - LP: #800660
* [Config] Add libceph to virtual flavour modules list
  - LP: #1164739
* [packaging] Bump ABI for every new release
* Start new release
* tg3: fix length overflow in VPD firmware parsing
  - LP: #1167065
  - CVE-2013-1929
* Bluetooth: Add support for atheros 04ca:3004 device to ath3k
  - LP: #1168852
* clockevents: Don't allow dummy broadcast timers
  - LP: #1174914
* ASoC: imx-ssi: Fix occasional AC97 reset failure
  - LP: #1174914
* UBIFS: make space fixup work in the remount case
  - LP: #1174914
* Bluetooth: Add support for IMC Networks [13d3:3393]
  - LP: #1174914
* Bluetooth: Add support for GC-WB300D PCIe [04ca:3006] to ath3k.
  - LP: #1174914
* Bluetooth: Add support for Foxconn / Hon Hai [0489:e04e]
  - LP: #1174914
* Bluetooth: Add support for Foxconn / Hon Hai [0489:e056]
  - LP: #1174914
* Bluetooth device 04ca:3008 should use ath3k
  - LP: #1174914
* Bluetooth: Device 0cf3:3008 should map AR 3012
  - LP: #1174914
* Bluetooth: Add support for Dell[QCA 0cf3:0036]
  - LP: #1174914
* tty: atmel_serial_probe(): index of atmel_ports[] fix
  - LP: #1174914
* HID: usbhid: quirk for Realtek Multi-card reader
  - LP: #1174914
* HID: usbhid: quirk for MSI GX680R led panel
  - LP: #1174914
* HID: usbhid: fix build problem
  - LP: #1174914
* Bluetooth: Add support for Dell[QCA 0cf3:817a]
  - LP: #1174914
* ath9k_hw: revert chainmask to user configuration after calibration
  - LP: #1174914
* rtlwifi: usb: add missing freeing of skbuff
  - LP: #1174914
* xen-blkback: fix dispatch_rw_block_io() error path
  - LP: #1174914
* net/irda: add missing error path release_sock call
  - LP: #1174914
* sysfs: fix race between readdir and lseek
  - LP: #1174914
* sysfs: handle failure path correctly for readdir()
  - LP: #1174914
* pnfs-block: removing DM device maybe cause oops when call dev_remove
  - LP: #1174914
* NFSv4.1: Fix a race in pNFS layoutcommit
  - LP: #1174914
* ASoC: dma-sh7760: Fix compile error
  - LP: #1174914
* IPoIB: Fix send lockup due to missed TX completion
  - LP: #1174914
* SUNRPC: Add barriers to ensure read ordering in
  rpc_wake_up_task_queue_locked
  - LP: #1174914
* usb: xhci: Fix TRB transfer length macro used for Event TRB.
  - LP: #1174914
* staging: comedi: s626: fix continuous acquisition
  - LP: #1174914
* nfsd4: reject "negative" acl lengths
  - LP: #1174914
* Nest rename_lock inside vfsmount_lock
  - LP: #1174914
* vt: synchronize_rcu() under spinlock is not nice...
  - LP: #1174914
* iommu/amd: Make sure dma_ops are set for hotplug devices
  - LP: #1174914
* can: sja1000: fix define conflict on SH
  - LP: #1174914
* b43: A fix for DMA transmission sequence errors
  - LP: #1174914
* Btrfs: limit the global reserve to 512mb
  - LP: #1174914
* usb: ftdi_sio: Add support for Mitsubishi FX-USB-AW/-BD
  - LP: #1174914
* reiserfs: Fix warning and inode leak when deleting inode with xattrs
  - LP: #1174914
* tile: expect new initramfs name from hypervisor file system
  - LP: #1174914
* virtio: console: rename cvq_lock to c_ivq_lock
  - LP: #1174914
* virtio: console: add locking around c_ovq operations
  - LP: #1174914
* spi/mpc512x-psc: optionally keep PSC SS asserted across xfer segmensts
  - LP: #1174914
* EISA/PCI: Init EISA early, before PNP
  - LP: #1174914
* mm: prevent mmap_cache race in find_vma()
  - LP: #1174914
* ixgbe: fix registration order of driver and DCA nofitication
  - LP: #1174914
* rt2x00: error in configurations with mesh support disabled
  - LP: #1174914
* key: Fix resource leak
  - LP: #1174914
* udf: Fix bitmap overflow on large filesystems with small block size
  - LP: #1174914
* NFS: nfs_getaclargs.acl_len is a size_t
  - LP: #1174914
* loop: prevent bdev freeing while device in use
  - LP: #1174914
* sky2: Receive Overflows not counted
  - LP: #1174914
* sky2: Threshold for Pause Packet is set wrong
  - LP: #1174914
* tcp: preserve ACK clocking in TSO
  - LP: #1174914
* tcp: undo spurious timeout after SACK reneging
  - LP: #1174914
* 8021q: fix a potential use-after-free
  - LP: #1174914
* thermal: shorten too long mcast group name
  - LP: #1174914
* bonding: fix miimon and arp_interval delayed work race conditions
  - LP: #1174914
* unix: fix a race condition in unix_release()
  - LP: #1174914
* bonding: remove already created master sysfs link on failure
  - LP: #1174914
* bonding: fix disabling of arp_interval and miimon
  - LP: #1174914
* drivers: net: ethernet: davinci_emac: use netif_wake_queue() while
  restarting tx queue
  - LP: #1174914
* aoe: reserve enough headroom on skbs
  - LP: #1174914
* atl1e: drop pci-msi support because of packet corruption
  - LP: #1174914
* DM9000B: driver initialization upgrade
  - LP: #1174914
* ipv6: don't accept multicast traffic with scope 0
  - LP: #1174914
* ipv6: fix bad free of addrconf_init_net
  - LP: #1174914
* ipv6: don't accept node local multicast traffic from the wire
  - LP: #1174914
* ks8851: Fix interpretation of rxlen field.
  - LP: #1174914
* net: add a synchronize_net() in netdev_rx_handler_unregister()
  - LP: #1174914
* pch_gbe: fix ip_summed checksum reporting on rx
  - LP: #1174914
* smsc75xx: fix jumbo frame support
  - LP: #1174914
* bonding: get netdev_rx_handler_unregister out of locks
  - LP: #1174914
* HID: microsoft: do not use compound literal - fix build
  - LP: #1174914
* Linux 3.2.43
  - LP: #1174914
* USB: serial: add modem-status-change wait queue
  - LP: #1174914
* USB: serial: fix hang when opening port
  - LP: #1174914
* USB: ark3116: fix use-after-free in TIOCMIWAIT
  - LP: #1174914
* USB: ch341: fix use-after-free in TIOCMIWAIT
  - LP: #1174914
* USB: cypress_m8: fix use-after-free in TIOCMIWAIT
  - LP: #1174914
* USB: ftdi_sio: fix use-after-free in TIOCMIWAIT
  - LP: #1174914
* USB: io_edgeport: fix use-after-free in TIOCMIWAIT
  - LP: #1174914
* USB: io_ti: fix use-after-free in TIOCMIWAIT
  - LP: #1174914
* USB: mct_u232: fix use-after-free in TIOCMIWAIT
  - LP: #1174914
* USB: mos7840: fix broken TIOCMIWAIT
  - LP: #1174914
* USB: mos7840: fix use-after-free in TIOCMIWAIT
  - LP: #1174914
* USB: oti6858: fix use-after-free in TIOCMIWAIT
  - LP: #1174914
* USB: pl2303: fix use-after-free in TIOCMIWAIT
  - LP: #1174914
* USB: spcp8x5: fix use-after-free in TIOCMIWAIT
  - LP: #1174914
* USB: ssu100: fix use-after-free in TIOCMIWAIT
  - LP: #1174914
* USB: ti_usb_3410_5052: fix use-after-free in TIOCMIWAIT
  - LP: #1174914
* hrtimer: Don't reinitialize a cpu_base lock on CPU_UP
  - LP: #1174914
* crypto: gcm - fix assumption that assoc has one segment
  - LP: #1174914
* libata: Use integer return value for atapi_command_packet_set
  - LP: #1174914
* libata: Set max sector to 65535 for Slimtype DVD A DS8A8SH drive
  - LP: #1174914
* ata_piix: Fix DVD not dectected at some Haswell platforms
  - LP: #1174914
* hwspinlock: fix __hwspin_lock_request error path
  - LP: #1174914
* ALSA: usb-audio: fix endianness bug in snd_nativeinstruments_*
  - LP: #1174914
* alpha: Add irongate_io to PCI bus resources
  - LP: #1174914
* powerpc: pSeries_lpar_hpte_remove fails from Adjunct partition being
  performed before the ANDCOND test
  - LP: #1174914
* sched_clock: Prevent 64bit inatomicity on 32bit systems
  - LP: #1174914
* ftrace: Consistently restore trace function on sysctl enabling
  - LP: #1174914
* PM / reboot: call syscore_shutdown() after disable_nonboot_cpus()
  - LP: #1174914
* can: gw: use kmem_cache_free() instead of kfree()
  - LP: #1174914
* ASoC: wm8903: Fix the bypass to HP/LINEOUT when no DAC or ADC is
  running
  - LP: #1174914
* spinlocks and preemption points need to be at least compiler barriers
  - LP: #1174914
* tracing: Fix double free when function profile init failed
  - LP: #1174914
* x86, mm, paravirt: Fix vmalloc_fault oops during lazy MMU updates
  - LP: #1174914
* x86, mm: Patch out arch_flush_lazy_mmu_mode() when running on bare
  metal
  - LP: #1174914
* target: Fix MAINTENANCE_IN service action CDB checks to use lower 5
  bits
  - LP: #1174914
* target: Fix incorrect fallthrough of ALUA Standby/Offline/Transition
  CDBs
  - LP: #1174914
* tracing: Fix possible NULL pointer dereferences
  - LP: #1174914
* Btrfs: make sure nbytes are right after log replay
  - LP: #1174914
* kref: Implement kref_get_unless_zero v3
  - LP: #1174914
* kobject: fix kset_find_obj() race with concurrent last kobject_put()
  - LP: #1174914
* vfs: Revert spurious fix to spinning prevention in prune_icache_sb
  - LP: #1174914
* ARM: Do 15e0d9e37c (ARM: pm: let platforms select cpu_suspend support)
  properly
  - LP: #1174914
* ath9k_htc: accept 1.x firmware newer than 1.3
  - LP: #1174914
* of: introduce helper to manage boolean
  - LP: #1174914
* can: sja1000: fix handling on dt properties on little endian systems
  - LP: #1174914
* ath9k_hw: change AR9580 initvals to fix a stability issue
  - LP: #1174914
* ARM: 7696/1: Fix kexec by setting outer_cache.inv_all for Feroceon
  - LP: #1174914
* ARM: 7698/1: perf: fix group validation when using enable_on_exec
  - LP: #1174914
* hugetlbfs: add swap entry check in follow_hugetlb_page()
  - LP: #1174914
* kernel/signal.c: stop info leak via the tkill and the tgkill syscalls
  - LP: #1174914
* net: fix incorrect credentials passing
  - LP: #1174914
* thermal: return an error on failure to register thermal class
  - LP: #1174914
* writeback: fix dirtied pages accounting on redirty
  - LP: #1174914
* Btrfs: fix race between mmap writes and compression
  - LP: #1174914
* drm/i915: panel: invert brightness via parameter
  - LP: #1174914
* drm/i915: panel: invert brightness via quirk
  - LP: #1174914
* drm/i915: panel: invert brightness acer aspire 5734z
  - LP: #1174914
* DRM/i915: Add QUIRK_INVERT_BRIGHTNESS for NCR machines.
  - LP: #1174914
* drm/i915: add quirk to invert brightness on eMachines G725
  - LP: #1174914
* drm/i915: add quirk to invert brightness on eMachines e725
  - LP: #1174914
* drm/i915: add quirk to invert brightness on Packard Bell NCL20
  - LP: #1174914
* msi-wmi: Fix memory leak
  - LP: #1174914
* ALSA: hda - Enabling Realtek ALC 671 codec
  - LP: #1174914
* ALSA: hda - fix typo in proc output
  - LP: #1174914
* block: avoid using uninitialized value in from queue_var_store
  - LP: #1174914
* r8169: fix auto speed down issue
  - LP: #1174914
* mtd: Disable mtdchar mmap on MMU systems
  - LP: #1174914
* hfsplus: fix potential overflow in hfsplus_file_truncate()
  - LP: #1174914
* KVM: Allow cross page reads and writes from cached translations.
  - LP: #1174914
* sched: Convert BUG_ON()s in try_to_wake_up_local() to WARN_ON_ONCE()s
  - LP: #1174914
* Linux 3.2.44
  - LP: #1174914

[ Ubuntu: 3.2.0-41.66 ]

* Release Tracking Bug
  - LP: #1172464
* Revert "drm/i915: GFX_MODE Flush TLB Invalidate Mode must be '1' for
  scanline waits"
  - LP: #1140716
* fbcon: fix locking harder
  - LP: #1168961, #1169380

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
        sprintf(linkname, "slave_%s", slave->name);
185
185
        ret = sysfs_create_link(&(master->dev.kobj), &(slave->dev.kobj),
186
186
                                linkname);
 
187
 
 
188
        /* free the master link created earlier in case of error */
 
189
        if (ret)
 
190
                sysfs_remove_link(&(slave->dev.kobj), "master");
 
191
 
187
192
        return ret;
188
193
 
189
194
}
514
519
        int new_value, ret = count;
515
520
        struct bonding *bond = to_bond(d);
516
521
 
 
522
        if (!rtnl_trylock())
 
523
                return restart_syscall();
517
524
        if (sscanf(buf, "%d", &new_value) != 1) {
518
525
                pr_err("%s: no arp_interval value specified.\n",
519
526
                       bond->dev->name);
521
528
                goto out;
522
529
        }
523
530
        if (new_value < 0) {
524
 
                pr_err("%s: Invalid arp_interval value %d not in range 1-%d; rejected.\n",
 
531
                pr_err("%s: Invalid arp_interval value %d not in range 0-%d; rejected.\n",
525
532
                       bond->dev->name, new_value, INT_MAX);
526
533
                ret = -EINVAL;
527
534
                goto out;
536
543
        pr_info("%s: Setting ARP monitoring interval to %d.\n",
537
544
                bond->dev->name, new_value);
538
545
        bond->params.arp_interval = new_value;
539
 
        if (bond->params.miimon) {
540
 
                pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n",
541
 
                        bond->dev->name, bond->dev->name);
542
 
                bond->params.miimon = 0;
543
 
                if (delayed_work_pending(&bond->mii_work)) {
544
 
                        cancel_delayed_work(&bond->mii_work);
545
 
                        flush_workqueue(bond->wq);
 
546
        if (new_value) {
 
547
                if (bond->params.miimon) {
 
548
                        pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n",
 
549
                                bond->dev->name, bond->dev->name);
 
550
                        bond->params.miimon = 0;
546
551
                }
547
 
        }
548
 
        if (!bond->params.arp_targets[0]) {
549
 
                pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified.\n",
550
 
                        bond->dev->name);
 
552
                if (!bond->params.arp_targets[0])
 
553
                        pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified.\n",
 
554
                                bond->dev->name);
551
555
        }
552
556
        if (bond->dev->flags & IFF_UP) {
553
557
                /* If the interface is up, we may need to fire off
555
559
                 * timer will get fired off when the open function
556
560
                 * is called.
557
561
                 */
558
 
                if (!delayed_work_pending(&bond->arp_work)) {
559
 
                        if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
560
 
                                INIT_DELAYED_WORK(&bond->arp_work,
561
 
                                                  bond_activebackup_arp_mon);
562
 
                        else
563
 
                                INIT_DELAYED_WORK(&bond->arp_work,
564
 
                                                  bond_loadbalance_arp_mon);
565
 
 
 
562
                if (!new_value) {
 
563
                        cancel_delayed_work_sync(&bond->arp_work);
 
564
                } else {
 
565
                        cancel_delayed_work_sync(&bond->mii_work);
566
566
                        queue_delayed_work(bond->wq, &bond->arp_work, 0);
567
567
                }
568
568
        }
569
 
 
570
569
out:
 
570
        rtnl_unlock();
571
571
        return ret;
572
572
}
573
573
static DEVICE_ATTR(arp_interval, S_IRUGO | S_IWUSR,
707
707
        }
708
708
        if (new_value < 0) {
709
709
                pr_err("%s: Invalid down delay value %d not in range %d-%d; rejected.\n",
710
 
                       bond->dev->name, new_value, 1, INT_MAX);
 
710
                       bond->dev->name, new_value, 0, INT_MAX);
711
711
                ret = -EINVAL;
712
712
                goto out;
713
713
        } else {
762
762
                goto out;
763
763
        }
764
764
        if (new_value < 0) {
765
 
                pr_err("%s: Invalid down delay value %d not in range %d-%d; rejected.\n",
766
 
                       bond->dev->name, new_value, 1, INT_MAX);
 
765
                pr_err("%s: Invalid up delay value %d not in range %d-%d; rejected.\n",
 
766
                       bond->dev->name, new_value, 0, INT_MAX);
767
767
                ret = -EINVAL;
768
768
                goto out;
769
769
        } else {
963
963
        int new_value, ret = count;
964
964
        struct bonding *bond = to_bond(d);
965
965
 
 
966
        if (!rtnl_trylock())
 
967
                return restart_syscall();
966
968
        if (sscanf(buf, "%d", &new_value) != 1) {
967
969
                pr_err("%s: no miimon value specified.\n",
968
970
                       bond->dev->name);
971
973
        }
972
974
        if (new_value < 0) {
973
975
                pr_err("%s: Invalid miimon value %d not in range %d-%d; rejected.\n",
974
 
                       bond->dev->name, new_value, 1, INT_MAX);
 
976
                       bond->dev->name, new_value, 0, INT_MAX);
975
977
                ret = -EINVAL;
976
978
                goto out;
977
 
        } else {
978
 
                pr_info("%s: Setting MII monitoring interval to %d.\n",
979
 
                        bond->dev->name, new_value);
980
 
                bond->params.miimon = new_value;
981
 
                if (bond->params.updelay)
982
 
                        pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value.\n",
983
 
                                bond->dev->name,
984
 
                                bond->params.updelay * bond->params.miimon);
985
 
                if (bond->params.downdelay)
986
 
                        pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value.\n",
987
 
                                bond->dev->name,
988
 
                                bond->params.downdelay * bond->params.miimon);
989
 
                if (bond->params.arp_interval) {
990
 
                        pr_info("%s: MII monitoring cannot be used with ARP monitoring. Disabling ARP monitoring...\n",
991
 
                                bond->dev->name);
992
 
                        bond->params.arp_interval = 0;
993
 
                        if (bond->params.arp_validate) {
994
 
                                bond->params.arp_validate =
995
 
                                        BOND_ARP_VALIDATE_NONE;
996
 
                        }
997
 
                        if (delayed_work_pending(&bond->arp_work)) {
998
 
                                cancel_delayed_work(&bond->arp_work);
999
 
                                flush_workqueue(bond->wq);
1000
 
                        }
1001
 
                }
1002
 
 
1003
 
                if (bond->dev->flags & IFF_UP) {
1004
 
                        /* If the interface is up, we may need to fire off
1005
 
                         * the MII timer. If the interface is down, the
1006
 
                         * timer will get fired off when the open function
1007
 
                         * is called.
1008
 
                         */
1009
 
                        if (!delayed_work_pending(&bond->mii_work)) {
1010
 
                                INIT_DELAYED_WORK(&bond->mii_work,
1011
 
                                                  bond_mii_monitor);
1012
 
                                queue_delayed_work(bond->wq,
1013
 
                                                   &bond->mii_work, 0);
1014
 
                        }
 
979
        }
 
980
        pr_info("%s: Setting MII monitoring interval to %d.\n",
 
981
                bond->dev->name, new_value);
 
982
        bond->params.miimon = new_value;
 
983
        if (bond->params.updelay)
 
984
                pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value.\n",
 
985
                        bond->dev->name,
 
986
                        bond->params.updelay * bond->params.miimon);
 
987
        if (bond->params.downdelay)
 
988
                pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value.\n",
 
989
                        bond->dev->name,
 
990
                        bond->params.downdelay * bond->params.miimon);
 
991
        if (new_value && bond->params.arp_interval) {
 
992
                pr_info("%s: MII monitoring cannot be used with ARP monitoring. Disabling ARP monitoring...\n",
 
993
                        bond->dev->name);
 
994
                bond->params.arp_interval = 0;
 
995
                if (bond->params.arp_validate)
 
996
                        bond->params.arp_validate = BOND_ARP_VALIDATE_NONE;
 
997
        }
 
998
        if (bond->dev->flags & IFF_UP) {
 
999
                /* If the interface is up, we may need to fire off
 
1000
                 * the MII timer. If the interface is down, the
 
1001
                 * timer will get fired off when the open function
 
1002
                 * is called.
 
1003
                 */
 
1004
                if (!new_value) {
 
1005
                        cancel_delayed_work_sync(&bond->mii_work);
 
1006
                } else {
 
1007
                        cancel_delayed_work_sync(&bond->arp_work);
 
1008
                        queue_delayed_work(bond->wq, &bond->mii_work, 0);
1015
1009
                }
1016
1010
        }
1017
1011
out:
 
1012
        rtnl_unlock();
1018
1013
        return ret;
1019
1014
}
1020
1015
static DEVICE_ATTR(miimon, S_IRUGO | S_IWUSR,