aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-05-19 14:20:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-05-19 14:20:48 -0400
commit1113cdfe7d2c1fe08b64caa3affe19260e66dd95 (patch)
tree6f14a78a5a991756bf0b9d538caff197d55de895
parent416716ed390782e373875f39b39ee23c91902688 (diff)
parentfeaff8e5b2cfc3eae02cf65db7a400b0b9ffc596 (diff)
Merge tag 'nfs-for-4.1-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull two NFS client bugfixes from Trond Myklebust: "Highlights include: - fix a Linux-4.1 regression affecting stat() - take an extra reference to fl->fl_file when running a setlk" * tag 'nfs-for-4.1-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: nfs: take extra reference to fl->fl_file when running a setlk nfs: stat(2) fails during cthon04 basic test5 on NFSv4.0
-rw-r--r--fs/nfs/nfs4proc.c3
-rw-r--r--fs/nfs/write.c13
2 files changed, 11 insertions, 5 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 @@
38#include <linux/mm.h> 38#include <linux/mm.h>
39#include <linux/delay.h> 39#include <linux/delay.h>
40#include <linux/errno.h> 40#include <linux/errno.h>
41#include <linux/file.h>
41#include <linux/string.h> 42#include <linux/string.h>
42#include <linux/ratelimit.h> 43#include <linux/ratelimit.h>
43#include <linux/printk.h> 44#include <linux/printk.h>
@@ -5604,6 +5605,7 @@ static struct nfs4_lockdata *nfs4_alloc_lockdata(struct file_lock *fl,
5604 p->server = server; 5605 p->server = server;
5605 atomic_inc(&lsp->ls_count); 5606 atomic_inc(&lsp->ls_count);
5606 p->ctx = get_nfs_open_context(ctx); 5607 p->ctx = get_nfs_open_context(ctx);
5608 get_file(fl->fl_file);
5607 memcpy(&p->fl, fl, sizeof(p->fl)); 5609 memcpy(&p->fl, fl, sizeof(p->fl));
5608 return p; 5610 return p;
5609out_free_seqid: 5611out_free_seqid:
@@ -5716,6 +5718,7 @@ static void nfs4_lock_release(void *calldata)
5716 nfs_free_seqid(data->arg.lock_seqid); 5718 nfs_free_seqid(data->arg.lock_seqid);
5717 nfs4_put_lock_state(data->lsp); 5719 nfs4_put_lock_state(data->lsp);
5718 put_nfs_open_context(data->ctx); 5720 put_nfs_open_context(data->ctx);
5721 fput(data->fl.fl_file);
5719 kfree(data); 5722 kfree(data);
5720 dprintk("%s: done!\n", __func__); 5723 dprintk("%s: done!\n", __func__);
5721} 5724}
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)
1845 trace_nfs_writeback_inode_enter(inode); 1845 trace_nfs_writeback_inode_enter(inode);
1846 1846
1847 ret = filemap_write_and_wait(inode->i_mapping); 1847 ret = filemap_write_and_wait(inode->i_mapping);
1848 if (!ret) { 1848 if (ret)
1849 ret = nfs_commit_inode(inode, FLUSH_SYNC); 1849 goto out;
1850 if (!ret) 1850 ret = nfs_commit_inode(inode, FLUSH_SYNC);
1851 pnfs_sync_inode(inode, true); 1851 if (ret < 0)
1852 } 1852 goto out;
1853 pnfs_sync_inode(inode, true);
1854 ret = 0;
1853 1855
1856out:
1854 trace_nfs_writeback_inode_exit(inode, ret); 1857 trace_nfs_writeback_inode_exit(inode, ret);
1855 return ret; 1858 return ret;
1856} 1859}