]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
authorLinus Torvalds <torvalds@g5.osdl.org>
Fri, 3 Nov 2006 20:28:27 +0000 (12:28 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 3 Nov 2006 20:28:27 +0000 (12:28 -0800)
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6:
  USB: use MII hooks only if CONFIG_MII is enabled
  USB Storage: unusual_devs.h entry for Sony Ericsson P990i
  USB: xpad: additional USB id's added
  USB: fix compiler issues with newer gcc versions
  USB: HID: add blacklist AIRcable USB, little beautification
  USB: usblp: fix system suspend for some systems
  USB: failure in usblp's error path
  usbtouchscreen: use endpoint address from endpoint descriptor
  USB: sierra: Fix id for Sierra Wireless MC8755 in new table
  USB: new VID/PID-combos for cp2101
  hid-core: big-endian fix fix
  USB: usb-storage: Unusual_dev update
  USB: add another sierra wireless device id

51 files changed:
Documentation/ABI/testing/sysfs-power
Documentation/DocBook/Makefile
Documentation/DocBook/filesystems.tmpl
Documentation/DocBook/journal-api.tmpl [deleted file]
Documentation/accounting/getdelays.c
Documentation/kernel-doc-nano-HOWTO.txt
Documentation/power/interface.txt
arch/i386/kernel/acpi/boot.c
arch/um/include/sysdep-i386/barrier.h [new file with mode: 0644]
arch/um/include/sysdep-x86_64/barrier.h [new file with mode: 0644]
arch/um/os-Linux/process.c
arch/um/os-Linux/signal.c
arch/um/os-Linux/skas/process.c
arch/um/os-Linux/tls.c
block/ll_rw_blk.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/edac/edac_mc.c
drivers/ide/pci/amd74xx.c
drivers/isdn/hysdn/hysdn_sched.c
drivers/md/md.c
drivers/misc/lkdtm.c
drivers/spi/spi.c
fs/cifs/file.c
fs/compat.c
fs/ecryptfs/crypto.c
fs/fuse/file.c
fs/gfs2/ops_address.c
fs/nfsd/nfs4recover.c
fs/reiserfs/super.c
fs/xattr.c
include/asm-powerpc/systbl.h
include/asm-powerpc/unistd.h
include/linux/compat.h
include/linux/kernel.h
include/linux/pm.h
include/linux/ufs_fs.h
ipc/msg.c
ipc/sem.c
ipc/shm.c
ipc/util.c
ipc/util.h
kernel/compat.c
kernel/futex.c
kernel/power/disk.c
kernel/printk.c
kernel/sys_ni.c
mm/migrate.c
mm/page_alloc.c
mm/readahead.c
mm/slab.c
scripts/basic/docproc.c

index d882f8093871386f03ab63c6cc2b820adb2610e6..dcff4d0623add0e7708c642d0cfe210b0c1f48ab 100644 (file)
@@ -21,7 +21,7 @@ Description:
                these states.
 
 What:          /sys/power/disk
-Date:          August 2006
+Date:          September 2006
 Contact:       Rafael J. Wysocki <rjw@sisk.pl>
 Description:
                The /sys/power/disk file controls the operating mode of the
@@ -39,6 +39,19 @@ Description:
                'reboot' - the memory image will be saved by the kernel and
                the system will be rebooted.
 
+               Additionally, /sys/power/disk can be used to turn on one of the
+               two testing modes of the suspend-to-disk mechanism: 'testproc'
+               or 'test'.  If the suspend-to-disk mechanism is in the
+               'testproc' mode, writing 'disk' to /sys/power/state will cause
+               the kernel to disable nonboot CPUs and freeze tasks, wait for 5
+               seconds, unfreeze tasks and enable nonboot CPUs.  If it is in
+               the 'test' mode, writing 'disk' to /sys/power/state will cause
+               the kernel to disable nonboot CPUs and freeze tasks, shrink
+               memory, suspend devices, wait for 5 seconds, resume devices,
+               unfreeze tasks and enable nonboot CPUs.  Then, we are able to
+               look in the log messages and work out, for example, which code
+               is being slow and which device drivers are misbehaving.
+
                The suspend-to-disk method may be chosen by writing to this
                file one of the accepted strings:
 
@@ -46,6 +59,8 @@ Description:
                'platform'
                'shutdown'
                'reboot'
+               'testproc'
+               'test'
 
                It will only change to 'firmware' or 'platform' if the system
                supports that.
index 3bf5086574bc7a0cac90dfc6662ef59e76330167..db9499adbed4df18eb23c8b6e903baf8ced64e6c 100644 (file)
@@ -9,7 +9,7 @@
 DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \
            kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
            procfs-guide.xml writing_usb_driver.xml \
-           kernel-api.xml filesystems.xml journal-api.xml lsm.xml usb.xml \
+           kernel-api.xml filesystems.xml lsm.xml usb.xml \
            gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
            genericirq.xml
 
index 4785032fb6ea213353bb93ffe05809bedbd25ba2..39fa2aba7f9b141d13912d04994ebc4335499000 100644 (file)
      </sect1>
   </chapter>
 
+  <chapter id="LinuxJDBAPI">
+  <chapterinfo>
+  <title>The Linux Journalling API</title>
+
+  <authorgroup>
+  <author>
+     <firstname>Roger</firstname>
+     <surname>Gammans</surname>
+     <affiliation>
+     <address>
+      <email>rgammans@computer-surgery.co.uk</email>
+     </address>
+    </affiliation>
+     </author>
+  </authorgroup>
+
+  <authorgroup>
+   <author>
+    <firstname>Stephen</firstname>
+    <surname>Tweedie</surname>
+    <affiliation>
+     <address>
+      <email>sct@redhat.com</email>
+     </address>
+    </affiliation>
+   </author>
+  </authorgroup>
+
+  <copyright>
+   <year>2002</year>
+   <holder>Roger Gammans</holder>
+  </copyright>
+  </chapterinfo>
+
+  <title>The Linux Journalling API</title>
+
+    <sect1>
+     <title>Overview</title>
+    <sect2>
+     <title>Details</title>
+<para>
+The journalling layer is  easy to use. You need to
+first of all create a journal_t data structure. There are
+two calls to do this dependent on how you decide to allocate the physical
+media on which the journal resides. The journal_init_inode() call
+is for journals stored in filesystem inodes, or the journal_init_dev()
+call can be use for journal stored on a raw device (in a continuous range
+of blocks). A journal_t is a typedef for a struct pointer, so when
+you are finally finished make sure you call journal_destroy() on it
+to free up any used kernel memory.
+</para>
+
+<para>
+Once you have got your journal_t object you need to 'mount' or load the journal
+file, unless of course you haven't initialised it yet - in which case you
+need to call journal_create().
+</para>
+
+<para>
+Most of the time however your journal file will already have been created, but
+before you load it you must call journal_wipe() to empty the journal file.
+Hang on, you say , what if the filesystem wasn't cleanly umount()'d . Well, it is the
+job of the client file system to detect this and skip the call to journal_wipe().
+</para>
+
+<para>
+In either case the next call should be to journal_load() which prepares the
+journal file for use. Note that journal_wipe(..,0) calls journal_skip_recovery()
+for you if it detects any outstanding transactions in the journal and similarly
+journal_load() will call journal_recover() if necessary.
+I would advise reading fs/ext3/super.c for examples on this stage.
+[RGG: Why is the journal_wipe() call necessary - doesn't this needlessly
+complicate the API. Or isn't a good idea for the journal layer to hide
+dirty mounts from the client fs]
+</para>
+
+<para>
+Now you can go ahead and start modifying the underlying
+filesystem. Almost.
+</para>
+
+<para>
+
+You still need to actually journal your filesystem changes, this
+is done by wrapping them into transactions. Additionally you
+also need to wrap the modification of each of the buffers
+with calls to the journal layer, so it knows what the modifications
+you are actually making are. To do this use  journal_start() which
+returns a transaction handle.
+</para>
+
+<para>
+journal_start()
+and its counterpart journal_stop(), which indicates the end of a transaction
+are nestable calls, so you can reenter a transaction if necessary,
+but remember you must call journal_stop() the same number of times as
+journal_start() before the transaction is completed (or more accurately
+leaves the update phase). Ext3/VFS makes use of this feature to simplify
+quota support.
+</para>
+
+<para>
+Inside each transaction you need to wrap the modifications to the
+individual buffers (blocks). Before you start to modify a buffer you
+need to call journal_get_{create,write,undo}_access() as appropriate,
+this allows the journalling layer to copy the unmodified data if it
+needs to. After all the buffer may be part of a previously uncommitted
+transaction.
+At this point you are at last ready to modify a buffer, and once
+you are have done so you need to call journal_dirty_{meta,}data().
+Or if you've asked for access to a buffer you now know is now longer
+required to be pushed back on the device you can call journal_forget()
+in much the same way as you might have used bforget() in the past.
+</para>
+
+<para>
+A journal_flush() may be called at any time to commit and checkpoint
+all your transactions.
+</para>
+
+<para>
+Then at umount time , in your put_super() (2.4) or write_super() (2.5)
+you can then call journal_destroy() to clean up your in-core journal object.
+</para>
+
+<para>
+Unfortunately there a couple of ways the journal layer can cause a deadlock.
+The first thing to note is that each task can only have
+a single outstanding transaction at any one time, remember nothing
+commits until the outermost journal_stop(). This means
+you must complete the transaction at the end of each file/inode/address
+etc. operation you perform, so that the journalling system isn't re-entered
+on another journal. Since transactions can't be nested/batched
+across differing journals, and another filesystem other than
+yours (say ext3) may be modified in a later syscall.
+</para>
+
+<para>
+The second case to bear in mind is that journal_start() can
+block if there isn't enough space in the journal for your transaction
+(based on the passed nblocks param) - when it blocks it merely(!) needs to
+wait for transactions to complete and be committed from other tasks,
+so essentially we are waiting for journal_stop(). So to avoid
+deadlocks you must treat journal_start/stop() as if they
+were semaphores and include them in your semaphore ordering rules to prevent
+deadlocks. Note that journal_extend() has similar blocking behaviour to
+journal_start() so you can deadlock here just as easily as on journal_start().
+</para>
+
+<para>
+Try to reserve the right number of blocks the first time. ;-). This will
+be the maximum number of blocks you are going to touch in this transaction.
+I advise having a look at at least ext3_jbd.h to see the basis on which
+ext3 uses to make these decisions.
+</para>
+
+<para>
+Another wriggle to watch out for is your on-disk block allocation strategy.
+why? Because, if you undo a delete, you need to ensure you haven't reused any
+of the freed blocks in a later transaction. One simple way of doing this
+is make sure any blocks you allocate only have checkpointed transactions
+listed against them. Ext3 does this in ext3_test_allocatable().
+</para>
+
+<para>
+Lock is also providing through journal_{un,}lock_updates(),
+ext3 uses this when it wants a window with a clean and stable fs for a moment.
+eg.
+</para>
+
+<programlisting>
+
+       journal_lock_updates() //stop new stuff happening..
+       journal_flush()        // checkpoint everything.
+       ..do stuff on stable fs
+       journal_unlock_updates() // carry on with filesystem use.
+</programlisting>
+
+<para>
+The opportunities for abuse and DOS attacks with this should be obvious,
+if you allow unprivileged userspace to trigger codepaths containing these
+calls.
+</para>
+
+<para>
+A new feature of jbd since 2.5.25 is commit callbacks with the new
+journal_callback_set() function you can now ask the journalling layer
+to call you back when the transaction is finally committed to disk, so that
+you can do some of your own management. The key to this is the journal_callback
+struct, this maintains the internal callback information but you can
+extend it like this:-
+</para>
+<programlisting>
+       struct  myfs_callback_s {
+               //Data structure element required by jbd..
+               struct journal_callback for_jbd;
+               // Stuff for myfs allocated together.
+               myfs_inode*    i_commited;
+
+       }
+</programlisting>
+
+<para>
+this would be useful if you needed to know when data was committed to a
+particular inode.
+</para>
+
+    </sect2>
+
+    <sect2>
+     <title>Summary</title>
+<para>
+Using the journal is a matter of wrapping the different context changes,
+being each mount, each modification (transaction) and each changed buffer
+to tell the journalling layer about them.
+</para>
+
+<para>
+Here is a some pseudo code to give you an idea of how it works, as
+an example.
+</para>
+
+<programlisting>
+  journal_t* my_jnrl = journal_create();
+  journal_init_{dev,inode}(jnrl,...)
+  if (clean) journal_wipe();
+  journal_load();
+
+   foreach(transaction) { /*transactions must be
+                            completed before
+                            a syscall returns to
+                            userspace*/
+
+          handle_t * xct=journal_start(my_jnrl);
+          foreach(bh) {
+                journal_get_{create,write,undo}_access(xact,bh);
+                if ( myfs_modify(bh) ) { /* returns true
+                                        if makes changes */
+                           journal_dirty_{meta,}data(xact,bh);
+                } else {
+                           journal_forget(bh);
+                }
+          }
+          journal_stop(xct);
+   }
+   journal_destroy(my_jrnl);
+</programlisting>
+    </sect2>
+
+    </sect1>
+
+    <sect1>
+     <title>Data Types</title>
+     <para>
+       The journalling layer uses typedefs to 'hide' the concrete definitions
+       of the structures used. As a client of the JBD layer you can
+       just rely on the using the pointer as a magic cookie  of some sort.
+
+       Obviously the hiding is not enforced as this is 'C'.
+     </para>
+       <sect2><title>Structures</title>
+!Iinclude/linux/jbd.h
+       </sect2>
+    </sect1>
+
+    <sect1>
+     <title>Functions</title>
+     <para>
+       The functions here are split into two groups those that
+       affect a journal as a whole, and those which are used to
+       manage transactions
+     </para>
+       <sect2><title>Journal Level</title>
+!Efs/jbd/journal.c
+!Ifs/jbd/recovery.c
+       </sect2>
+       <sect2><title>Transasction Level</title>
+!Efs/jbd/transaction.c
+       </sect2>
+    </sect1>
+    <sect1>
+     <title>See also</title>
+       <para>
+         <citation>
+          <ulink url="ftp://ftp.uk.linux.org/pub/linux/sct/fs/jfs/journal-design.ps.gz">
+               Journaling the Linux ext2fs Filesystem, LinuxExpo 98, Stephen Tweedie
+          </ulink>
+         </citation>
+       </para>
+       <para>
+          <citation>
+          <ulink url="http://olstrans.sourceforge.net/release/OLS2000-ext3/OLS2000-ext3.html">
+               Ext3 Journalling FileSystem, OLS 2000, Dr. Stephen Tweedie
+          </ulink>
+          </citation>
+       </para>
+    </sect1>
+
+  </chapter>
+
 </book>
diff --git a/Documentation/DocBook/journal-api.tmpl b/Documentation/DocBook/journal-api.tmpl
deleted file mode 100644 (file)
index 2077f9a..0000000
+++ /dev/null
@@ -1,333 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
-       "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
-
-<book id="LinuxJBDAPI">
- <bookinfo>
-  <title>The Linux Journalling API</title>
-  <authorgroup>
-  <author>
-     <firstname>Roger</firstname>
-     <surname>Gammans</surname>
-     <affiliation>
-     <address>
-      <email>rgammans@computer-surgery.co.uk</email>
-     </address>
-    </affiliation>
-     </author> 
-  </authorgroup>
-  
-  <authorgroup>
-   <author>
-    <firstname>Stephen</firstname>
-    <surname>Tweedie</surname>
-    <affiliation>
-     <address>
-      <email>sct@redhat.com</email>
-     </address>
-    </affiliation>
-   </author>
-  </authorgroup>
-
-  <copyright>
-   <year>2002</year>
-   <holder>Roger Gammans</holder>
-  </copyright>
-
-<legalnotice>
-   <para>
-     This documentation is free software; you can redistribute
-     it and/or modify it under the terms of the GNU General Public
-     License as published by the Free Software Foundation; either
-     version 2 of the License, or (at your option) any later
-     version.
-   </para>
-      
-   <para>
-     This program is distributed in the hope that it will be
-     useful, but WITHOUT ANY WARRANTY; without even the implied
-     warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-     See the GNU General Public License for more details.
-   </para>
-      
-   <para>
-     You should have received a copy of the GNU General Public
-     License along with this program; if not, write to the Free
-     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-     MA 02111-1307 USA
-   </para>
-      
-   <para>
-     For more details see the file COPYING in the source
-     distribution of Linux.
-   </para>
-  </legalnotice>
- </bookinfo>
-
-<toc></toc>
-
-  <chapter id="Overview">
-     <title>Overview</title>
-  <sect1>
-     <title>Details</title>
-<para>
-The journalling layer is  easy to use. You need to 
-first of all create a journal_t data structure. There are
-two calls to do this dependent on how you decide to allocate the physical
-media on which the journal resides. The journal_init_inode() call 
-is for journals stored in filesystem inodes, or the journal_init_dev()
-call can be use for journal stored on a raw device (in a continuous range 
-of blocks). A journal_t is a typedef for a struct pointer, so when
-you are finally finished make sure you call journal_destroy() on it
-to free up any used kernel memory.
-</para>
-
-<para>
-Once you have got your journal_t object you need to 'mount' or load the journal
-file, unless of course you haven't initialised it yet - in which case you
-need to call journal_create().
-</para>
-
-<para>
-Most of the time however your journal file will already have been created, but
-before you load it you must call journal_wipe() to empty the journal file.
-Hang on, you say , what if the filesystem wasn't cleanly umount()'d . Well, it is the 
-job of the client file system to detect this and skip the call to journal_wipe().
-</para>
-
-<para>
-In either case the next call should be to journal_load() which prepares the
-journal file for use. Note that journal_wipe(..,0) calls journal_skip_recovery() 
-for you if it detects any outstanding transactions in the journal and similarly
-journal_load() will call journal_recover() if necessary.
-I would advise reading fs/ext3/super.c for examples on this stage.
-[RGG: Why is the journal_wipe() call necessary - doesn't this needlessly 
-complicate the API. Or isn't a good idea for the journal layer to hide 
-dirty mounts from the client fs]
-</para>
-
-<para>
-Now you can go ahead and start modifying the underlying 
-filesystem. Almost.
-</para>
-
-
-<para>
-
-You still need to actually journal your filesystem changes, this
-is done by wrapping them into transactions. Additionally you
-also need to wrap the modification of each of the buffers
-with calls to the journal layer, so it knows what the modifications
-you are actually making are. To do this use  journal_start() which
-returns a transaction handle.
-</para>
-
-<para>
-journal_start()
-and its counterpart journal_stop(), which indicates the end of a transaction
-are nestable calls, so you can reenter a transaction if necessary,
-but remember you must call journal_stop() the same number of times as
-journal_start() before the transaction is completed (or more accurately
-leaves the update phase). Ext3/VFS makes use of this feature to simplify
-quota support.
-</para>
-
-<para>
-Inside each transaction you need to wrap the modifications to the
-individual buffers (blocks). Before you start to modify a buffer you
-need to call journal_get_{create,write,undo}_access() as appropriate,
-this allows the journalling layer to copy the unmodified data if it
-needs to. After all the buffer may be part of a previously uncommitted
-transaction. 
-At this point you are at last ready to modify a buffer, and once
-you are have done so you need to call journal_dirty_{meta,}data().
-Or if you've asked for access to a buffer you now know is now longer 
-required to be pushed back on the device you can call journal_forget()
-in much the same way as you might have used bforget() in the past.
-</para>
-
-<para>
-A journal_flush() may be called at any time to commit and checkpoint
-all your transactions.
-</para>
-
-<para>
-Then at umount time , in your put_super() (2.4) or write_super() (2.5)
-you can then call journal_destroy() to clean up your in-core journal object.
-</para>
-
-
-<para>
-Unfortunately there a couple of ways the journal layer can cause a deadlock.
-The first thing to note is that each task can only have
-a single outstanding transaction at any one time, remember nothing
-commits until the outermost journal_stop(). This means
-you must complete the transaction at the end of each file/inode/address
-etc. operation you perform, so that the journalling system isn't re-entered
-on another journal. Since transactions can't be nested/batched 
-across differing journals, and another filesystem other than
-yours (say ext3) may be modified in a later syscall.
-</para>
-
-<para>
-The second case to bear in mind is that journal_start() can 
-block if there isn't enough space in the journal for your transaction 
-(based on the passed nblocks param) - when it blocks it merely(!) needs to
-wait for transactions to complete and be committed from other tasks, 
-so essentially we are waiting for journal_stop(). So to avoid 
-deadlocks you must treat journal_start/stop() as if they
-were semaphores and include them in your semaphore ordering rules to prevent 
-deadlocks. Note that journal_extend() has similar blocking behaviour to
-journal_start() so you can deadlock here just as easily as on journal_start().
-</para>
-
-<para>
-Try to reserve the right number of blocks the first time. ;-). This will
-be the maximum number of blocks you are going to touch in this transaction.
-I advise having a look at at least ext3_jbd.h to see the basis on which 
-ext3 uses to make these decisions.
-</para>
-
-<para>
-Another wriggle to watch out for is your on-disk block allocation strategy.
-why? Because, if you undo a delete, you need to ensure you haven't reused any
-of the freed blocks in a later transaction. One simple way of doing this
-is make sure any blocks you allocate only have checkpointed transactions
-listed against them. Ext3 does this in ext3_test_allocatable(). 
-</para>
-
-<para>
-Lock is also providing through journal_{un,}lock_updates(),
-ext3 uses this when it wants a window with a clean and stable fs for a moment.
-eg. 
-</para>
-
-<programlisting>
-
-       journal_lock_updates() //stop new stuff happening..
-       journal_flush()        // checkpoint everything.
-       ..do stuff on stable fs
-       journal_unlock_updates() // carry on with filesystem use.
-</programlisting>
-
-<para>
-The opportunities for abuse and DOS attacks with this should be obvious,
-if you allow unprivileged userspace to trigger codepaths containing these
-calls.
-</para>
-
-<para>
-A new feature of jbd since 2.5.25 is commit callbacks with the new
-journal_callback_set() function you can now ask the journalling layer
-to call you back when the transaction is finally committed to disk, so that
-you can do some of your own management. The key to this is the journal_callback
-struct, this maintains the internal callback information but you can
-extend it like this:-
-</para>
-<programlisting>
-       struct  myfs_callback_s {
-               //Data structure element required by jbd..
-               struct journal_callback for_jbd;
-               // Stuff for myfs allocated together.
-               myfs_inode*    i_commited;
-       
-       }
-</programlisting>
-
-<para>
-this would be useful if you needed to know when data was committed to a 
-particular inode.
-</para>
-
-</sect1>
-
-<sect1>
-<title>Summary</title>
-<para>
-Using the journal is a matter of wrapping the different context changes,
-being each mount, each modification (transaction) and each changed buffer
-to tell the journalling layer about them.
-</para>
-
-<para>
-Here is a some pseudo code to give you an idea of how it works, as
-an example.
-</para>
-
-<programlisting>
-  journal_t* my_jnrl = journal_create();
-  journal_init_{dev,inode}(jnrl,...)
-  if (clean) journal_wipe();
-  journal_load();
-
-   foreach(transaction) { /*transactions must be 
-                            completed before
-                            a syscall returns to 
-                            userspace*/
-
-          handle_t * xct=journal_start(my_jnrl);
-          foreach(bh) {
-                journal_get_{create,write,undo}_access(xact,bh);
-                if ( myfs_modify(bh) ) { /* returns true 
-                                        if makes changes */
-                           journal_dirty_{meta,}data(xact,bh);
-                } else {
-                           journal_forget(bh);
-                }
-          }
-          journal_stop(xct);
-   }
-   journal_destroy(my_jrnl);
-</programlisting>
-</sect1>
-
-</chapter>
-
-  <chapter id="adt">
-     <title>Data Types</title>
-     <para>    
-       The journalling layer uses typedefs to 'hide' the concrete definitions
-       of the structures used. As a client of the JBD layer you can
-       just rely on the using the pointer as a magic cookie  of some sort.
-       
-       Obviously the hiding is not enforced as this is 'C'.
-       </para>
-       <sect1><title>Structures</title>
-!Iinclude/linux/jbd.h
-       </sect1>
-</chapter>
-
-  <chapter id="calls">
-     <title>Functions</title>
-     <para>    
-       The functions here are split into two groups those that
-       affect a journal as a whole, and those which are used to
-       manage transactions
-</para>
-       <sect1><title>Journal Level</title>
-!Efs/jbd/journal.c
-!Ifs/jbd/recovery.c
-       </sect1>
-       <sect1><title>Transasction Level</title>
-!Efs/jbd/transaction.c 
-       </sect1>
-</chapter>
-<chapter>
-     <title>See also</title>
-       <para>
-       <citation>
-          <ulink url="ftp://ftp.uk.linux.org/pub/linux/sct/fs/jfs/journal-design.ps.gz">
-               Journaling the Linux ext2fs Filesystem,LinuxExpo 98, Stephen Tweedie
-          </ulink>
-          </citation>
-          </para>
-          <para>
-          <citation>
-          <ulink url="http://olstrans.sourceforge.net/release/OLS2000-ext3/OLS2000-ext3.html">
-               Ext3 Journalling FileSystem , OLS 2000, Dr. Stephen Tweedie
-          </ulink>
-          </citation>
-          </para>
-</chapter>
-
-</book>
index b11792abd6b616d56754edcc9b940a519f7a36fb..bf2b0e2f87e1acb3baef885d5e5ffcffcccb6cea 100644 (file)
@@ -49,7 +49,7 @@ __u64 stime, utime;
        }
 
 /* Maximum size of response requested or message sent */
-#define MAX_MSG_SIZE   256
+#define MAX_MSG_SIZE   1024
 /* Maximum number of cpus expected to be specified in a cpumask */
 #define MAX_CPUS       32
 /* Maximum length of pathname to log file */
index c65233d430f0bb6888117c251576422d3fa9811f..284e7e198e93a288624c6258ff30294c6aacf8d6 100644 (file)
@@ -17,7 +17,7 @@ are:
   special place-holders for where the extracted documentation should
   go.
 
-- scripts/docproc.c
+- scripts/basic/docproc.c
 
   This is a program for converting SGML template files into SGML
   files. When a file is referenced it is searched for symbols
index a66bec222b16cba4caf24720da712c25a2372ed7..74311d7e0f3c9a9d250de17d241953114b335abe 100644 (file)
@@ -30,6 +30,17 @@ testing). The system will support either 'firmware' or 'platform', and
 that is known a priori. But, the user may choose 'shutdown' or
 'reboot' as alternatives. 
 
+Additionally, /sys/power/disk can be used to turn on one of the two testing
+modes of the suspend-to-disk mechanism: 'testproc' or 'test'.  If the
+suspend-to-disk mechanism is in the 'testproc' mode, writing 'disk' to
+/sys/power/state will cause the kernel to disable nonboot CPUs and freeze
+tasks, wait for 5 seconds, unfreeze tasks and enable nonboot CPUs.  If it is
+in the 'test' mode, writing 'disk' to /sys/power/state will cause the kernel
+to disable nonboot CPUs and freeze tasks, shrink memory, suspend devices, wait
+for 5 seconds, resume devices, unfreeze tasks and enable nonboot CPUs.  Then,
+we are able to look in the log messages and work out, for example, which code
+is being slow and which device drivers are misbehaving.
+
 Reading from this file will display what the mode is currently set
 to. Writing to this file will accept one of
 
@@ -37,6 +48,8 @@ to. Writing to this file will accept one of
        'platform'
        'shutdown'
        'reboot'
+       'testproc'
+       'test'
 
 It will only change to 'firmware' or 'platform' if the system supports
 it. 
index ab974ff970730ec48300a2db994d1c9628f07d00..22e4c466e5a3632b74a740d5a9f3111e8d36b3ad 100644 (file)
@@ -70,7 +70,7 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return
 
 #define PREFIX                 "ACPI: "
 
-int acpi_noirq __initdata;     /* skip ACPI IRQ initialization */
+int acpi_noirq;                                /* skip ACPI IRQ initialization */
 int acpi_pci_disabled __initdata;      /* skip ACPI PCI scan and IRQ initialization */
 int acpi_ht __initdata = 1;    /* enable HT */
 
diff --git a/arch/um/include/sysdep-i386/barrier.h b/arch/um/include/sysdep-i386/barrier.h
new file mode 100644 (file)
index 0000000..b58d52c
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef __SYSDEP_I386_BARRIER_H
+#define __SYSDEP_I386_BARRIER_H
+
+/* Copied from include/asm-i386 for use by userspace.  i386 has the option
+ * of using mfence, but I'm just using this, which works everywhere, for now.
+ */
+#define mb() asm volatile("lock; addl $0,0(%esp)")
+
+#endif
diff --git a/arch/um/include/sysdep-x86_64/barrier.h b/arch/um/include/sysdep-x86_64/barrier.h
new file mode 100644 (file)
index 0000000..7b610be
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef __SYSDEP_X86_64_BARRIER_H
+#define __SYSDEP_X86_64_BARRIER_H
+
+/* Copied from include/asm-x86_64 for use by userspace. */
+#define mb()   asm volatile("mfence":::"memory")
+
+#endif
index 51f0893640a6ff39f7c42519506d7dae9ec6c3de..c692a192957a80775f98097ee47d7b0d73dc6b12 100644 (file)
@@ -7,7 +7,6 @@
 #include <stdio.h>
 #include <errno.h>
 #include <signal.h>
-#include <linux/unistd.h>
 #include <sys/mman.h>
 #include <sys/wait.h>
 #include <sys/mman.h>
index 6b81739279d1fe059e3d23310e7b532b363be8a0..b897e8592d7713c3730bfb4ab15f0b9ca716eb1d 100644 (file)
@@ -15,6 +15,7 @@
 #include "user.h"
 #include "signal_kern.h"
 #include "sysdep/sigcontext.h"
+#include "sysdep/barrier.h"
 #include "sigcontext.h"
 #include "mode.h"
 #include "os.h"
 #define SIGALRM_BIT 2
 #define SIGALRM_MASK (1 << SIGALRM_BIT)
 
-static int signals_enabled = 1;
-static int pending = 0;
+/* These are used by both the signal handlers and
+ * block/unblock_signals.  I don't want modifications cached in a
+ * register - they must go straight to memory.
+ */
+static volatile int signals_enabled = 1;
+static volatile int pending = 0;
 
 void sig_handler(int sig, struct sigcontext *sc)
 {
@@ -152,6 +157,12 @@ int change_sig(int signal, int on)
 void block_signals(void)
 {
        signals_enabled = 0;
+       /* This must return with signals disabled, so this barrier
+        * ensures that writes are flushed out before the return.
+        * This might matter if gcc figures out how to inline this and
+        * decides to shuffle this code into the caller.
+        */
+       mb();
 }
 
 void unblock_signals(void)
@@ -171,9 +182,23 @@ void unblock_signals(void)
                 */
                signals_enabled = 1;
 
+               /* Setting signals_enabled and reading pending must
+                * happen in this order.
+                */
+               mb();
+
                save_pending = pending;
-               if(save_pending == 0)
+               if(save_pending == 0){
+                       /* This must return with signals enabled, so
+                        * this barrier ensures that writes are
+                        * flushed out before the return.  This might
+                        * matter if gcc figures out how to inline
+                        * this (unlikely, given its size) and decides
+                        * to shuffle this code into the caller.
+                        */
+                       mb();
                        return;
+               }
 
                pending = 0;
 
index cb9ab54146cc6126ac5a6344a520f4e0e8a8f25c..9b34fe65949a689b97fe004afe00f49f27a32b86 100644 (file)
@@ -14,7 +14,7 @@
 #include <sys/mman.h>
 #include <sys/user.h>
 #include <sys/time.h>
-#include <asm/unistd.h>
+#include <sys/syscall.h>
 #include <asm/types.h>
 #include "user.h"
 #include "sysdep/ptrace.h"
index 9f7999f27c77f9d618dae55e875b5ccd64aaf8f2..16215b9908040a6f36e4462c1f117683e81e3805 100644 (file)
@@ -1,7 +1,7 @@
 #include <errno.h>
+#include <unistd.h>
 #include <sys/ptrace.h>
 #include <sys/syscall.h>
-#include <unistd.h>
 #include <asm/ldt.h>
 #include "sysdep/tls.h"
 #include "uml-config.h"
index c7b1dac8bee91a6bae5a91981af92378d4a280a8..9eaee66405353b6705c438c5aa8a5e9db7776f90 100644 (file)
@@ -3075,11 +3075,12 @@ end_io:
                if (maxsector) {
                        sector_t sector = bio->bi_sector;
 
-                       if (maxsector < nr_sectors || maxsector - nr_sectors < sector) {
+                       if (maxsector < nr_sectors ||
+                                       maxsector - nr_sectors < sector) {
                                /*
-                                * This may well happen - partitions are not checked
-                                * to make sure they are within the size of the
-                                * whole device.
+                                * This may well happen - partitions are not
+                                * checked to make sure they are within the size
+                                * of the whole device.
                                 */
                                handle_bad_sector(bio);
                                goto end_io;
index e5cfb1fa47d173a93c6817b30851935b5ad71353..157fa81a264f58396a4852453e6e2ec950b61a77 100644 (file)
@@ -1867,7 +1867,7 @@ static int ipmi_pci_resume(struct pci_dev *pdev)
 
 static struct pci_device_id ipmi_pci_devices[] = {
        { PCI_DEVICE(PCI_HP_VENDOR_ID, PCI_MMC_DEVICE_ID) },
-       { PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE) }
+       { PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE_MASK) }
 };
 MODULE_DEVICE_TABLE(pci, ipmi_pci_devices);
 
index 4bde30bb3be70c48e16923405bd1609386be9f62..75e9e38330ff4d4de4785ba116c7c2cd20fb6f4d 100644 (file)
@@ -230,34 +230,43 @@ static struct kobj_type ktype_memctrl = {
  */
 static int edac_sysfs_memctrl_setup(void)
 {
-       int err=0;
+       int err = 0;
 
        debugf1("%s()\n", __func__);
 
        /* create the /sys/devices/system/edac directory */
        err = sysdev_class_register(&edac_class);
 
-       if (!err) {
-               /* Init the MC's kobject */
-               memset(&edac_memctrl_kobj, 0, sizeof (edac_memctrl_kobj));
-               edac_memctrl_kobj.parent = &edac_class.kset.kobj;
-               edac_memctrl_kobj.ktype = &ktype_memctrl;
+       if (err) {
+               debugf1("%s() error=%d\n", __func__, err);
+               return err;
+       }
 
-               /* generate sysfs "..../edac/mc"   */
-               err = kobject_set_name(&edac_memctrl_kobj,"mc");
+       /* Init the MC's kobject */
+       memset(&edac_memctrl_kobj, 0, sizeof (edac_memctrl_kobj));
+       edac_memctrl_kobj.parent = &edac_class.kset.kobj;
+       edac_memctrl_kobj.ktype = &ktype_memctrl;
 
-               if (!err) {
-                       /* FIXME: maybe new sysdev_create_subdir() */
-                       err = kobject_register(&edac_memctrl_kobj);
+       /* generate sysfs "..../edac/mc"   */
+       err = kobject_set_name(&edac_memctrl_kobj,"mc");
 
-                       if (err)
-                               debugf1("Failed to register '.../edac/mc'\n");
-                       else
-                               debugf1("Registered '.../edac/mc' kobject\n");
-               }
-       } else
-               debugf1("%s() error=%d\n", __func__, err);
+       if (err)
+               goto fail;
+
+       /* FIXME: maybe new sysdev_create_subdir() */
+       err = kobject_register(&edac_memctrl_kobj);
+
+       if (err) {
+               debugf1("Failed to register '.../edac/mc'\n");
+               goto fail;
+       }
 
+       debugf1("Registered '.../edac/mc' kobject\n");
+
+       return 0;
+
+fail:
+       sysdev_class_unregister(&edac_class);
        return err;
 }
 
index 2b0ea8b6608df5cbd7d75f74397fc1b5111f1d16..753fe0e21456eb15485943c566c3728f1f82d745 100644 (file)
@@ -75,6 +75,7 @@ static struct amd_ide_chip {
        { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE,        0x50, AMD_UDMA_133 },
        { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE,        0x50, AMD_UDMA_133 },
        { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE,        0x50, AMD_UDMA_133 },
+       { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE,        0x50, AMD_UDMA_133 },
        { PCI_DEVICE_ID_AMD_CS5536_IDE,                 0x40, AMD_UDMA_100 },
        { 0 }
 };
@@ -491,7 +492,8 @@ static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
        /* 16 */ DECLARE_NV_DEV("NFORCE-MCP55"),
        /* 17 */ DECLARE_NV_DEV("NFORCE-MCP61"),
        /* 18 */ DECLARE_NV_DEV("NFORCE-MCP65"),
-       /* 19 */ DECLARE_AMD_DEV("AMD5536"),
+       /* 19 */ DECLARE_NV_DEV("NFORCE-MCP67"),
+       /* 20 */ DECLARE_AMD_DEV("AMD5536"),
 };
 
 static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id)
@@ -530,7 +532,8 @@ static struct pci_device_id amd74xx_pci_tbl[] = {
        { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16 },
        { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17 },
        { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18 },
-       { PCI_VENDOR_ID_AMD,    PCI_DEVICE_ID_AMD_CS5536_IDE,           PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19 },
+       { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19 },
+       { PCI_VENDOR_ID_AMD,    PCI_DEVICE_ID_AMD_CS5536_IDE,           PCI_ANY_ID, PCI_ANY_ID, 0, 0, 20 },
        { 0, },
 };
 MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl);
index 1fadf0133e9b6355e4e994b03e6f795d955bc130..18758772b744e21822e22ad557cdb38d19064484 100644 (file)
@@ -155,21 +155,17 @@ hysdn_tx_cfgline(hysdn_card *card, unsigned char *line, unsigned short chan)
        if (card->debug_flags & LOG_SCHED_ASYN)
                hysdn_addlog(card, "async tx-cfg chan=%d len=%d", chan, strlen(line) + 1);
 
-       spin_lock_irqsave(&card->hysdn_lock, flags);
        while (card->async_busy) {
-               sti();
 
                if (card->debug_flags & LOG_SCHED_ASYN)
                        hysdn_addlog(card, "async tx-cfg delayed");
 
                msleep_interruptible(20);               /* Timeout 20ms */
-               if (!--cnt) {
-                       spin_unlock_irqrestore(&card->hysdn_lock, flags);
+               if (!--cnt)
                        return (-ERR_ASYNC_TIME);       /* timed out */
-               }
-               cli();
        }                       /* wait for buffer to become free */
 
+       spin_lock_irqsave(&card->hysdn_lock, flags);
        strcpy(card->async_data, line);
        card->async_len = strlen(line) + 1;
        card->async_channel = chan;
@@ -177,30 +173,23 @@ hysdn_tx_cfgline(hysdn_card *card, unsigned char *line, unsigned short chan)
 
        /* now queue the task */
        schedule_work(&card->irq_queue);
-       sti();
+       spin_unlock_irqrestore(&card->hysdn_lock, flags);
 
        if (card->debug_flags & LOG_SCHED_ASYN)
                hysdn_addlog(card, "async tx-cfg data queued");
 
        cnt++;                  /* short delay */
-       cli();
 
        while (card->async_busy) {
-               sti();
 
                if (card->debug_flags & LOG_SCHED_ASYN)
                        hysdn_addlog(card, "async tx-cfg waiting for tx-ready");
 
                msleep_interruptible(20);               /* Timeout 20ms */
-               if (!--cnt) {
-                       spin_unlock_irqrestore(&card->hysdn_lock, flags);
+               if (!--cnt)
                        return (-ERR_ASYNC_TIME);       /* timed out */
-               }
-               cli();
        }                       /* wait for buffer to become free again */
 
-       spin_unlock_irqrestore(&card->hysdn_lock, flags);
-
        if (card->debug_flags & LOG_SCHED_ASYN)
                hysdn_addlog(card, "async tx-cfg data send");
 
index 50ab4a936e30a3e405e314f648049c518446e018..d111356044038453e782053f66b22d3b555257a7 100644 (file)
@@ -3200,6 +3200,7 @@ static int do_md_run(mddev_t * mddev)
 
        mddev->changed = 1;
        md_new_event(mddev);
+       kobject_uevent(&mddev->gendisk->kobj, KOBJ_ONLINE);
        return 0;
 }
 
@@ -3313,6 +3314,7 @@ static int do_md_stop(mddev_t * mddev, int mode)
 
                        module_put(mddev->pers->owner);
                        mddev->pers = NULL;
+                       kobject_uevent(&mddev->gendisk->kobj, KOBJ_OFFLINE);
                        if (mddev->ro)
                                mddev->ro = 0;
                }
index bbdba7b37e11e1c9d1a12f6b316de8b4f5e414ea..46a9c35943bd9988bf3a95758a4c3a52a5991ae2 100644 (file)
  */
 
 #include <linux/kernel.h>
+#include <linux/fs.h>
 #include <linux/module.h>
+#include <linux/buffer_head.h>
 #include <linux/kprobes.h>
-#include <linux/kallsyms.h>
+#include <linux/list.h>
 #include <linux/init.h>
-#include <linux/irq.h>
 #include <linux/interrupt.h>
+#include <linux/hrtimer.h>
 #include <scsi/scsi_cmnd.h>
 
 #ifdef CONFIG_IDE
@@ -116,16 +118,16 @@ static enum ctype cptype = NONE;
 static int count = DEFAULT_COUNT;
 
 module_param(recur_count, int, 0644);
-MODULE_PARM_DESC(recur_count, "Recurcion level for the stack overflow test,\
-                                default is 10");
+MODULE_PARM_DESC(recur_count, " Recursion level for the stack overflow test, "\
+                                "default is 10");
 module_param(cpoint_name, charp, 0644);
-MODULE_PARM_DESC(cpoint_name, "Crash Point, where kernel is to be crashed");
-module_param(cpoint_type, charp, 06444);
-MODULE_PARM_DESC(cpoint_type, "Crash Point Type, action to be taken on\
-                               hitting the crash point");
-module_param(cpoint_count, int, 06444);
-MODULE_PARM_DESC(cpoint_count, "Crash Point Count, number of times the \
-                               crash point is to be hit to trigger action");
+MODULE_PARM_DESC(cpoint_name, " Crash Point, where kernel is to be crashed");
+module_param(cpoint_type, charp, 0644);
+MODULE_PARM_DESC(cpoint_type, " Crash Point Type, action to be taken on "\
+                               "hitting the crash point");
+module_param(cpoint_count, int, 0644);
+MODULE_PARM_DESC(cpoint_count, " Crash Point Count, number of times the "\
+                               "crash point is to be hit to trigger action");
 
 unsigned int jp_do_irq(unsigned int irq)
 {
index 146298ad73718189c6fd32b4af9f55ad0edba66c..c3c0626f550b80469482d8891654485228b220fe 100644 (file)
@@ -281,7 +281,6 @@ spi_register_board_info(struct spi_board_info const *info, unsigned n)
        up(&board_lock);
        return 0;
 }
-EXPORT_SYMBOL_GPL(spi_register_board_info);
 
 /* FIXME someone should add support for a __setup("spi", ...) that
  * creates board info from kernel command lines
index 976a691c5a680561a97b1aede8840e292b23ce73..7e056b9b49e8bdf8d519564800d3613a8e823b8d 100644 (file)
@@ -1806,13 +1806,6 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
                }
                if ((rc < 0) || (smb_read_data == NULL)) {
                        cFYI(1, ("Read error in readpages: %d", rc));
-                       /* clean up remaing pages off list */
-                       while (!list_empty(page_list) && (i < num_pages)) {
-                               page = list_entry(page_list->prev, struct page,
-                                                 lru);
-                               list_del(&page->lru);
-                               page_cache_release(page);
-                       }
                        break;
                } else if (bytes_read > 0) {
                        pSMBr = (struct smb_com_read_rsp *)smb_read_data;
@@ -1831,13 +1824,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
                                   this case is ok - if we are at server EOF 
                                   we will hit it on next read */
 
-                       /* while (!list_empty(page_list) && (i < num_pages)) {
-                                       page = list_entry(page_list->prev, 
-                                                         struct page, list);
-                                       list_del(&page->list);
-                                       page_cache_release(page);
-                               }
-                               break; */
+                               /* break; */
                        }
                } else {
                        cFYI(1, ("No bytes read (%d) at offset %lld . "
@@ -1845,14 +1832,6 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
                                 bytes_read, offset));
                        /* BB turn off caching and do new lookup on 
                           file size at server? */
-                       while (!list_empty(page_list) && (i < num_pages)) {
-                               page = list_entry(page_list->prev, struct page,
-                                                 lru);
-                               list_del(&page->lru);
-
-                               /* BB removeme - replace with zero of page? */
-                               page_cache_release(page);
-                       }
                        break;
                }
                if (smb_read_data) {
index 50624d4a70c6c771b14c6ff12de3fbde65175aa7..8d0a0018a7d2cfc934934a992e98bcfabf45755c 100644 (file)
@@ -1835,9 +1835,12 @@ asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp,
 
        } while (!ret && !timeout && tsp && (ts.tv_sec || ts.tv_nsec));
 
-       if (ret == 0 && tsp && !(current->personality & STICKY_TIMEOUTS)) {
+       if (tsp) {
                struct compat_timespec rts;
 
+               if (current->personality & STICKY_TIMEOUTS)
+                       goto sticky;
+
                rts.tv_sec = timeout / HZ;
                rts.tv_nsec = (timeout % HZ) * (NSEC_PER_SEC/HZ);
                if (rts.tv_nsec >= NSEC_PER_SEC) {
@@ -1846,8 +1849,19 @@ asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp,
                }
                if (compat_timespec_compare(&rts, &ts) >= 0)
                        rts = ts;
-               if (copy_to_user(tsp, &rts, sizeof(rts)))
-                       ret = -EFAULT;
+               if (copy_to_user(tsp, &rts, sizeof(rts))) {
+sticky:
+                       /*
+                        * If an application puts its timeval in read-only
+                        * memory, we don't want the Linux-specific update to
+                        * the timeval to cause a fault after the select has
+                        * completed successfully. However, because we're not
+                        * updating the timeval, we can't restart the system
+                        * call.
+                        */
+                       if (ret == -ERESTARTNOHAND)
+                               ret = -EINTR;
+               }
        }
 
        if (ret == -ERESTARTNOHAND) {
index f49f105394b70a91268a7ed63d56544aeff10fba..136175a693321300743e02a7dd1f663e3ff41c4d 100644 (file)
@@ -134,7 +134,7 @@ int ecryptfs_crypto_api_algify_cipher_name(char **algified_name,
 
        algified_name_len = (chaining_modifier_len + cipher_name_len + 3);
        (*algified_name) = kmalloc(algified_name_len, GFP_KERNEL);
-       if (!(algified_name)) {
+       if (!(*algified_name)) {
                rc = -ENOMEM;
                goto out;
        }
index 2bb5ace3882dd9e5bcdc6e92af17e5fce873365e..763a50daf1c0a7cc7c336a0d2ba99a64e7baeb1c 100644 (file)
@@ -397,14 +397,14 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
 
        err = -EIO;
        if (is_bad_inode(inode))
-               goto clean_pages_up;
+               goto out;
 
        data.file = file;
        data.inode = inode;
        data.req = fuse_get_req(fc);
        err = PTR_ERR(data.req);
        if (IS_ERR(data.req))
-               goto clean_pages_up;
+               goto out;
 
        err = read_cache_pages(mapping, pages, fuse_readpages_fill, &data);
        if (!err) {
@@ -413,10 +413,7 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
                else
                        fuse_put_request(fc, data.req);
        }
-       return err;
-
-clean_pages_up:
-       put_pages_list(pages);
+out:
        return err;
 }
 
index 8d5963c7e123bbcd1e85b59c1eee629634750ca6..015640b3f123fcde76a28195c1859577c38ef9b7 100644 (file)
@@ -337,13 +337,6 @@ out:
 out_noerror:
        ret = 0;
 out_unlock:
-       /* unlock all pages, we can't do any I/O right now */
-       for (page_idx = 0; page_idx < nr_pages; page_idx++) {
-               struct page *page = list_entry(pages->prev, struct page, lru);
-               list_del(&page->lru);
-               unlock_page(page);
-               page_cache_release(page);
-       }
        if (do_unlock)
                gfs2_holder_uninit(&gh);
        goto out;
index e9d07704680e7f5e99adad09c643f24e16442ee1..81b8565d3837a58137c1c589905e294f0bbb2ccd 100644 (file)
@@ -274,7 +274,7 @@ nfsd4_clear_clid_dir(struct dentry *dir, struct dentry *dentry)
         * any regular files anyway, just in case the directory was created by
         * a kernel from the future.... */
        nfsd4_list_rec_dir(dentry, nfsd4_remove_clid_file);
-       mutex_lock(&dir->d_inode->i_mutex);
+       mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
        status = vfs_rmdir(dir->d_inode, dentry);
        mutex_unlock(&dir->d_inode->i_mutex);
        return status;
index 9041802df83216f4cb6951d1e5cac7fd30f56743..17249994110f5fcf1f8a9f07c18bfb3a35710ca2 100644 (file)
@@ -1619,6 +1619,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
                      "jmacd-8: reiserfs_fill_super: unable to read bitmap");
                goto error;
        }
+       errval = -EINVAL;
 #ifdef CONFIG_REISERFS_CHECK
        SWARN(silent, s, "CONFIG_REISERFS_CHECK is set ON");
        SWARN(silent, s, "- it is slow mode for debugging.");
index 395635100f77a45784057546b0a0c4a490b03249..0901bdc2ce24f43d8ca1a62f3cee4c8519e0b21f 100644 (file)
@@ -48,14 +48,21 @@ xattr_permission(struct inode *inode, const char *name, int mask)
                return 0;
 
        /*
-        * The trusted.* namespace can only accessed by a privilegued user.
+        * The trusted.* namespace can only be accessed by a privileged user.
         */
        if (!strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN))
                return (capable(CAP_SYS_ADMIN) ? 0 : -EPERM);
 
+       /* In user.* namespace, only regular files and directories can have
+        * extended attributes. For sticky directories, only the owner and
+        * privileged user can write attributes.
+        */
        if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) {
-               if (!S_ISREG(inode->i_mode) &&
-                   (!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX))
+               if (!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode))
+                       return -EPERM;
+               if (S_ISDIR(inode->i_mode) && (inode->i_mode & S_ISVTX) &&
+                   (mask & MAY_WRITE) && (current->fsuid != inode->i_uid) &&
+                   !capable(CAP_FOWNER))
                        return -EPERM;
        }
 
index eac85ce101b634061aa5e8830482f372ec08654e..c6a03187f9326839616bd7e0f8dc5dcae0b65f6c 100644 (file)
@@ -261,7 +261,7 @@ SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64)
 PPC_SYS_SPU(rtas)
 OLDSYS(debug_setcontext)
 SYSCALL(ni_syscall)
-SYSCALL(ni_syscall)
+COMPAT_SYS(migrate_pages)
 COMPAT_SYS(mbind)
 COMPAT_SYS(get_mempolicy)
 COMPAT_SYS(set_mempolicy)
index 464a48cce7f51c561f799eb67f95a7e50473c3a2..b5fe93291c969e8ef79c249f353f65222649ba9c 100644 (file)
 #define __NR_rtas              255
 #define __NR_sys_debug_setcontext 256
 /* Number 257 is reserved for vserver */
-/* 258 currently unused */
+#define __NR_migrate_pages     258
 #define __NR_mbind             259
 #define __NR_get_mempolicy     260
 #define __NR_set_mempolicy     261
index f1553196826f29d606c6651a1f6d27d1db5e957c..80b17f440ec191ce352ad7bdb108e8a2fb806bd8 100644 (file)
@@ -230,5 +230,9 @@ asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp);
 extern int compat_printk(const char *fmt, ...);
 extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
 
+asmlinkage long compat_sys_migrate_pages(compat_pid_t pid,
+               compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes,
+               const compat_ulong_t __user *new_nodes);
+
 #endif /* CONFIG_COMPAT */
 #endif /* _LINUX_COMPAT_H */
index 80f39cab470a2800abd64994341f2daca6c66678..24b611147adbb9b77f8a2d49b0b35b7fc2d66009 100644 (file)
@@ -171,6 +171,8 @@ __attribute_const__ roundup_pow_of_two(unsigned long x)
 
 extern int printk_ratelimit(void);
 extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
+extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
+                               unsigned int interval_msec);
 
 static inline void console_silent(void)
 {
index 6b27e07aef199531387dc65bcc400c9157c79a9d..070394e846d008f2be06da51263677a63dc7e220 100644 (file)
@@ -116,7 +116,9 @@ typedef int __bitwise suspend_disk_method_t;
 #define        PM_DISK_PLATFORM        ((__force suspend_disk_method_t) 2)
 #define        PM_DISK_SHUTDOWN        ((__force suspend_disk_method_t) 3)
 #define        PM_DISK_REBOOT          ((__force suspend_disk_method_t) 4)
-#define        PM_DISK_MAX             ((__force suspend_disk_method_t) 5)
+#define        PM_DISK_TEST            ((__force suspend_disk_method_t) 5)
+#define        PM_DISK_TESTPROC        ((__force suspend_disk_method_t) 6)
+#define        PM_DISK_MAX             ((__force suspend_disk_method_t) 7)
 
 struct pm_ops {
        suspend_disk_method_t pm_disk_mode;
index 61eef508b041559203d89ca7a5f4ae3cee3d68ec..28967eda9d7b4375d8d82e730d3ac93207ad754b 100644 (file)
@@ -908,7 +908,7 @@ struct ufs_super_block_third {
                        __fs64   fs_csaddr;     /* blk addr of cyl grp summary area */
                        __fs64    fs_pendingblocks;/* blocks in process of being freed */
                        __fs32    fs_pendinginodes;/*inodes in process of being freed */
-               } fs_u2;
+               } __attribute__ ((packed)) fs_u2;
        } fs_un1;
        union {
                struct {
index 5b213d952545e82684dc1d3f212f311ad3348790..600e06f943a67eb5539d372d945009ae0b1d3e36 100644 (file)
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -124,6 +124,7 @@ void msg_exit_ns(struct ipc_namespace *ns)
        }
        mutex_unlock(&msg_ids(ns).mutex);
 
+       ipc_fini_ids(ns->ids[IPC_MSG_IDS]);
        kfree(ns->ids[IPC_MSG_IDS]);
        ns->ids[IPC_MSG_IDS] = NULL;
 }
index 0dafcc455f920888fe13a474b926ad0bd6825a11..21b3289d640c1eb0989457f42f1eb4b62b675aff 100644 (file)
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -161,6 +161,7 @@ void sem_exit_ns(struct ipc_namespace *ns)
        }
        mutex_unlock(&sem_ids(ns).mutex);
 
+       ipc_fini_ids(ns->ids[IPC_SEM_IDS]);
        kfree(ns->ids[IPC_SEM_IDS]);
        ns->ids[IPC_SEM_IDS] = NULL;
 }
index bfbd317ec11c0be1a73bc85b82d37ee3bbf33dd3..d1198dd07a1a2294ae8eb25e44eecfc3e902070f 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -116,6 +116,7 @@ void shm_exit_ns(struct ipc_namespace *ns)
        }
        mutex_unlock(&shm_ids(ns).mutex);
 
+       ipc_fini_ids(ns->ids[IPC_SHM_IDS]);
        kfree(ns->ids[IPC_SHM_IDS]);
        ns->ids[IPC_SHM_IDS] = NULL;
 }
index 42479e4eec5935b808a198acd34285dae69f2618..cd8bb14a431f648a1327b3e84deb338e806b6a60 100644 (file)
@@ -301,7 +301,7 @@ static int grow_ary(struct ipc_ids* ids, int newsize)
         */
        rcu_assign_pointer(ids->entries, new);
 
-       ipc_rcu_putref(old);
+       __ipc_fini_ids(ids, old);
        return newsize;
 }
 
index c8fd6b9d77b5e0bfddcae8b2bbf5f40d6ae4ea03..e3aa2c5c97dc1f996add0ba9e2827c8cca8d7b28 100644 (file)
@@ -83,6 +83,18 @@ void* ipc_rcu_alloc(int size);
 void ipc_rcu_getref(void *ptr);
 void ipc_rcu_putref(void *ptr);
 
+static inline void __ipc_fini_ids(struct ipc_ids *ids,
+               struct ipc_id_ary *entries)
+{
+       if (entries != &ids->nullentry)
+               ipc_rcu_putref(entries);
+}
+
+static inline void ipc_fini_ids(struct ipc_ids *ids)
+{
+       __ipc_fini_ids(ids, ids->entries);
+}
+
 struct kern_ipc_perm* ipc_get(struct ipc_ids* ids, int id);
 struct kern_ipc_perm* ipc_lock(struct ipc_ids* ids, int id);
 void ipc_lock_by_ptr(struct kern_ipc_perm *ipcp);
index d4898aad6cfa72ff46d78a8728c5d005531a338a..6952dd057300f637e68a059ba1f299d8464ae9f8 100644 (file)
@@ -982,4 +982,37 @@ asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_pages,
        }
        return sys_move_pages(pid, nr_pages, pages, nodes, status, flags);
 }
+
+asmlinkage long compat_sys_migrate_pages(compat_pid_t pid,
+                       compat_ulong_t maxnode,
+                       const compat_ulong_t __user *old_nodes,
+                       const compat_ulong_t __user *new_nodes)
+{
+       unsigned long __user *old = NULL;
+       unsigned long __user *new = NULL;
+       nodemask_t tmp_mask;
+       unsigned long nr_bits;
+       unsigned long size;
+
+       nr_bits = min_t(unsigned long, maxnode - 1, MAX_NUMNODES);
+       size = ALIGN(nr_bits, BITS_PER_LONG) / 8;
+       if (old_nodes) {
+               if (compat_get_bitmap(nodes_addr(tmp_mask), old_nodes, nr_bits))
+                       return -EFAULT;
+               old = compat_alloc_user_space(new_nodes ? size * 2 : size);
+               if (new_nodes)
+                       new = old + size / sizeof(unsigned long);
+               if (copy_to_user(old, nodes_addr(tmp_mask), size))
+                       return -EFAULT;
+       }
+       if (new_nodes) {
+               if (compat_get_bitmap(nodes_addr(tmp_mask), new_nodes, nr_bits))
+                       return -EFAULT;
+               if (new == NULL)
+                       new = compat_alloc_user_space(size);
+               if (copy_to_user(new, nodes_addr(tmp_mask), size))
+                       return -EFAULT;
+       }
+       return sys_migrate_pages(pid, nr_bits + 1, old, new);
+}
 #endif
index b364e0026191caee9dd0ebee3a657e2f65b5c52e..93ef30ba209fc865c7507459f0995849d5d6e336 100644 (file)
@@ -1507,6 +1507,13 @@ static int futex_fd(u32 __user *uaddr, int signal)
        struct futex_q *q;
        struct file *filp;
        int ret, err;
+       static unsigned long printk_interval;
+
+       if (printk_timed_ratelimit(&printk_interval, 60 * 60 * 1000)) {
+               printk(KERN_WARNING "Process `%s' used FUTEX_FD, which "
+                       "will be removed from the kernel in June 2007\n",
+                       current->comm);
+       }
 
        ret = -EINVAL;
        if (!valid_signal(signal))
index d3a158a60312187242c8e1238b68ac5151d11459..b1fb7866b0b31d65ccea5946aa22e9c2881e0322 100644 (file)
@@ -71,7 +71,7 @@ static inline void platform_finish(void)
 
 static int prepare_processes(void)
 {
-       int error;
+       int error = 0;
 
        pm_prepare_console();
 
@@ -84,6 +84,12 @@ static int prepare_processes(void)
                goto thaw;
        }
 
+       if (pm_disk_mode == PM_DISK_TESTPROC) {
+               printk("swsusp debug: Waiting for 5 seconds.\n");
+               mdelay(5000);
+               goto thaw;
+       }
+
        /* Free memory before shutting down devices. */
        if (!(error = swsusp_shrink_memory()))
                return 0;
@@ -120,13 +126,21 @@ int pm_suspend_disk(void)
        if (error)
                return error;
 
+       if (pm_disk_mode == PM_DISK_TESTPROC)
+               goto Thaw;
+
        suspend_console();
        error = device_suspend(PMSG_FREEZE);
        if (error) {
                resume_console();
                printk("Some devices failed to suspend\n");
-               unprepare_processes();
-               return error;
+               goto Thaw;
+       }
+
+       if (pm_disk_mode == PM_DISK_TEST) {
+               printk("swsusp debug: Waiting for 5 seconds.\n");
+               mdelay(5000);
+               goto Done;
        }
 
        pr_debug("PM: snapshotting memory.\n");
@@ -143,16 +157,17 @@ int pm_suspend_disk(void)
                        power_down(pm_disk_mode);
                else {
                        swsusp_free();
-                       unprepare_processes();
-                       return error;
+                       goto Thaw;
                }
-       } else
+       } else {
                pr_debug("PM: Image restored successfully.\n");
+       }
 
        swsusp_free();
  Done:
        device_resume();
        resume_console();
+ Thaw:
        unprepare_processes();
        return error;
 }
@@ -249,6 +264,8 @@ static const char * const pm_disk_modes[] = {
        [PM_DISK_PLATFORM]      = "platform",
        [PM_DISK_SHUTDOWN]      = "shutdown",
        [PM_DISK_REBOOT]        = "reboot",
+       [PM_DISK_TEST]          = "test",
+       [PM_DISK_TESTPROC]      = "testproc",
 };
 
 /**
@@ -303,17 +320,19 @@ static ssize_t disk_store(struct subsystem * s, const char * buf, size_t n)
                }
        }
        if (mode) {
-               if (mode == PM_DISK_SHUTDOWN || mode == PM_DISK_REBOOT)
+               if (mode == PM_DISK_SHUTDOWN || mode == PM_DISK_REBOOT ||
+                    mode == PM_DISK_TEST || mode == PM_DISK_TESTPROC) {
                        pm_disk_mode = mode;
-               else {
+               else {
                        if (pm_ops && pm_ops->enter &&
                            (mode == pm_ops->pm_disk_mode))
                                pm_disk_mode = mode;
                        else
                                error = -EINVAL;
                }
-       } else
+       } else {
                error = -EINVAL;
+       }
 
        pr_debug("PM: suspend-to-disk mode set to '%s'\n",
                 pm_disk_modes[mode]);
index f7d427ef50385d70db6a0222ea3c53a0d8738d03..66426552fbfef24e49442ed08f8d595930feca32 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/security.h>
 #include <linux/bootmem.h>
 #include <linux/syscalls.h>
+#include <linux/jiffies.h>
 
 #include <asm/uaccess.h>
 
@@ -1101,3 +1102,23 @@ int printk_ratelimit(void)
                                printk_ratelimit_burst);
 }
 EXPORT_SYMBOL(printk_ratelimit);
+
+/**
+ * printk_timed_ratelimit - caller-controlled printk ratelimiting
+ * @caller_jiffies: pointer to caller's state
+ * @interval_msecs: minimum interval between prints
+ *
+ * printk_timed_ratelimit() returns true if more than @interval_msecs
+ * milliseconds have elapsed since the last time printk_timed_ratelimit()
+ * returned true.
+ */
+bool printk_timed_ratelimit(unsigned long *caller_jiffies,
+                       unsigned int interval_msecs)
+{
+       if (*caller_jiffies == 0 || time_after(jiffies, *caller_jiffies)) {
+               *caller_jiffies = jiffies + msecs_to_jiffies(interval_msecs);
+               return true;
+       }
+       return false;
+}
+EXPORT_SYMBOL(printk_timed_ratelimit);
index 0e53314b14de7124456faa2ea6cc0f7aa87fcdb9..d7306d0f3dfc76dd061c7dca24e83fa210b33adf 100644 (file)
@@ -135,6 +135,7 @@ cond_syscall(sys_madvise);
 cond_syscall(sys_mremap);
 cond_syscall(sys_remap_file_pages);
 cond_syscall(compat_sys_move_pages);
+cond_syscall(compat_sys_migrate_pages);
 
 /* block-layer dependent */
 cond_syscall(sys_bdflush);
index ba2453f9483dfe4b03b3df1c089607da36ebb60c..b4979d423d2be5b7885f4cd7e24f45bdf7aa27ca 100644 (file)
@@ -952,7 +952,8 @@ asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages,
                                goto out;
 
                        pm[i].node = node;
-               }
+               } else
+                       pm[i].node = 0; /* anything to not match MAX_NUMNODES */
        }
        /* End marker */
        pm[nr_pages].node = MAX_NUMNODES;
index b55bb358b832975265043df8375dc523c2b3d807..bf2f6cff1d6aaeb78097e90efb78f5c6dfc61b32 100644 (file)
@@ -853,7 +853,7 @@ again:
                pcp = &zone_pcp(zone, cpu)->pcp[cold];
                local_irq_save(flags);
                if (!pcp->count) {
-                       pcp->count += rmqueue_bulk(zone, 0,
+                       pcp->count = rmqueue_bulk(zone, 0,
                                                pcp->batch, &pcp->list);
                        if (unlikely(!pcp->count))
                                goto failed;
index 1ba736ac03672bc2863662f32ccf972d3189673b..23cb61a01c6e4123f313f5487a5942e7ee4c5fe4 100644 (file)
@@ -173,6 +173,8 @@ static int read_pages(struct address_space *mapping, struct file *filp,
 
        if (mapping->a_ops->readpages) {
                ret = mapping->a_ops->readpages(filp, mapping, pages, nr_pages);
+               /* Clean up the remaining pages */
+               put_pages_list(pages);
                goto out;
        }
 
index 84c631f30741016e0e73602129ed6c33d6ca88f9..3c4a7e34eddc4de763feea96ce1b654f06bd9052 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -883,7 +883,7 @@ static void init_reap_node(int cpu)
        if (node == MAX_NUMNODES)
                node = first_node(node_online_map);
 
-       __get_cpu_var(reap_node) = node;
+       per_cpu(reap_node, cpu) = node;
 }
 
 static void next_reap_node(void)
index 4ab6cbf092256bad17214ae86529de37c93efd95..d6071cbf13d7645ee53f96089bb8c12af04fcb8b 100644 (file)
@@ -250,7 +250,7 @@ void intfunc(char * filename) {     docfunctions(filename, NOFUNCTION); }
 void extfunc(char * filename) { docfunctions(filename, FUNCTION);   }
 
 /*
- * Document spåecific function(s) in a file.
+ * Document specific function(s) in a file.
  * Call kernel-doc with the following parameters:
  * kernel-doc -docbook -function function1 [-function function2]
  */