Commit 55638c52 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'nfs-for-5.0-4' of git://git.linux-nfs.org/projects/anna/linux-nfs

Pull more NFS client fixes from Anna Schumaker:
 "Three fixes this time.

  Nicolas's is for xprtrdma completion vector allocation on single-core
  systems. Greg's adds an error check when allocating a debugfs dentry.
  And Ben's is an additional fix for nfs_page_async_flush() to prevent
  pages from accidentally getting truncated.

  Summary:

   - Make sure Send CQ is allocated on an existing compvec

   - Properly check debugfs dentry before using it

   - Don't use page_file_mapping() after removing a page"

* tag 'nfs-for-5.0-4' of git://git.linux-nfs.org/projects/anna/linux-nfs:
  NFS: Don't use page_file_mapping after removing the page
  rpc: properly check debugfs dentry before using it
  xprtrdma: Make sure Send CQ is allocated on an existing compvec
parents 9a7dcde4 d2ceb7e5
...@@ -238,9 +238,9 @@ static void nfs_grow_file(struct page *page, unsigned int offset, unsigned int c ...@@ -238,9 +238,9 @@ static void nfs_grow_file(struct page *page, unsigned int offset, unsigned int c
} }
/* A writeback failed: mark the page as bad, and invalidate the page cache */ /* A writeback failed: mark the page as bad, and invalidate the page cache */
static void nfs_set_pageerror(struct page *page) static void nfs_set_pageerror(struct address_space *mapping)
{ {
nfs_zap_mapping(page_file_mapping(page)->host, page_file_mapping(page)); nfs_zap_mapping(mapping->host, mapping);
} }
/* /*
...@@ -994,7 +994,7 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr) ...@@ -994,7 +994,7 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr)
nfs_list_remove_request(req); nfs_list_remove_request(req);
if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) && if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) &&
(hdr->good_bytes < bytes)) { (hdr->good_bytes < bytes)) {
nfs_set_pageerror(req->wb_page); nfs_set_pageerror(page_file_mapping(req->wb_page));
nfs_context_set_write_error(req->wb_context, hdr->error); nfs_context_set_write_error(req->wb_context, hdr->error);
goto remove_req; goto remove_req;
} }
...@@ -1348,7 +1348,8 @@ int nfs_updatepage(struct file *file, struct page *page, ...@@ -1348,7 +1348,8 @@ int nfs_updatepage(struct file *file, struct page *page,
unsigned int offset, unsigned int count) unsigned int offset, unsigned int count)
{ {
struct nfs_open_context *ctx = nfs_file_open_context(file); struct nfs_open_context *ctx = nfs_file_open_context(file);
struct inode *inode = page_file_mapping(page)->host; struct address_space *mapping = page_file_mapping(page);
struct inode *inode = mapping->host;
int status = 0; int status = 0;
nfs_inc_stats(inode, NFSIOS_VFSUPDATEPAGE); nfs_inc_stats(inode, NFSIOS_VFSUPDATEPAGE);
...@@ -1366,7 +1367,7 @@ int nfs_updatepage(struct file *file, struct page *page, ...@@ -1366,7 +1367,7 @@ int nfs_updatepage(struct file *file, struct page *page,
status = nfs_writepage_setup(ctx, page, offset, count); status = nfs_writepage_setup(ctx, page, offset, count);
if (status < 0) if (status < 0)
nfs_set_pageerror(page); nfs_set_pageerror(mapping);
else else
__set_page_dirty_nobuffers(page); __set_page_dirty_nobuffers(page);
out: out:
......
...@@ -146,7 +146,7 @@ rpc_clnt_debugfs_register(struct rpc_clnt *clnt) ...@@ -146,7 +146,7 @@ rpc_clnt_debugfs_register(struct rpc_clnt *clnt)
rcu_read_lock(); rcu_read_lock();
xprt = rcu_dereference(clnt->cl_xprt); xprt = rcu_dereference(clnt->cl_xprt);
/* no "debugfs" dentry? Don't bother with the symlink. */ /* no "debugfs" dentry? Don't bother with the symlink. */
if (!xprt->debugfs) { if (IS_ERR_OR_NULL(xprt->debugfs)) {
rcu_read_unlock(); rcu_read_unlock();
return; return;
} }
......
...@@ -527,7 +527,8 @@ rpcrdma_ep_create(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia, ...@@ -527,7 +527,8 @@ rpcrdma_ep_create(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia,
sendcq = ib_alloc_cq(ia->ri_device, NULL, sendcq = ib_alloc_cq(ia->ri_device, NULL,
ep->rep_attr.cap.max_send_wr + 1, ep->rep_attr.cap.max_send_wr + 1,
1, IB_POLL_WORKQUEUE); ia->ri_device->num_comp_vectors > 1 ? 1 : 0,
IB_POLL_WORKQUEUE);
if (IS_ERR(sendcq)) { if (IS_ERR(sendcq)) {
rc = PTR_ERR(sendcq); rc = PTR_ERR(sendcq);
goto out1; goto out1;
......
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