1. 15 Sep, 2009 22 commits
  2. 14 Sep, 2009 18 commits
    • David Howells's avatar
      KEYS: Fix garbage collector · c08ef808
      David Howells authored
      Fix a number of problems with the new key garbage collector:
      
       (1) A rogue semicolon in keyring_gc() was causing the initial count of dead
           keys to be miscalculated.
      
       (2) A missing return in keyring_gc() meant that under certain circumstances,
           the keyring semaphore would be unlocked twice.
      
       (3) The key serial tree iterator (key_garbage_collector()) part of the garbage
           collector has been modified to:
      
           (a) Complete each scan of the keyrings before setting the new timer.
      
           (b) Only set the new timer for keys that have yet to expire.  This means
               that the new timer is now calculated correctly, and the gc doesn't
               get into a loop continually scanning for keys that have expired, and
               preventing other things from happening, like RCU cleaning up the old
               keyring contents.
      
           (c) Perform an extra scan if any keys were garbage collected in this one
           	 as a key might become garbage during a scan, and (b) could mean we
           	 don't set the timer again.
      
       (4) Made key_schedule_gc() take the time at which to do a collection run,
           rather than the time at which the key expires.  This means the collection
           of dead keys (key type unregistered) can happen immediately.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      c08ef808
    • Marc Dionne's avatar
      KEYS: Unlock tasklist when exiting early from keyctl_session_to_parent · 5c84342a
      Marc Dionne authored
      When we exit early from keyctl_session_to_parent because of permissions or
      because the session keyring is the same as the parent, we need to unlock the
      tasklist.
      
      The missing unlock causes the system to hang completely when using
      keyctl(KEYCTL_SESSION_TO_PARENT) with a keyring shared with the parent.
      Signed-off-by: default avatarMarc Dionne <marc.c.dionne@gmail.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      5c84342a
    • David Howells's avatar
      CRED: Allow put_cred() to cope with a NULL groups list · 4a5d6ba1
      David Howells authored
      put_cred() will oops if given a NULL groups list, but that is now possible with
      the existence of cred_alloc_blank(), as used in keyctl_session_to_parent().
      
      Added in commit:
      
      	commit ee18d64c
      	Author: David Howells <dhowells@redhat.com>
      	Date:   Wed Sep 2 09:14:21 2009 +0100
      	KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
      Reported-by: default avatarMarc Dionne <marc.c.dionne@gmail.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      4a5d6ba1
    • Linus Torvalds's avatar
      Merge branch 'osync_cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6 · 4142e0d1
      Linus Torvalds authored
      * 'osync_cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
        fsync: wait for data writeout completion before calling ->fsync
        vfs: Remove generic_osync_inode() and sync_page_range{_nolock}()
        fat: Opencode sync_page_range_nolock()
        pohmelfs: Use new syncing helper
        xfs: Convert sync_page_range() to simple filemap_write_and_wait_range()
        ocfs2: Update syncing after splicing to match generic version
        ntfs: Use new syncing helpers and update comments
        ext4: Remove syncing logic from ext4_file_write
        ext3: Remove syncing logic from ext3_file_write
        ext2: Update comment about generic_osync_inode
        vfs: Introduce new helpers for syncing after writing to O_SYNC file or IS_SYNC inode
        vfs: Rename generic_file_aio_write_nolock
        ocfs2: Use __generic_file_aio_write instead of generic_file_aio_write_nolock
        pohmelfs: Use __generic_file_aio_write instead of generic_file_aio_write_nolock
        vfs: Remove syncing from generic_file_direct_write() and generic_file_buffered_write()
        vfs: Export __generic_file_aio_write() and add some comments
        vfs: Introduce filemap_fdatawait_range
      4142e0d1
    • Linus Torvalds's avatar
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw · 33f1de69
      Linus Torvalds authored
      * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw:
        GFS2: Whitespace fixes
        GFS2: Remove unused sysfs file
        GFS2: Be extra careful about deallocating inodes
        GFS2: Remove no_formal_ino generating code
        GFS2: Rename eattr.[ch] as xattr.[ch]
        GFS2: Clean up of extended attribute support
        GFS2: Add explanation of extended attr on-disk format
        GFS2: Add "-o errors=panic|withdraw" mount options
        GFS2: jumping to wrong label?
        GFS2: free disk inode which is deleted by remote node -V2
        GFS2: Add a document explaining GFS2's uevents
        GFS2: Add sysfs link to device
        GFS2: Replace assertion with proper error handling
        GFS2: Improve error handling in inode allocation
        GFS2: Add some more info to uevents
        GFS2: Add online uevent to GFS2
      33f1de69
    • Linus Torvalds's avatar
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6 · 041d6d0b
      Linus Torvalds authored
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6:
        udf: Fix possible corruption when close races with write
        udf: Perform preallocation only for regular files
        udf: Remove wrong assignment in udf_symlink
        udf: Remove dead code
      041d6d0b
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2 · af8cb8aa
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2: (21 commits)
        fs/Kconfig: move nilfs2 outside misc filesystems
        nilfs2: convert nilfs_bmap_lookup to an inline function
        nilfs2: allow btree code to directly call dat operations
        nilfs2: add update functions of virtual block address to dat
        nilfs2: remove individual gfp constants for each metadata file
        nilfs2: stop zero-fill of btree path just before free it
        nilfs2: remove unused btree argument from btree functions
        nilfs2: remove nilfs_dat_abort_start and nilfs_dat_abort_free
        nilfs2: shorten freeze period due to GC in write operation v3
        nilfs2: add more check routines in mount process
        nilfs2: An unassigned variable is assigned to a never used structure member
        nilfs2: use GFP_NOIO for bio_alloc instead of GFP_NOWAIT
        nilfs2: stop using periodic write_super callback
        nilfs2: clean up nilfs_write_super
        nilfs2: fix disorder of nilfs_write_super in nilfs_sync_fs
        nilfs2: remove redundant super block commit
        nilfs2: implement nilfs_show_options to display mount options in /proc/mounts
        nilfs2: always lookup disk block address before reading metadata block
        nilfs2: use semaphore to protect pointer to a writable FS-instance
        nilfs2: fix format string compile warning (ino_t)
        ...
      af8cb8aa
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6 · 6cdb5930
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
        cifs: consolidate reconnect logic in smb_init routines
        cifs: Replace wrtPending with a real reference count
        cifs: protect GlobalOplock_Q with its own spinlock
        cifs: use tcon pointer in cifs_show_options
        cifs: send IPv6 addr in upcall with colon delimiters
        [CIFS] Fix checkpatch warnings
        PATCH] cifs: fix broken mounts when a SSH tunnel is used (try #4)
        [CIFS] Memory leak in ntlmv2 hash calculation
        [CIFS] potential NULL dereference in parse_DFS_referrals()
      6cdb5930
    • Dan Williams's avatar
      at_hdmac: Rework suspend_late()/resume_early() · 33f82d14
      Dan Williams authored
      This patch reworks platform driver power management code
      for at_hdmac from legacy late/early callbacks to dev_pm_ops.
      
      The callbacks are converted for CONFIG_SUSPEND like this:
        suspend_late() -> suspend_noirq()
        resume_early() -> resume_noirq()
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      33f82d14
    • Xiaotian Feng's avatar
      PM: Reset transition_started at dpm_resume_noirq · 3eb132c9
      Xiaotian Feng authored
      transition_started should be set once the preparation of devices for
      a PM has started, reset before starting to resume devices. When
      resuming devices, kernel calls dpm_resume_noirq then
      dpm_resume_end(dpm_resume).  Thus we should reset transition_started
      at dpm_resume_noirq.
      
      This patch fixes ACPI warning when resuming from suspend/hibernate:
      
      ACPI: \_SB_.PCI0.IDE1.PRI1.MAS1 - docking
      ------------[ cut here ]------------
      WARNING: at drivers/base/power/main.c:87 device_pm_add+0x8b/0xcc()
      Hardware name: OptiPlex 760
      Device: acpi
      Parentless device registered during a PM transaction
      
      [rjw: Fixed up the changelog.]
      Signed-off-by: default avatarXiaotian Feng <dfeng@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      3eb132c9
    • Rafael J. Wysocki's avatar
      PM: Update kerneldoc comments in drivers/base/power/main.c · 20d652d7
      Rafael J. Wysocki authored
      The kerneldoc comments in drivers/base/power/main.c are generally
      outdated and some of them don't describe the functions very
      accurately.  Update them and standardize the format to use spaces
      instead of tabs.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      20d652d7
    • Albin Tonnerre's avatar
      PM: Add convenience macro to make switching to dev_pm_ops less error-prone · 9d62ec6c
      Albin Tonnerre authored
      In a number of cases, the .suspend, .freeze, .poweroff and .resume,
      .thaw, .restore functions are identical. However, they all need to be
      assigned to avoid regressionsm as the previous code called .suspend
      resp. .resume in all those cases. SIMPLE_DEV_PM_OPS helps to deal
      with this case.
      
      [rjw: Changed the name of the macro and added the comment explaining its
       purpose.]
      Signed-off-by: default avatarAlbin Tonnerre <albin.tonnerre@free-electrons.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      9d62ec6c
    • Frans Pop's avatar
      hp-wmi: Switch driver to dev_pm_ops · 8dd2b426
      Frans Pop authored
      Gets rid of the following warning:
      
      Platform driver 'hp-wmi' needs updating - please use dev_pm_ops
      
      I tested that the resume handler still works on my HP 2510p notebook.
      
      [rjw: Fixed up the definition of hp_wmi_pm_ops.]
      Signed-off-by: default avatarFrans Pop <elendil@planet.nl>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      8dd2b426
    • Frans Pop's avatar
      floppy: Switch driver to dev_pm_ops · c90cd332
      Frans Pop authored
      Gets rid of the following warning:
      Platform driver 'floppy' needs updating - please use dev_pm_ops
      
      [rjw: Fixed up the definition of floppy_pm_ops.]
      Signed-off-by: default avatarFrans Pop <elendil@planet.nl>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      c90cd332
    • Wu Fengguang's avatar
      PM: Trivial fixes · 8de03073
      Wu Fengguang authored
      Fix the definition of BM_BITS_PER_BLOCK and kerneldoc
      description of create_bm_block_list().
      
      [rjw: Added changelog.]
      Signed-off-by: default avatarWu Fengguang <fengguang.wu@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      8de03073
    • Gerald Schaefer's avatar
      PM / Hibernate / Memory hotplug: Always use for_each_populated_zone() · 98e73dc5
      Gerald Schaefer authored
      Use for_each_populated_zone() instead of for_each_zone() in hibernation
      code. This fixes a bug on s390, where we allow both config options
      HIBERNATION and MEMORY_HOTPLUG, so that we also have a ZONE_MOVABLE
      here. We only allow hibernation if no memory hotplug operation was
      performed, so in fact both features can only be used exclusively, but
      this way we don't need 2 differently configured (distribution) kernels.
      
      If we have an unpopulated ZONE_MOVABLE, we allow hibernation but run
      into a BUG_ON() in memory_bm_test/set/clear_bit() because hibernation
      code iterates through all zones, not only the populated zones, in
      several places. For example, swsusp_free() does for_each_zone() and
      then checks for pfn_valid(), which is true even if the zone is not
      populated, resulting in a BUG_ON() later because the pfn cannot be
      found in the memory bitmap.
      
      Replacing all occurences of for_each_zone() in hibernation code with
      for_each_populated_zone() would fix this issue.
      
      [rjw: Rebased on top of linux-next hibernation patches.]
      Signed-off-by: default avatarGerald Schaefer <gerald.schaefer@de.ibm.com>
      Acked-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      98e73dc5
    • Rafael J. Wysocki's avatar
      PM/Hibernate: Do not try to allocate too much memory too hard (rev. 2) · ef4aede3
      Rafael J. Wysocki authored
      We want to avoid attempting to free too much memory too hard during
      hibernation, so estimate the minimum size of the image to use as the
      lower limit for preallocating memory.
      
      The approach here is based on the (experimental) observation that we
      can't free more page frames than the sum of:
      
      * global_page_state(NR_SLAB_RECLAIMABLE)
      * global_page_state(NR_ACTIVE_ANON)
      * global_page_state(NR_INACTIVE_ANON)
      * global_page_state(NR_ACTIVE_FILE)
      * global_page_state(NR_INACTIVE_FILE)
      
      minus
      
      * global_page_state(NR_FILE_MAPPED)
      
      Namely, if this number is subtracted from the number of saveable
      pages in the system, we get a good estimate of the minimum reasonable
      size of a hibernation image.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarWu Fengguang <fengguang.wu@intel.com>
      ef4aede3
    • Rafael J. Wysocki's avatar
      PM/Hibernate: Do not release preallocated memory unnecessarily (rev. 2) · 64a473cb
      Rafael J. Wysocki authored
      Since the hibernation code is now going to use allocations of memory
      to make enough room for the image, it can also use the page frames
      allocated at this stage as image page frames.  The low-level
      hibernation code needs to be rearranged for this purpose, but it
      allows us to avoid freeing a great number of pages and allocating
      these same pages once again later, so it generally is worth doing.
      
      [rev. 2: Take highmem into account correctly.]
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      64a473cb