Skip to content

Commit 55638c5

Browse files
committed
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
2 parents 9a7dcde + d2ceb7e commit 55638c5

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

fs/nfs/write.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ static void nfs_grow_file(struct page *page, unsigned int offset, unsigned int c
238238
}
239239

240240
/* A writeback failed: mark the page as bad, and invalidate the page cache */
241-
static void nfs_set_pageerror(struct page *page)
241+
static void nfs_set_pageerror(struct address_space *mapping)
242242
{
243-
nfs_zap_mapping(page_file_mapping(page)->host, page_file_mapping(page));
243+
nfs_zap_mapping(mapping->host, mapping);
244244
}
245245

246246
/*
@@ -994,7 +994,7 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr)
994994
nfs_list_remove_request(req);
995995
if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) &&
996996
(hdr->good_bytes < bytes)) {
997-
nfs_set_pageerror(req->wb_page);
997+
nfs_set_pageerror(page_file_mapping(req->wb_page));
998998
nfs_context_set_write_error(req->wb_context, hdr->error);
999999
goto remove_req;
10001000
}
@@ -1348,7 +1348,8 @@ int nfs_updatepage(struct file *file, struct page *page,
13481348
unsigned int offset, unsigned int count)
13491349
{
13501350
struct nfs_open_context *ctx = nfs_file_open_context(file);
1351-
struct inode *inode = page_file_mapping(page)->host;
1351+
struct address_space *mapping = page_file_mapping(page);
1352+
struct inode *inode = mapping->host;
13521353
int status = 0;
13531354

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

13671368
status = nfs_writepage_setup(ctx, page, offset, count);
13681369
if (status < 0)
1369-
nfs_set_pageerror(page);
1370+
nfs_set_pageerror(mapping);
13701371
else
13711372
__set_page_dirty_nobuffers(page);
13721373
out:

net/sunrpc/debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ rpc_clnt_debugfs_register(struct rpc_clnt *clnt)
146146
rcu_read_lock();
147147
xprt = rcu_dereference(clnt->cl_xprt);
148148
/* no "debugfs" dentry? Don't bother with the symlink. */
149-
if (!xprt->debugfs) {
149+
if (IS_ERR_OR_NULL(xprt->debugfs)) {
150150
rcu_read_unlock();
151151
return;
152152
}

net/sunrpc/xprtrdma/verbs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ rpcrdma_ep_create(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia,
527527

528528
sendcq = ib_alloc_cq(ia->ri_device, NULL,
529529
ep->rep_attr.cap.max_send_wr + 1,
530-
1, IB_POLL_WORKQUEUE);
530+
ia->ri_device->num_comp_vectors > 1 ? 1 : 0,
531+
IB_POLL_WORKQUEUE);
531532
if (IS_ERR(sendcq)) {
532533
rc = PTR_ERR(sendcq);
533534
goto out1;

0 commit comments

Comments
 (0)