[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1441273129-20185-1-git-send-email-dominique.martinet@cea.fr>
Date: Thu, 3 Sep 2015 11:38:49 +0200
From: Dominique Martinet <dominique.martinet@....fr>
To: v9fs-developer@...ts.sourceforge.net
Cc: Eric Van Hensbergen <ericvh@...il.com>,
Ron Minnich <rminnich@...dia.gov>,
Latchesar Ionkov <lucho@...kov.net>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Dominique Martinet <dominique.martinet@....fr>
Subject: [PATCH] 9p: trans_fd, initialize recv fcall properly if not set
That code really should never be called (rc is allocated in
tag_alloc), but if it had been it couldn't have worked...
Signed-off-by: Dominique Martinet <dominique.martinet@....fr>
---
net/9p/trans_fd.c | 3 +++
1 file changed, 3 insertions(+)
To be honest, I think it might be better to just bail out if we get in
this switch (m->req->rc == NULL after p9_tag_lookup) and not try to
allocate more, because if we get there it's likely a race condition and
silently re-allocating will end up in more troubles than trying to
recover is worth.
Thoughts ?
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index a270dcc..0d9831a 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -363,6 +363,9 @@ static void p9_read_work(struct work_struct *work)
err = -ENOMEM;
goto error;
}
+ m->req->rc.capacity = m->client->msize;
+ m->req->rc.sdata = (char*)m->req->rc +
+ sizeof(struct p9_fcall);
}
m->rc.sdata = (char *)m->req->rc + sizeof(struct p9_fcall);
memcpy(m->rc.sdata, m->tmp_buf, m->rc.capacity);
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists