Merge commit '9249e17fe094d853d1ef7475dd559a2cc7e23d42' into nfs-for-3.6
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 16 Jul 2012 16:01:42 +0000 (12:01 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 16 Jul 2012 16:01:42 +0000 (12:01 -0400)
Resolve conflicts with the VFS atomic open and sget changes.

Conflicts:
fs/nfs/nfs4proc.c

1  2 
fs/nfs/dir.c
fs/nfs/nfs3proc.c
fs/nfs/nfs4proc.c
fs/nfs/proc.c
fs/nfs/super.c
include/linux/nfs_xdr.h

diff --cc fs/nfs/dir.c
Simple merge
Simple merge
@@@ -2804,39 -2806,22 +2804,24 @@@ static int nfs4_proc_readlink(struct in
  }
  
  /*
-  * Got race?
-  * We will need to arrange for the VFS layer to provide an atomic open.
-  * Until then, this create/open method is prone to inefficiency and race
-  * conditions due to the lookup, create, and open VFS calls from sys_open()
-  * placed on the wire.
-  *
-  * Given the above sorry state of affairs, I'm simply sending an OPEN.
-  * The file will be opened again in the subsequent VFS open call
-  * (nfs4_proc_file_open).
-  *
-  * The open for read will just hang around to be used by any process that
-  * opens the file O_RDONLY. This will all be resolved with the VFS changes.
+  * This is just for mknod.  open(O_CREAT) will always do ->open_context().
   */
  static int
  nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
-                  int flags, struct nfs_open_context *ctx)
+                int flags)
  {
-       struct dentry *de = dentry;
+       struct nfs_open_context *ctx;
        struct nfs4_state *state;
-       struct rpc_cred *cred = NULL;
-       struct nfs4_threshold **thp = NULL;
-       fmode_t fmode = 0;
        int status = 0;
  
-       if (ctx != NULL) {
-               cred = ctx->cred;
-               de = ctx->dentry;
-               fmode = ctx->mode;
-               thp = &ctx->mdsthreshold;
-       }
+       ctx = alloc_nfs_open_context(dentry, FMODE_READ);
+       if (IS_ERR(ctx))
+               return PTR_ERR(ctx);
        sattr->ia_mode &= ~current_umask();
-       state = nfs4_do_open(dir, de, fmode, flags, sattr, cred, thp);
 -      state = nfs4_do_open(dir, dentry, ctx->mode, flags, sattr, ctx->cred, NULL);
++      state = nfs4_do_open(dir, dentry, ctx->mode,
++                      flags, sattr, ctx->cred,
++                      &ctx->mdsthreshold);
        d_drop(dentry);
        if (IS_ERR(state)) {
                status = PTR_ERR(state);
diff --cc fs/nfs/proc.c
Simple merge
diff --cc fs/nfs/super.c
Simple merge
Simple merge