linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFS41: Drop lseg ref before fallthru to MDS
@ 2011-07-04  1:30 Peng Tao
  2011-07-09 14:10 ` Benny Halevy
  0 siblings, 1 reply; 15+ messages in thread
From: Peng Tao @ 2011-07-04  1:30 UTC (permalink / raw)
  To: Trond.Myklebust; +Cc: linux-nfs, Peng Tao

There is no need to keep lseg reference when read/write through MDS.
This fixes a null pointer crash at nfs_post_op_update_inode_force_wcc
because nfs4_proc_write_setup will unset wdata->res.fattr if wdata->lseg
is not NULL.

Signed-off-by: Peng Tao <peng_tao@emc.com>
---
 fs/nfs/pnfs.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 30a0394..55fdf02 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1193,6 +1193,9 @@ pnfs_ld_write_done(struct nfs_write_data *data)
 
 	dprintk("%s: pnfs_error=%d, retry via MDS\n", __func__,
 		data->pnfs_error);
+
+	put_lseg(data->lseg);
+	data->lseg = NULL;
 	status = nfs_initiate_write(data, NFS_CLIENT(data->inode),
 				    data->mds_ops, NFS_FILE_SYNC);
 	return status ? : -EAGAIN;
@@ -1240,6 +1243,9 @@ pnfs_ld_read_done(struct nfs_read_data *data)
 
 	dprintk("%s: pnfs_error=%d, retry via MDS\n", __func__,
 		data->pnfs_error);
+
+	put_lseg(data->lseg);
+	data->lseg = NULL;
 	status = nfs_initiate_read(data, NFS_CLIENT(data->inode),
 				   data->mds_ops);
 	return status ? : -EAGAIN;
-- 
1.7.4.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2011-07-27 10:17 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-04  1:30 [PATCH] NFS41: Drop lseg ref before fallthru to MDS Peng Tao
2011-07-09 14:10 ` Benny Halevy
2011-07-20  5:52   ` tao.peng
2011-07-25 19:13     ` Trond Myklebust
2011-07-25 21:35       ` Jim Rees
2011-07-26 15:37       ` Peng Tao
2011-07-26 15:50         ` Myklebust, Trond
2011-07-26 16:08           ` Jim Rees
2011-07-26 16:14             ` Myklebust, Trond
2011-07-26 16:37               ` Benny Halevy
2011-07-26 17:32           ` Peng Tao
2011-07-26 17:37             ` Myklebust, Trond
2011-07-26 17:57               ` Peng Tao
2011-07-27 10:17           ` tao.peng
2011-07-26 16:34       ` Benny Halevy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).