Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 Jul 2008 17:55:51 +0000 (10:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 Jul 2008 17:55:51 +0000 (10:55 -0700)
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2:
  [PATCH] ocfs2: fix oops in mmap_truncate testing
  configfs: call drop_link() to cleanup after create_link() failure
  configfs: Allow ->make_item() and ->make_group() to return detailed errors.
  configfs: Fix failing mkdir() making racing rmdir() fail
  configfs: Fix deadlock with racing rmdir() and rename()
  configfs: Make configfs_new_dirent() return error code instead of NULL
  configfs: Protect configfs_dirent s_links list mutations
  configfs: Introduce configfs_dirent_lock
  ocfs2: Don't snprintf() without a format.
  ocfs2: Fix CONFIG_OCFS2_DEBUG_FS #ifdefs
  ocfs2/net: Silence build warnings on sparc64
  ocfs2: Handle error during journal load
  ocfs2: Silence an error message in ocfs2_file_aio_read()
  ocfs2: use simple_read_from_buffer()
  ocfs2: fix printk format warnings with OCFS2_FS_STATS=n
  [PATCH 2/2] ocfs2: Instrument fs cluster locks
  [PATCH 1/2] ocfs2: Add CONFIG_OCFS2_FS_STATS config option

1  2 
fs/Kconfig
fs/ocfs2/stack_user.c

diff --combined fs/Kconfig
@@@ -470,6 -470,14 +470,14 @@@ config OCFS2_FS_USERSPACE_CLUSTE
          It is safe to say Y, as the clustering method is run-time
          selectable.
  
+ config OCFS2_FS_STATS
+       bool "OCFS2 statistics"
+       depends on OCFS2_FS
+       default y
+       help
+         This option allows some fs statistics to be captured. Enabling
+         this option may increase the memory consumption.
  config OCFS2_DEBUG_MASKLOG
        bool "OCFS2 logging support"
        depends on OCFS2_FS
@@@ -930,7 -938,7 +938,7 @@@ config PROC_KCOR
  
  config PROC_VMCORE
          bool "/proc/vmcore support (EXPERIMENTAL)"
 -        depends on PROC_FS && EXPERIMENTAL && CRASH_DUMP
 +        depends on PROC_FS && CRASH_DUMP
        default y
          help
          Exports the dump image of crashed kernel in ELF format.
@@@ -1375,9 -1383,6 +1383,9 @@@ config JFFS2_CMODE_FAVOURLZ
  
  endchoice
  
 +# UBIFS File system configuration
 +source "fs/ubifs/Kconfig"
 +
  config CRAMFS
        tristate "Compressed ROM file system support (cramfs)"
        depends on BLOCK
@@@ -1547,6 -1552,10 +1555,6 @@@ config UFS_F
            The recently released UFS2 variant (used in FreeBSD 5.x) is
            READ-ONLY supported.
  
 -        If you only intend to mount files from some other Unix over the
 -        network using NFS, you don't need the UFS file system support (but
 -        you need NFS file system support obviously).
 -
          Note that this option is generally not needed for floppies, since a
          good portable way to transport files and directories between unixes
          (and even other operating systems) is given by the tar program ("man
@@@ -1586,7 -1595,6 +1594,7 @@@ menuconfig NETWORK_FILESYSTEM
          Say Y here to get to see options for network filesystems and
          filesystem-related networking code, such as NFS daemon and
          RPCSEC security modules.
 +
          This option alone does not add any kernel code.
  
          If you say N, all options in this submenu will be skipped and
  if NETWORK_FILESYSTEMS
  
  config NFS_FS
 -      tristate "NFS file system support"
 +      tristate "NFS client support"
        depends on INET
        select LOCKD
        select SUNRPC
        select NFS_ACL_SUPPORT if NFS_V3_ACL
        help
 -        If you are connected to some other (usually local) Unix computer
 -        (using SLIP, PLIP, PPP or Ethernet) and want to mount files residing
 -        on that computer (the NFS server) using the Network File Sharing
 -        protocol, say Y. "Mounting files" means that the client can access
 -        the files with usual UNIX commands as if they were sitting on the
 -        client's hard disk. For this to work, the server must run the
 -        programs nfsd and mountd (but does not need to have NFS file system
 -        support enabled in its kernel). NFS is explained in the Network
 -        Administrator's Guide, available from
 -        <http://www.tldp.org/docs.html#guide>, on its man page: "man
 -        nfs", and in the NFS-HOWTO.
 +        Choose Y here if you want to access files residing on other
 +        computers using Sun's Network File System protocol.  To compile
 +        this file system support as a module, choose M here: the module
 +        will be called nfs.
  
 -        A superior but less widely used alternative to NFS is provided by
 -        the Coda file system; see "Coda file system support" below.
 +        To mount file systems exported by NFS servers, you also need to
 +        install the user space mount.nfs command which can be found in
 +        the Linux nfs-utils package, available from http://linux-nfs.org/.
 +        Information about using the mount command is available in the
 +        mount(8) man page.  More detail about the Linux NFS client
 +        implementation is available via the nfs(5) man page.
  
 -        If you say Y here, you should have said Y to TCP/IP networking also.
 -        This option would enlarge your kernel by about 27 KB.
 -
 -        To compile this file system support as a module, choose M here: the
 -        module will be called nfs.
 +        Below you can choose which versions of the NFS protocol are
 +        available in the kernel to mount NFS servers.  Support for NFS
 +        version 2 (RFC 1094) is always available when NFS_FS is selected.
  
 -        If you are configuring a diskless machine which will mount its root
 -        file system over NFS at boot time, say Y here and to "Kernel
 -        level IP autoconfiguration" above and to "Root file system on NFS"
 -        below. You cannot compile this driver as a module in this case.
 -        There are two packages designed for booting diskless machines over
 -        the net: netboot, available from
 -        <http://ftp1.sourceforge.net/netboot/>, and Etherboot,
 -        available from <http://ftp1.sourceforge.net/etherboot/>.
 +        To configure a system which mounts its root file system via NFS
 +        at boot time, say Y here, select "Kernel level IP
 +        autoconfiguration" in the NETWORK menu, and select "Root file
 +        system on NFS" below.  You cannot compile this file system as a
 +        module in this case.
  
 -        If you don't know what all this is about, say N.
 +        If unsure, say N.
  
  config NFS_V3
 -      bool "Provide NFSv3 client support"
 +      bool "NFS client support for NFS version 3"
        depends on NFS_FS
        help
 -        Say Y here if you want your NFS client to be able to speak version
 -        3 of the NFS protocol.
 +        This option enables support for version 3 of the NFS protocol
 +        (RFC 1813) in the kernel's NFS client.
  
          If unsure, say Y.
  
  config NFS_V3_ACL
 -      bool "Provide client support for the NFSv3 ACL protocol extension"
 +      bool "NFS client support for the NFSv3 ACL protocol extension"
        depends on NFS_V3
        help
 -        Implement the NFSv3 ACL protocol extension for manipulating POSIX
 -        Access Control Lists.  The server should also be compiled with
 -        the NFSv3 ACL protocol extension; see the CONFIG_NFSD_V3_ACL option.
 +        Some NFS servers support an auxiliary NFSv3 ACL protocol that
 +        Sun added to Solaris but never became an official part of the
 +        NFS version 3 protocol.  This protocol extension allows
 +        applications on NFS clients to manipulate POSIX Access Control
 +        Lists on files residing on NFS servers.  NFS servers enforce
 +        ACLs on local files whether this protocol is available or not.
 +
 +        Choose Y here if your NFS server supports the Solaris NFSv3 ACL
 +        protocol extension and you want your NFS client to allow
 +        applications to access and modify ACLs on files on the server.
 +
 +        Most NFS servers don't support the Solaris NFSv3 ACL protocol
 +        extension.  You can choose N here or specify the "noacl" mount
 +        option to prevent your NFS client from trying to use the NFSv3
 +        ACL protocol.
  
          If unsure, say N.
  
  config NFS_V4
 -      bool "Provide NFSv4 client support (EXPERIMENTAL)"
 +      bool "NFS client support for NFS version 4 (EXPERIMENTAL)"
        depends on NFS_FS && EXPERIMENTAL
        select RPCSEC_GSS_KRB5
        help
 -        Say Y here if you want your NFS client to be able to speak the newer
 -        version 4 of the NFS protocol.
 +        This option enables support for version 4 of the NFS protocol
 +        (RFC 3530) in the kernel's NFS client.
  
 -        Note: Requires auxiliary userspace daemons which may be found on
 -              http://www.citi.umich.edu/projects/nfsv4/
 +        To mount NFS servers using NFSv4, you also need to install user
 +        space programs which can be found in the Linux nfs-utils package,
 +        available from http://linux-nfs.org/.
  
          If unsure, say N.
  
 +config ROOT_NFS
 +      bool "Root file system on NFS"
 +      depends on NFS_FS=y && IP_PNP
 +      help
 +        If you want your system to mount its root file system via NFS,
 +        choose Y here.  This is common practice for managing systems
 +        without local permanent storage.  For details, read
 +        <file:Documentation/filesystems/nfsroot.txt>.
 +
 +        Most people say N here.
 +
  config NFSD
        tristate "NFS server support"
        depends on INET
@@@ -1762,6 -1754,20 +1770,6 @@@ config NFSD_V
  
          If unsure, say N.
  
 -config ROOT_NFS
 -      bool "Root file system on NFS"
 -      depends on NFS_FS=y && IP_PNP
 -      help
 -        If you want your Linux box to mount its whole root file system (the
 -        one containing the directory /) from some other computer over the
 -        net via NFS (presumably because your box doesn't have a hard disk),
 -        say Y. Read <file:Documentation/filesystems/nfsroot.txt> for
 -        details. It is likely that in this case, you also want to say Y to
 -        "Kernel level IP autoconfiguration" so that your box can discover
 -        its network address at boot time.
 -
 -        Most people say N here.
 -
  config LOCKD
        tristate
  
@@@ -1802,6 -1808,27 +1810,6 @@@ config SUNRPC_XPRT_RDM
  
          If unsure, say N.
  
 -config SUNRPC_BIND34
 -      bool "Support for rpcbind versions 3 & 4 (EXPERIMENTAL)"
 -      depends on SUNRPC && EXPERIMENTAL
 -      default n
 -      help
 -        RPC requests over IPv6 networks require support for larger
 -        addresses when performing an RPC bind.  Sun added support for
 -        IPv6 addressing by creating two new versions of the rpcbind
 -        protocol (RFC 1833).
 -
 -        This option enables support in the kernel RPC client for
 -        querying rpcbind servers via versions 3 and 4 of the rpcbind
 -        protocol.  The kernel automatically falls back to version 2
 -        if a remote rpcbind service does not support versions 3 or 4.
 -        By themselves, these new versions do not provide support for
 -        RPC over IPv6, but the new protocol versions are necessary to
 -        support it.
 -
 -        If unsure, say N to get traditional behavior (version 2 rpcbind
 -        requests only).
 -
  config RPCSEC_GSS_KRB5
        tristate "Secure RPC: Kerberos V mechanism (EXPERIMENTAL)"
        depends on SUNRPC && EXPERIMENTAL
diff --combined fs/ocfs2/stack_user.c
@@@ -21,7 -21,6 +21,7 @@@
  #include <linux/fs.h>
  #include <linux/miscdevice.h>
  #include <linux/mutex.h>
 +#include <linux/smp_lock.h>
  #include <linux/reboot.h>
  #include <asm/uaccess.h>
  
@@@ -550,26 -549,17 +550,17 @@@ static ssize_t ocfs2_control_read(struc
                                  size_t count,
                                  loff_t *ppos)
  {
-       char *proto_string = OCFS2_CONTROL_PROTO;
-       size_t to_write = 0;
-       if (*ppos >= OCFS2_CONTROL_PROTO_LEN)
-               return 0;
-       to_write = OCFS2_CONTROL_PROTO_LEN - *ppos;
-       if (to_write > count)
-               to_write = count;
-       if (copy_to_user(buf, proto_string + *ppos, to_write))
-               return -EFAULT;
+       ssize_t ret;
  
-       *ppos += to_write;
+       ret = simple_read_from_buffer(buf, count, ppos,
+                       OCFS2_CONTROL_PROTO, OCFS2_CONTROL_PROTO_LEN);
  
        /* Have we read the whole protocol list? */
-       if (*ppos >= OCFS2_CONTROL_PROTO_LEN)
+       if (ret > 0 && *ppos >= OCFS2_CONTROL_PROTO_LEN)
                ocfs2_control_set_handshake_state(file,
                                                  OCFS2_CONTROL_HANDSHAKE_READ);
  
-       return to_write;
+       return ret;
  }
  
  static int ocfs2_control_release(struct inode *inode, struct file *file)
@@@ -620,12 -610,10 +611,12 @@@ static int ocfs2_control_open(struct in
                return -ENOMEM;
        p->op_this_node = -1;
  
 +      lock_kernel();
        mutex_lock(&ocfs2_control_lock);
        file->private_data = p;
        list_add(&p->op_list, &ocfs2_control_private_list);
        mutex_unlock(&ocfs2_control_lock);
 +      unlock_kernel();
  
        return 0;
  }