Skip to content
  1. Nov 12, 2009
  2. Nov 11, 2009
    • Eric W. Biederman's avatar
      sysctl: Don't look at ctl_name and strategy in the generic code · 2315ffa0
      Eric W. Biederman authored
      
      
      The ctl_name and strategy fields are unused, now that sys_sysctl
      is a compatibility wrapper around /proc/sys.  No longer looking
      at them in the generic code is effectively what we are doing
      now and provides the guarantee that during further cleanups
      we can just remove references to those fields and everything
      will work ok.
      
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      2315ffa0
    • Eric W. Biederman's avatar
      sysctl: Remove references to ctl_name and strategy from the generic sysctl table · 6fce56ec
      Eric W. Biederman authored
      
      
      Now that sys_sysctl is a generic wrapper around /proc/sys  .ctl_name
      and .strategy members of sysctl tables are dead code.  Remove them.
      
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      6fce56ec
    • Eric W. Biederman's avatar
      sysctl: Remove dead code from sysctl_check · 83ac201b
      Eric W. Biederman authored
      
      
      Now that the sys_sysctl is now a compatibility wrapper around
      /proc/sys we can remove much of sysctl_check and reduce it
      to a few remaining sanity checks.  This completely decouples
      it from the binary sysctl system call.
      
      Little things like ensuring that the sysctl has not already
      been registered are all that remain.
      
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      83ac201b
    • Eric W. Biederman's avatar
      sysctl: Neuter the generic sysctl strategy routines. · a965cf94
      Eric W. Biederman authored
      
      
      Now that sys_sysctl is a compatibility layer on top of /proc/sys
      these routines are never called but are still put in sysctl
      tables so I have reduced them to stubs until they can be
      removed entirely.
      
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      a965cf94
    • Eric W. Biederman's avatar
      sysctl: Reduce sys_sysctl to a compatibility wrapper around /proc/sys · 26a7034b
      Eric W. Biederman authored
      
      
      To simply maintenance and to be able to remove all of the binary
      sysctl support from various subsystems I have rewritten the binary
      sysctl code as a compatibility wrapper around proc/sys.
      
      The code is built around a hard coded table based on the table
      in sysctl_check.c that lists all of our current binary sysctls
      and provides enough information to convert from the sysctl
      binary input into into ascii and back again.  New in this
      patch is the realization that the only dynamic entries
      that need to be handled have ifname as the asscii string
      and ifindex as their ctl_name.
      
      When a sys_sysctl is called the code now looks in the
      translation table converting the binary name to the
      path under /proc where the value is to be found.  Opens
      that file, and calls into a format conversion wrapper
      that calls fop->read and then fop->write as appropriate.
      
      Since in practice the practically no one uses or tests
      sys_sysctl rewritting the code to be beautiful is a little
      silly.  The redeeming merit of this work is it allows us to
      rip out all of the binary sysctl syscall support from
      everywhere else in the tree.  Allowing us to remove
      a lot of dead (after this patch) and barely maintained code.
      
      In addition it becomes much easier to optimize the sysctl
      implementation for being the backing store of /proc/sys,
      without having to worry about sys_sysctl.
      
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      26a7034b
  3. Nov 06, 2009
  4. Nov 04, 2009
  5. Nov 03, 2009
    • Linus Torvalds's avatar
      Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6 · 38dc6345
      Linus Torvalds authored
      * 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
        PM: Remove some debug messages producing too much noise
        PM: Fix warning on suspend errors
        PM / Hibernate: Add newline to load_image() fail path
        PM / Hibernate: Fix error handling in save_image()
        PM / Hibernate: Fix blkdev refleaks
        PM / yenta: Split resume into early and late parts (rev. 4)
      38dc6345
    • Ian Campbell's avatar
      Correct nr_processes() when CPUs have been unplugged · 1d510750
      Ian Campbell authored
      nr_processes() returns the sum of the per cpu counter process_counts for
      all online CPUs. This counter is incremented for the current CPU on
      fork() and decremented for the current CPU on exit(). Since a process
      does not necessarily fork and exit on the same CPU the process_count for
      an individual CPU can be either positive or negative and effectively has
      no meaning in isolation.
      
      Therefore calculating the sum of process_counts over only the online
      CPUs omits the processes which were started or stopped on any CPU which
      has since been unplugged. Only the sum of process_counts across all
      possible CPUs has meaning.
      
      The only caller of nr_processes() is proc_root_getattr() which
      calculates the number of links to /proc as
              stat->nlink = proc_root.nlink + nr_processes();
      
      You don't have to be all that unlucky for the nr_processes() to return a
      negative value leading to a negative number of links (or rather, an
      apparently enormous number of links). If this happens then you can get
      failures where things like "ls /proc" start to fail because they got an
      -EOVERFLOW from some stat() call.
      
      Example with some debugging inserted to show what goes on:
              # ps haux|wc -l
              nr_processes: CPU0:     90
              nr_processes: CPU1:     1030
              nr_processes: CPU2:     -900
              nr_processes: CPU3:     -136
              nr_processes: TOTAL:    84
              proc_root_getattr. nlink 12 + nr_processes() 84 = 96
              84
              # echo 0 >/sys/devices/system/cpu/cpu1/online
              # ps haux|wc -l
              nr_processes: CPU0:     85
              nr_processes: CPU2:     -901
              nr_processes: CPU3:     -137
              nr_processes: TOTAL:    -953
              proc_root_getattr. nlink 12 + nr_processes() -953 = -941
              75
              # stat /proc/
              nr_processes: CPU0:     84
              nr_processes: CPU2:     -901
              nr_processes: CPU3:     -137
              nr_processes: TOTAL:    -954
              proc_root_getattr. nlink 12 + nr_processes() -954 = -942
                File: `/proc/'
                Size: 0               Blocks: 0          IO Block: 1024   directory
              Device: 3h/3d   Inode: 1           Links: 4294966354
              Access: (0555/dr-xr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
              Access: 2009-11-03 09:06:55.000000000 +0000
              Modify: 2009-11-03 09:06:55.000000000 +0000
              Change: 2009-11-03 09:06:55.000000000 +0000
      
      I'm not 100% convinced that the per_cpu regions remain valid for offline
      CPUs, although my testing suggests that they do. If not then I think the
      correct solution would be to aggregate the process_count for a given CPU
      into a global base value in cpu_down().
      
      This bug appears to pre-date the transition to git and it looks like it
      may even have been present in linux-2.6.0-test7-bk3 since it looks like
      the code Rusty patched in http://lwn.net/Articles/64773/
      
       was already
      wrong.
      
      Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1d510750
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 1c211849
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: gpio-keys - use IRQF_SHARED
        Input: winbond-cir - select LEDS_TRIGGERS
        Input: i8042 - try to get stable CTR value when initializing
        Input: atkbd - add a quirk for OQO 01+ multimedia keys
      1c211849
    • Linus Torvalds's avatar
      Merge branch 'fixes-s3c-2632-rc5' of git://git.fluff.org/bjdooks/linux · fcef24d3
      Linus Torvalds authored
      * 'fixes-s3c-2632-rc5' of git://git.fluff.org/bjdooks/linux:
        ARM: S3C2410: Fix sparse warnings in arch/arm/mach-s3c2410/gpio.c
        ARM: S3C2440: mini2440: Fix spare warnings
        ARM: S3C24XX: Fix warnings in arch/arm/plat-s3c24xx/gpio.c
        ARM: S3C2440: mini2440: Fix missing CONFIG_S3C_DEV_USB_HOST
        ARM: S3C24XX: arch/arm/plat-s3c24xx: Move dereference after NULL test
        ARM: S3C: Fix adc function exports
        ARM: S3C2410: Fix link if CONFIG_S3C2410_IOTIMING is not set
        ARM: S3C24XX: Introduce S3C2442B CPU
        ARM: S3C24XX: Define a macro to avoid compilation error
        ARM: S3C: Add info for supporting circular DMA buffers
        ARM: S3C64XX: Set rate of crystal mux
        ARM: S3C64XX: Fix S3C64XX_CLKDIV0_ARM_MASK value
      fcef24d3
    • Linus Torvalds's avatar
      Merge branch 'i2c-fixes' of git://git.fluff.org/bjdooks/linux · 78e1e340
      Linus Torvalds authored
      * 'i2c-fixes' of git://git.fluff.org/bjdooks/linux:
        i2c-mpc: Do not generate STOP after read.
        i2c: imx: disable clock when it's possible to save power.
        i2c: imx: only imx1 needs disable delay
        i2c: imx: check busy bit when START/STOP
      78e1e340
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2 · 1cec2cde
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
        nilfs2: add zero-fill for new btree node buffers
        nilfs2: fix irregular checkpoint creation due to data flush
        nilfs2: fix dirty page accounting leak causing hang at write
      1cec2cde
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 · a84216e6
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (21 commits)
        mac80211: check interface is down before type change
        cfg80211: fix NULL ptr deref
        libertas if_usb: Fix crash on 64-bit machines
        mac80211: fix reason code output endianness
        mac80211: fix addba timer
        ath9k: fix misplaced semicolon on rate control
        b43: Fix DMA TX bounce buffer copying
        mac80211: fix BSS leak
        rt73usb.c : more ids
        ipw2200: fix oops on missing firmware
        gre: Fix dev_addr clobbering for gretap
        sky2: set carrier off in probe
        net: fix sk_forward_alloc corruption
        pcnet_cs: add cis of PreMax PE-200 ethernet pcmcia card
        r8169: Fix card drop incoming VLAN tagged MTU byte large jumbo frames
        ibmtr: possible Read buffer overflow?
        net: Fix RPF to work with policy routing
        net: fix kmemcheck annotations
        e1000e: rework disable K1 at 1000Mbps for 82577/82578
        e1000e: config PHY via software after resets
        ...
      a84216e6
    • Pavel Machek's avatar
      PM: Remove some debug messages producing too much noise · 2ddac2a6
      Pavel Machek authored
      
      
      pm_runtime_idle() is somewhat noisy. Remove debug prints.
      
      Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      2ddac2a6
    • Romit Dasgupta's avatar
      PM: Fix warning on suspend errors · e528e876
      Romit Dasgupta authored
      
      
      Fixes the point where we need to complete the power transition when
      device suspend fails, so that we don't print warnings about devices
      added to the device hierarchy after a failing suspend.
      
      [rjw: Modified changelog.]
      
      Signed-off-by: default avatarRomit Dasgupta <romit@ti.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      e528e876
    • Jiri Slaby's avatar
      PM / Hibernate: Add newline to load_image() fail path · bf9fd67a
      Jiri Slaby authored
      
      
      Finish a line by \n when load_image fails in the middle of loading.
      
      Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      bf9fd67a
    • Jiri Slaby's avatar
      PM / Hibernate: Fix error handling in save_image() · 4ff277f9
      Jiri Slaby authored
      
      
      There are too many retval variables in save_image(). Thus error return
      value from snapshot_read_next() may be ignored and only part of the
      snapshot (successfully) written.
      
      Remove 'error' variable, invert the condition in the do-while loop
      and convert the loop to use only 'ret' variable.
      
      Switch the rest of the function to consider only 'ret'.
      
      Also make sure we end printed line by \n if an error occurs.
      
      Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      4ff277f9
    • Jiri Slaby's avatar
      PM / Hibernate: Fix blkdev refleaks · 76b57e61
      Jiri Slaby authored
      
      
      While cruising through the swsusp code I found few blkdev reference
      leaks of resume_bdev.
      
      swsusp_read: remove blkdev_put altogether. Some fail paths do
                   not do that.
      swsusp_check: make sure we always put a reference on fail paths
      software_resume: all fail paths between swsusp_check and swsusp_read
                       omit swsusp_close. Add it in those cases. And since
                       swsusp_read doesn't drop the reference anymore, do
                       it here unconditionally.
      
      [rjw: Fixed a small coding style issue.]
      
      Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      76b57e61