Skip to content

Commit

Permalink
Merge tag 'nfs-for-5.0-4' of git://git.linux-nfs.org/projects/anna/li…
Browse files Browse the repository at this point in the history
…nux-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
  • Loading branch information
torvalds committed Feb 17, 2019
2 parents 9a7dcde + d2ceb7e commit 55638c5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
11 changes: 6 additions & 5 deletions fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
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);
}

/*
Expand Down Expand Up @@ -994,7 +994,7 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr)
nfs_list_remove_request(req);
if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) &&
(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);
goto remove_req;
}
Expand Down Expand Up @@ -1348,7 +1348,8 @@ int nfs_updatepage(struct file *file, struct page *page,
unsigned int offset, unsigned int count)
{
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;

nfs_inc_stats(inode, NFSIOS_VFSUPDATEPAGE);
Expand All @@ -1366,7 +1367,7 @@ int nfs_updatepage(struct file *file, struct page *page,

status = nfs_writepage_setup(ctx, page, offset, count);
if (status < 0)
nfs_set_pageerror(page);
nfs_set_pageerror(mapping);
else
__set_page_dirty_nobuffers(page);
out:
Expand Down
2 changes: 1 addition & 1 deletion net/sunrpc/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ rpc_clnt_debugfs_register(struct rpc_clnt *clnt)
rcu_read_lock();
xprt = rcu_dereference(clnt->cl_xprt);
/* no "debugfs" dentry? Don't bother with the symlink. */
if (!xprt->debugfs) {
if (IS_ERR_OR_NULL(xprt->debugfs)) {
rcu_read_unlock();
return;
}
Expand Down
3 changes: 2 additions & 1 deletion net/sunrpc/xprtrdma/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,8 @@ rpcrdma_ep_create(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia,

sendcq = ib_alloc_cq(ia->ri_device, NULL,
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)) {
rc = PTR_ERR(sendcq);
goto out1;
Expand Down

0 comments on commit 55638c5

Please sign in to comment.