Commit 1113cdfe authored by Linus Torvalds's avatar Linus Torvalds

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
parents 416716ed feaff8e5
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/file.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/ratelimit.h> #include <linux/ratelimit.h>
#include <linux/printk.h> #include <linux/printk.h>
...@@ -5604,6 +5605,7 @@ static struct nfs4_lockdata *nfs4_alloc_lockdata(struct file_lock *fl, ...@@ -5604,6 +5605,7 @@ static struct nfs4_lockdata *nfs4_alloc_lockdata(struct file_lock *fl,
p->server = server; p->server = server;
atomic_inc(&lsp->ls_count); atomic_inc(&lsp->ls_count);
p->ctx = get_nfs_open_context(ctx); p->ctx = get_nfs_open_context(ctx);
get_file(fl->fl_file);
memcpy(&p->fl, fl, sizeof(p->fl)); memcpy(&p->fl, fl, sizeof(p->fl));
return p; return p;
out_free_seqid: out_free_seqid:
...@@ -5716,6 +5718,7 @@ static void nfs4_lock_release(void *calldata) ...@@ -5716,6 +5718,7 @@ static void nfs4_lock_release(void *calldata)
nfs_free_seqid(data->arg.lock_seqid); nfs_free_seqid(data->arg.lock_seqid);
nfs4_put_lock_state(data->lsp); nfs4_put_lock_state(data->lsp);
put_nfs_open_context(data->ctx); put_nfs_open_context(data->ctx);
fput(data->fl.fl_file);
kfree(data); kfree(data);
dprintk("%s: done!\n", __func__); dprintk("%s: done!\n", __func__);
} }
......
...@@ -1845,12 +1845,15 @@ int nfs_wb_all(struct inode *inode) ...@@ -1845,12 +1845,15 @@ int nfs_wb_all(struct inode *inode)
trace_nfs_writeback_inode_enter(inode); trace_nfs_writeback_inode_enter(inode);
ret = filemap_write_and_wait(inode->i_mapping); ret = filemap_write_and_wait(inode->i_mapping);
if (!ret) { if (ret)
ret = nfs_commit_inode(inode, FLUSH_SYNC); goto out;
if (!ret) ret = nfs_commit_inode(inode, FLUSH_SYNC);
pnfs_sync_inode(inode, true); if (ret < 0)
} goto out;
pnfs_sync_inode(inode, true);
ret = 0;
out:
trace_nfs_writeback_inode_exit(inode, ret); trace_nfs_writeback_inode_exit(inode, ret);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment