Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: NFS: Fix an Oops in the NFSv4 atomic open code NFS: Fix the selection of security flavours in Kconfig NFS: fix the return value of nfs_file_fsync() rpcrdma: Fix SQ size calculation when memreg is FRMR xprtrdma: Do not truncate iova_start values in frmr registrations. nfs: Remove redundant NULL check upon kfree() nfs: Add "lookupcache" to displayed mount options NFS: allow close-to-open cache semantics to apply to root of NFS filesystem SUNRPC: fix NFS client over TCP hangs due to packet loss (Bug 16494)
This commit is contained in:
@@ -63,7 +63,6 @@ config NFS_V3_ACL
|
||||
config NFS_V4
|
||||
bool "NFS client support for NFS version 4"
|
||||
depends on NFS_FS
|
||||
select RPCSEC_GSS_KRB5
|
||||
help
|
||||
This option enables support for version 4 of the NFS protocol
|
||||
(RFC 3530) in the kernel's NFS client.
|
||||
|
||||
@@ -140,6 +140,13 @@ nfs_opendir(struct inode *inode, struct file *filp)
|
||||
|
||||
/* Call generic open code in order to cache credentials */
|
||||
res = nfs_open(inode, filp);
|
||||
if (filp->f_path.dentry == filp->f_path.mnt->mnt_root) {
|
||||
/* This is a mountpoint, so d_revalidate will never
|
||||
* have been called, so we need to refresh the
|
||||
* inode (for close-open consistency) ourselves.
|
||||
*/
|
||||
__nfs_revalidate_inode(NFS_SERVER(inode), inode);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1103,7 +1110,7 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
|
||||
if ((openflags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL))
|
||||
goto no_open_dput;
|
||||
/* We can't create new files, or truncate existing ones here */
|
||||
openflags &= ~(O_CREAT|O_TRUNC);
|
||||
openflags &= ~(O_CREAT|O_EXCL|O_TRUNC);
|
||||
|
||||
/*
|
||||
* Note: we're not holding inode->i_mutex and so may be racing with
|
||||
|
||||
@@ -323,7 +323,7 @@ nfs_file_fsync(struct file *file, int datasync)
|
||||
have_error |= test_bit(NFS_CONTEXT_ERROR_WRITE, &ctx->flags);
|
||||
if (have_error)
|
||||
ret = xchg(&ctx->error, 0);
|
||||
if (!ret)
|
||||
if (!ret && status < 0)
|
||||
ret = status;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2036,7 +2036,8 @@ nfs4_atomic_open(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
|
||||
struct rpc_cred *cred;
|
||||
struct nfs4_state *state;
|
||||
struct dentry *res;
|
||||
fmode_t fmode = nd->intent.open.flags & (FMODE_READ | FMODE_WRITE | FMODE_EXEC);
|
||||
int open_flags = nd->intent.open.flags;
|
||||
fmode_t fmode = open_flags & (FMODE_READ | FMODE_WRITE | FMODE_EXEC);
|
||||
|
||||
if (nd->flags & LOOKUP_CREATE) {
|
||||
attr.ia_mode = nd->intent.open.create_mode;
|
||||
@@ -2044,8 +2045,9 @@ nfs4_atomic_open(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
|
||||
if (!IS_POSIXACL(dir))
|
||||
attr.ia_mode &= ~current_umask();
|
||||
} else {
|
||||
open_flags &= ~O_EXCL;
|
||||
attr.ia_valid = 0;
|
||||
BUG_ON(nd->intent.open.flags & O_CREAT);
|
||||
BUG_ON(open_flags & O_CREAT);
|
||||
}
|
||||
|
||||
cred = rpc_lookup_cred();
|
||||
@@ -2054,7 +2056,7 @@ nfs4_atomic_open(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
|
||||
parent = dentry->d_parent;
|
||||
/* Protect against concurrent sillydeletes */
|
||||
nfs_block_sillyrename(parent);
|
||||
state = nfs4_do_open(dir, &path, fmode, nd->intent.open.flags, &attr, cred);
|
||||
state = nfs4_do_open(dir, &path, fmode, open_flags, &attr, cred);
|
||||
put_rpccred(cred);
|
||||
if (IS_ERR(state)) {
|
||||
if (PTR_ERR(state) == -ENOENT) {
|
||||
@@ -2273,8 +2275,7 @@ static int nfs4_get_referral(struct inode *dir, const struct qstr *name, struct
|
||||
out:
|
||||
if (page)
|
||||
__free_page(page);
|
||||
if (locations)
|
||||
kfree(locations);
|
||||
kfree(locations);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@@ -655,6 +655,13 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
|
||||
|
||||
if (nfss->options & NFS_OPTION_FSCACHE)
|
||||
seq_printf(m, ",fsc");
|
||||
|
||||
if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONEG) {
|
||||
if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONE)
|
||||
seq_printf(m, ",lookupcache=none");
|
||||
else
|
||||
seq_printf(m, ",lookupcache=pos");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -69,7 +69,6 @@ config NFSD_V4
|
||||
depends on NFSD && PROC_FS && EXPERIMENTAL
|
||||
select NFSD_V3
|
||||
select FS_POSIX_ACL
|
||||
select RPCSEC_GSS_KRB5
|
||||
help
|
||||
This option enables support in your system's NFS server for
|
||||
version 4 of the NFS protocol (RFC 3530).
|
||||
|
||||
Reference in New Issue
Block a user