diff options
Diffstat (limited to 'fs/nfs')
| -rw-r--r-- | fs/nfs/nfs4proc.c | 3 | ||||
| -rw-r--r-- | fs/nfs/symlink.c | 19 | ||||
| -rw-r--r-- | fs/nfs/write.c | 13 | 
3 files changed, 17 insertions, 18 deletions
| diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 45b35b9b1e36..55e1e3af23a3 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -38,6 +38,7 @@  #include <linux/mm.h>  #include <linux/delay.h>  #include <linux/errno.h> +#include <linux/file.h>  #include <linux/string.h>  #include <linux/ratelimit.h>  #include <linux/printk.h> @@ -5604,6 +5605,7 @@ static struct nfs4_lockdata *nfs4_alloc_lockdata(struct file_lock *fl,  	p->server = server;  	atomic_inc(&lsp->ls_count);  	p->ctx = get_nfs_open_context(ctx); +	get_file(fl->fl_file);  	memcpy(&p->fl, fl, sizeof(p->fl));  	return p;  out_free_seqid: @@ -5716,6 +5718,7 @@ static void nfs4_lock_release(void *calldata)  		nfs_free_seqid(data->arg.lock_seqid);  	nfs4_put_lock_state(data->lsp);  	put_nfs_open_context(data->ctx); +	fput(data->fl.fl_file);  	kfree(data);  	dprintk("%s: done!\n", __func__);  } diff --git a/fs/nfs/symlink.c b/fs/nfs/symlink.c index 2d56200655fe..b6de433da5db 100644 --- a/fs/nfs/symlink.c +++ b/fs/nfs/symlink.c @@ -20,7 +20,6 @@  #include <linux/stat.h>  #include <linux/mm.h>  #include <linux/string.h> -#include <linux/namei.h>  /* Symlink caching in the page cache is even more simplistic   * and straight-forward than readdir caching. @@ -43,7 +42,7 @@ error:  	return -EIO;  } -static void *nfs_follow_link(struct dentry *dentry, struct nameidata *nd) +static const char *nfs_follow_link(struct dentry *dentry, void **cookie)  {  	struct inode *inode = d_inode(dentry);  	struct page *page; @@ -51,19 +50,13 @@ static void *nfs_follow_link(struct dentry *dentry, struct nameidata *nd)  	err = ERR_PTR(nfs_revalidate_mapping(inode, inode->i_mapping));  	if (err) -		goto read_failed; +		return err;  	page = read_cache_page(&inode->i_data, 0,  				(filler_t *)nfs_symlink_filler, inode); -	if (IS_ERR(page)) { -		err = page; -		goto read_failed; -	} -	nd_set_link(nd, kmap(page)); -	return page; - -read_failed: -	nd_set_link(nd, err); -	return NULL; +	if (IS_ERR(page)) +		return ERR_CAST(page); +	*cookie = page; +	return kmap(page);  }  /* diff --git a/fs/nfs/write.c b/fs/nfs/write.c index d12a4be613a5..dfc19f1575a1 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -1845,12 +1845,15 @@ int nfs_wb_all(struct inode *inode)  	trace_nfs_writeback_inode_enter(inode);  	ret = filemap_write_and_wait(inode->i_mapping); -	if (!ret) { -		ret = nfs_commit_inode(inode, FLUSH_SYNC); -		if (!ret) -			pnfs_sync_inode(inode, true); -	} +	if (ret) +		goto out; +	ret = nfs_commit_inode(inode, FLUSH_SYNC); +	if (ret < 0) +		goto out; +	pnfs_sync_inode(inode, true); +	ret = 0; +out:  	trace_nfs_writeback_inode_exit(inode, ret);  	return ret;  } |