Commit 4c1aa6f8 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
  NFS: Fix dentry revalidation for NFSv4 referrals and mountpoint crossings
  NFS: Fix the fsid revalidation in nfs_update_inode()
  SUNRPC: Fix a nfs4 over rdma transport oops
  NFS: Fix an f_mode/f_flags confusion in fs/nfs/write.c
parents 5d49c101 4e99a1ff
...@@ -710,6 +710,8 @@ int nfs_lookup_verify_inode(struct inode *inode, struct nameidata *nd) ...@@ -710,6 +710,8 @@ int nfs_lookup_verify_inode(struct inode *inode, struct nameidata *nd)
{ {
struct nfs_server *server = NFS_SERVER(inode); struct nfs_server *server = NFS_SERVER(inode);
if (test_bit(NFS_INO_MOUNTPOINT, &NFS_I(inode)->flags))
return 0;
if (nd != NULL) { if (nd != NULL) {
/* VFS wants an on-the-wire revalidation */ /* VFS wants an on-the-wire revalidation */
if (nd->flags & LOOKUP_REVAL) if (nd->flags & LOOKUP_REVAL)
......
...@@ -299,6 +299,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) ...@@ -299,6 +299,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
else else
inode->i_op = &nfs_mountpoint_inode_operations; inode->i_op = &nfs_mountpoint_inode_operations;
inode->i_fop = NULL; inode->i_fop = NULL;
set_bit(NFS_INO_MOUNTPOINT, &nfsi->flags);
} }
} else if (S_ISLNK(inode->i_mode)) } else if (S_ISLNK(inode->i_mode))
inode->i_op = &nfs_symlink_inode_operations; inode->i_op = &nfs_symlink_inode_operations;
...@@ -1003,8 +1004,9 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) ...@@ -1003,8 +1004,9 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
server = NFS_SERVER(inode); server = NFS_SERVER(inode);
/* Update the fsid? */ /* Update the fsid? */
if (S_ISDIR(inode->i_mode) if (S_ISDIR(inode->i_mode) &&
&& !nfs_fsid_equal(&server->fsid, &fattr->fsid)) !nfs_fsid_equal(&server->fsid, &fattr->fsid) &&
!test_bit(NFS_INO_MOUNTPOINT, &nfsi->flags))
server->fsid = fattr->fsid; server->fsid = fattr->fsid;
/* /*
......
...@@ -734,7 +734,7 @@ int nfs_updatepage(struct file *file, struct page *page, ...@@ -734,7 +734,7 @@ int nfs_updatepage(struct file *file, struct page *page,
*/ */
if (nfs_write_pageuptodate(page, inode) && if (nfs_write_pageuptodate(page, inode) &&
inode->i_flock == NULL && inode->i_flock == NULL &&
!(file->f_mode & O_SYNC)) { !(file->f_flags & O_SYNC)) {
count = max(count + offset, nfs_page_length(page)); count = max(count + offset, nfs_page_length(page));
offset = 0; offset = 0;
} }
......
...@@ -195,6 +195,7 @@ struct nfs_inode { ...@@ -195,6 +195,7 @@ struct nfs_inode {
#define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */ #define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */
#define NFS_INO_STALE (2) /* possible stale inode */ #define NFS_INO_STALE (2) /* possible stale inode */
#define NFS_INO_ACL_LRU_SET (3) /* Inode is on the LRU list */ #define NFS_INO_ACL_LRU_SET (3) /* Inode is on the LRU list */
#define NFS_INO_MOUNTPOINT (4) /* inode is remote mountpoint */
static inline struct nfs_inode *NFS_I(const struct inode *inode) static inline struct nfs_inode *NFS_I(const struct inode *inode)
{ {
......
...@@ -614,6 +614,10 @@ xprt_rdma_free(void *buffer) ...@@ -614,6 +614,10 @@ xprt_rdma_free(void *buffer)
return; return;
req = container_of(buffer, struct rpcrdma_req, rl_xdr_buf[0]); req = container_of(buffer, struct rpcrdma_req, rl_xdr_buf[0]);
if (req->rl_iov.length == 0) { /* see allocate above */
r_xprt = container_of(((struct rpcrdma_req *) req->rl_buffer)->rl_buffer,
struct rpcrdma_xprt, rx_buf);
} else
r_xprt = container_of(req->rl_buffer, struct rpcrdma_xprt, rx_buf); r_xprt = container_of(req->rl_buffer, struct rpcrdma_xprt, rx_buf);
rep = req->rl_reply; rep = req->rl_reply;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment