]> Git Repo - linux.git/commitdiff
Merge branch 'nfs-for-2.6.37' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
authorLinus Torvalds <[email protected]>
Tue, 26 Oct 2010 16:52:09 +0000 (09:52 -0700)
committerLinus Torvalds <[email protected]>
Tue, 26 Oct 2010 16:52:09 +0000 (09:52 -0700)
* 'nfs-for-2.6.37' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
  net/sunrpc: Use static const char arrays
  nfs4: fix channel attribute sanity-checks
  NFSv4.1: Use more sensible names for 'initialize_mountpoint'
  NFSv4.1: pnfs: filelayout: add driver's LAYOUTGET and GETDEVICEINFO infrastructure
  NFSv4.1: pnfs: add LAYOUTGET and GETDEVICEINFO infrastructure
  NFS: client needs to maintain list of inodes with active layouts
  NFS: create and destroy inode's layout cache
  NFSv4.1: pnfs: filelayout: introduce minimal file layout driver
  NFSv4.1: pnfs: full mount/umount infrastructure
  NFS: set layout driver
  NFS: ask for layouttypes during v4 fsinfo call
  NFS: change stateid to be a union
  NFSv4.1: pnfsd, pnfs: protocol level pnfs constants
  SUNRPC: define xdr_decode_opaque_fixed
  NFSD: remove duplicate NFS4_STATEID_SIZE

1  2 
fs/nfs/Kconfig
fs/nfs/client.c
fs/nfs/file.c
fs/nfs/nfs4state.c
include/linux/nfs_fs.h
net/sunrpc/auth_gss/gss_krb5_mech.c

diff --combined fs/nfs/Kconfig
index 5c55c26af165195b6dd940940b7ee95c417c22b5,d94311943ec66b05fa4d89ac4e9cf9bf1ea7450f..fd667652c5026daf78c878941da5f950dfdb4a5b
@@@ -1,7 -1,6 +1,7 @@@
  config NFS_FS
        tristate "NFS client support"
        depends on INET && FILE_LOCKING
 +      depends on BKL # fix as soon as lockd is done
        select LOCKD
        select SUNRPC
        select NFS_ACL_SUPPORT if NFS_V3_ACL
@@@ -64,7 -63,6 +64,7 @@@ config NFS_V3_AC
  config NFS_V4
        bool "NFS client support for NFS version 4"
        depends on NFS_FS
 +      select SUNRPC_GSS
        help
          This option enables support for version 4 of the NFS protocol
          (RFC 3530) in the kernel's NFS client.
  
  config NFS_V4_1
        bool "NFS client support for NFSv4.1 (EXPERIMENTAL)"
-       depends on NFS_V4 && EXPERIMENTAL
+       depends on NFS_FS && NFS_V4 && EXPERIMENTAL
+       select PNFS_FILE_LAYOUT
        help
          This option enables support for minor version 1 of the NFSv4 protocol
-         (draft-ietf-nfsv4-minorversion1) in the kernel's NFS client.
+         (RFC 5661) in the kernel's NFS client.
  
          If unsure, say N.
  
+ config PNFS_FILE_LAYOUT
+       tristate
  config ROOT_NFS
        bool "Root file system on NFS"
        depends on NFS_FS=y && IP_PNP
diff --combined fs/nfs/client.c
index a882785eba41efdfc05e45773bdc23bb525a48be,8934b2e339df5acfe39f04bfaa213c168e71d652..fd6f0a70021b9fa8c1918372f2cd62d22636dfb9
@@@ -48,6 -48,7 +48,7 @@@
  #include "iostat.h"
  #include "internal.h"
  #include "fscache.h"
+ #include "pnfs.h"
  
  #define NFSDBG_FACILITY               NFSDBG_CLIENT
  
@@@ -155,7 -156,9 +156,9 @@@ static struct nfs_client *nfs_alloc_cli
        cred = rpc_lookup_machine_cred();
        if (!IS_ERR(cred))
                clp->cl_machine_cred = cred;
+ #if defined(CONFIG_NFS_V4_1)
+       INIT_LIST_HEAD(&clp->cl_layouts);
+ #endif
        nfs_fscache_get_client_cookie(clp);
  
        return clp;
@@@ -252,6 -255,7 +255,7 @@@ void nfs_put_client(struct nfs_client *
                nfs_free_client(clp);
        }
  }
+ EXPORT_SYMBOL_GPL(nfs_put_client);
  
  #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
  /*
@@@ -275,7 -279,7 +279,7 @@@ static int nfs_sockaddr_match_ipaddr6(c
            sin1->sin6_scope_id != sin2->sin6_scope_id)
                return 0;
  
 -      return ipv6_addr_equal(&sin1->sin6_addr, &sin1->sin6_addr);
 +      return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr);
  }
  #else /* !defined(CONFIG_IPV6) && !defined(CONFIG_IPV6_MODULE) */
  static int nfs_sockaddr_match_ipaddr6(const struct sockaddr *sa1,
@@@ -900,6 -904,8 +904,8 @@@ static void nfs_server_set_fsinfo(struc
        if (server->wsize > NFS_MAX_FILE_IO_SIZE)
                server->wsize = NFS_MAX_FILE_IO_SIZE;
        server->wpages = (server->wsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+       set_pnfs_layoutdriver(server, fsinfo->layouttype);
        server->wtmult = nfs_block_bits(fsinfo->wtmult, NULL);
  
        server->dtsize = nfs_block_size(fsinfo->dtpref, NULL);
@@@ -939,6 -945,7 +945,7 @@@ static int nfs_probe_fsinfo(struct nfs_
        }
  
        fsinfo.fattr = fattr;
+       fsinfo.layouttype = 0;
        error = clp->rpc_ops->fsinfo(server, mntfh, &fsinfo);
        if (error < 0)
                goto out_error;
@@@ -1021,6 -1028,7 +1028,7 @@@ void nfs_free_server(struct nfs_server 
  {
        dprintk("--> nfs_free_server()\n");
  
+       unset_pnfs_layoutdriver(server);
        spin_lock(&nfs_client_lock);
        list_del(&server->client_link);
        list_del(&server->master_link);
diff --combined fs/nfs/file.c
index e18c31e08a2897fb5c2a7990a0e34147845e37ad,91d019d39122d69a71961378e42263738ee4e88e..e756075637b005ba1937b275c2d77ed3ff8ad676
@@@ -36,6 -36,7 +36,7 @@@
  #include "internal.h"
  #include "iostat.h"
  #include "fscache.h"
+ #include "pnfs.h"
  
  #define NFSDBG_FACILITY               NFSDBG_FILE
  
@@@ -386,6 -387,10 +387,10 @@@ static int nfs_write_begin(struct file 
                file->f_path.dentry->d_name.name,
                mapping->host->i_ino, len, (long long) pos);
  
+       pnfs_update_layout(mapping->host,
+                          nfs_file_open_context(file),
+                          IOMODE_RW);
  start:
        /*
         * Prevent starvation issues if someone is doing a consistency
@@@ -723,6 -728,10 +728,6 @@@ static int do_vfs_lock(struct file *fil
                default:
                        BUG();
        }
 -      if (res < 0)
 -              dprintk(KERN_WARNING "%s: VFS is out of sync with lock manager"
 -                      " - error %d!\n",
 -                              __func__, res);
        return res;
  }
  
diff --combined fs/nfs/nfs4state.c
index aa0b02a610c4d7c797691896c7e3b4c3eb35b682,9c81f4d669501431f8265e8ad5c84b6befd51b84..f575a3126737054efa695db149c9c0f08571793d
@@@ -40,7 -40,7 +40,7 @@@
  
  #include <linux/kernel.h>
  #include <linux/slab.h>
 -#include <linux/smp_lock.h>
 +#include <linux/fs.h>
  #include <linux/nfs_fs.h>
  #include <linux/nfs_idmap.h>
  #include <linux/kthread.h>
@@@ -54,6 -54,7 +54,7 @@@
  #include "callback.h"
  #include "delegation.h"
  #include "internal.h"
+ #include "pnfs.h"
  
  #define OPENOWNER_POOL_SIZE   8
  
@@@ -971,13 -972,13 +972,13 @@@ static int nfs4_reclaim_locks(struct nf
        /* Guard against delegation returns and new lock/unlock calls */
        down_write(&nfsi->rwsem);
        /* Protect inode->i_flock using the BKL */
 -      lock_kernel();
 +      lock_flocks();
        for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
                if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK)))
                        continue;
                if (nfs_file_open_context(fl->fl_file)->state != state)
                        continue;
 -              unlock_kernel();
 +              unlock_flocks();
                status = ops->recover_lock(state, fl);
                switch (status) {
                        case 0:
                                /* kill_proc(fl->fl_pid, SIGLOST, 1); */
                                status = 0;
                }
 -              lock_kernel();
 +              lock_flocks();
        }
 -      unlock_kernel();
 +      unlock_flocks();
  out:
        up_write(&nfsi->rwsem);
        return status;
@@@ -1475,6 -1476,7 +1476,7 @@@ static void nfs4_state_manager(struct n
                        }
                        clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state);
                        set_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state);
+                       pnfs_destroy_all_layouts(clp);
                }
  
                if (test_and_clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state)) {
diff --combined include/linux/nfs_fs.h
index a46e430d96226fe8e9f23324c07a313befd5b0ae,0833bb67c83187ceb340e2d34df7113683f02ede..bba26684acdc5e0e9364419db9cc3fb7802c1109
@@@ -185,9 -185,12 +185,12 @@@ struct nfs_inode 
        struct nfs4_cached_acl  *nfs4_acl;
          /* NFSv4 state */
        struct list_head        open_states;
 -      struct nfs_delegation   *delegation;
 +      struct nfs_delegation __rcu *delegation;
        fmode_t                  delegation_state;
        struct rw_semaphore     rwsem;
+       /* pNFS layout information */
+       struct pnfs_layout_hdr *layout;
  #endif /* CONFIG_NFS_V4*/
  #ifdef CONFIG_NFS_FSCACHE
        struct fscache_cookie   *fscache;
@@@ -615,6 -618,8 +618,8 @@@ nfs_fileid_to_ino_t(u64 fileid
  #define NFSDBG_CLIENT         0x0200
  #define NFSDBG_MOUNT          0x0400
  #define NFSDBG_FSCACHE                0x0800
+ #define NFSDBG_PNFS           0x1000
+ #define NFSDBG_PNFS_LD                0x2000
  #define NFSDBG_ALL            0xFFFF
  
  #ifdef __KERNEL__
index 778e5dfc5144910f83609b8bf48ca2a35011110d,8a4d083c9b30b4799fb0c71d2b5b4219e8520a43..f375decc024b4bbd176ee448fc72e26fc4cd020c
@@@ -237,7 -237,6 +237,7 @@@ get_key(const void *p, const void *end
        if (!supported_gss_krb5_enctype(alg)) {
                printk(KERN_WARNING "gss_kerberos_mech: unsupported "
                        "encryption key algorithm %d\n", alg);
 +              p = ERR_PTR(-EINVAL);
                goto out_err;
        }
        p = simple_get_netobj(p, end, &key);
@@@ -283,19 -282,15 +283,19 @@@ gss_import_v1_context(const void *p, co
        ctx->enctype = ENCTYPE_DES_CBC_RAW;
  
        ctx->gk5e = get_gss_krb5_enctype(ctx->enctype);
 -      if (ctx->gk5e == NULL)
 +      if (ctx->gk5e == NULL) {
 +              p = ERR_PTR(-EINVAL);
                goto out_err;
 +      }
  
        /* The downcall format was designed before we completely understood
         * the uses of the context fields; so it includes some stuff we
         * just give some minimal sanity-checking, and some we ignore
         * completely (like the next twenty bytes): */
 -      if (unlikely(p + 20 > end || p + 20 < p))
 +      if (unlikely(p + 20 > end || p + 20 < p)) {
 +              p = ERR_PTR(-EFAULT);
                goto out_err;
 +      }
        p += 20;
        p = simple_get_bytes(p, end, &tmp, sizeof(tmp));
        if (IS_ERR(p))
@@@ -427,7 -422,7 +427,7 @@@ static in
  context_derive_keys_rc4(struct krb5_ctx *ctx)
  {
        struct crypto_hash *hmac;
-       char sigkeyconstant[] = "signaturekey";
+       static const char sigkeyconstant[] = "signaturekey";
        int slen = strlen(sigkeyconstant) + 1;  /* include null terminator */
        struct hash_desc desc;
        struct scatterlist sg[1];
@@@ -624,7 -619,6 +624,7 @@@ gss_import_v2_context(const void *p, co
        if (ctx->seq_send64 != ctx->seq_send) {
                dprintk("%s: seq_send64 %lx, seq_send %x overflow?\n", __func__,
                        (long unsigned)ctx->seq_send64, ctx->seq_send);
 +              p = ERR_PTR(-EINVAL);
                goto out_err;
        }
        p = simple_get_bytes(p, end, &ctx->enctype, sizeof(ctx->enctype));
This page took 0.11103 seconds and 4 git commands to generate.