From: NeilBrown <neilb@suse.com>
Subject: [PATCH] NFS: nfsiod should not block forever in mempool_alloc()
Patch-mainline: never, kabi
References: git-fixes
Restore the never_fail arg to nfs_commitdata_alloc(), even though it is ignored.
Signed-off-by: NeilBrown <neilb@suse.com>
---
fs/nfs/pnfs_nfs.c | 4 ++--
fs/nfs/write.c | 4 ++--
include/linux/nfs_fs.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
--- a/fs/nfs/pnfs_nfs.c
+++ b/fs/nfs/pnfs_nfs.c
@@ -419,7 +419,7 @@ static struct nfs_commit_data *
pnfs_bucket_fetch_commitdata(struct pnfs_commit_bucket *bucket,
struct nfs_commit_info *cinfo)
{
- struct nfs_commit_data *data = nfs_commitdata_alloc();
+ struct nfs_commit_data *data = nfs_commitdata_alloc(false);
if (!data)
return NULL;
@@ -515,7 +515,7 @@ pnfs_generic_commit_pagelist(struct inod
unsigned int nreq = 0;
if (!list_empty(mds_pages)) {
- data = nfs_commitdata_alloc();
+ data = nfs_commitdata_alloc(false);
if (!data) {
nfs_retry_commit(mds_pages, NULL, cinfo, -1);
return -ENOMEM;
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -70,7 +70,7 @@ static mempool_t *nfs_wdata_mempool;
static struct kmem_cache *nfs_cdata_cachep;
static mempool_t *nfs_commit_mempool;
-struct nfs_commit_data *nfs_commitdata_alloc(void)
+struct nfs_commit_data *nfs_commitdata_alloc(bool never_fail)
{
struct nfs_commit_data *p;
@@ -1772,7 +1772,7 @@ nfs_commit_list(struct inode *inode, str
if (list_empty(head))
return 0;
- data = nfs_commitdata_alloc();
+ data = nfs_commitdata_alloc(false);
if (!data) {
nfs_retry_commit(head, NULL, cinfo, -1);
return -ENOMEM;
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -629,7 +629,7 @@ extern int nfs_wb_all(struct inode *inod
extern int nfs_wb_page(struct inode *inode, struct page *page);
extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
extern int nfs_commit_inode(struct inode *, int);
-extern struct nfs_commit_data *nfs_commitdata_alloc(void);
+extern struct nfs_commit_data *nfs_commitdata_alloc(bool never_fail);
extern void nfs_commit_free(struct nfs_commit_data *data);
bool nfs_commit_end(struct nfs_mds_commit_info *cinfo);