diff options
| -rw-r--r-- | fs/nfs/nfs4proc.c | 3 | ||||
| -rw-r--r-- | fs/nfs/write.c | 13 |
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; |
| 5609 | out_free_seqid: | 5611 | out_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 | ||
| 1856 | out: | ||
| 1854 | trace_nfs_writeback_inode_exit(inode, ret); | 1857 | trace_nfs_writeback_inode_exit(inode, ret); |
| 1855 | return ret; | 1858 | return ret; |
| 1856 | } | 1859 | } |
