Skip to content

Commit

Permalink
[PATCH] v9fs: make copy of the transport prototype instead of using i…
Browse files Browse the repository at this point in the history
…t directly

When a new session is created it uses a template object of the specified
transport type to instantiate its own copy.  The code for the making a copy of
the template object was lost, and the object itself is attached to the v9fs
session.  This leads to many sessions using the same transport instead of
having their own copy.

The patch puts back the code that makes a copy of the template object.

Signed-off-by: Latchesar Ionkov <[email protected]>
Cc: Eric Van Hensbergen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
lionkov authored and Linus Torvalds committed Sep 23, 2005
1 parent 5b06767 commit a8e63bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fs/9p/v9fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,13 @@ v9fs_session_init(struct v9fs_session_info *v9ses,
goto SessCleanUp;
};

v9ses->transport = trans_proto;
v9ses->transport = kmalloc(sizeof(*v9ses->transport), GFP_KERNEL);
if (!v9ses->transport) {
retval = -ENOMEM;
goto SessCleanUp;
}

memmove(v9ses->transport, trans_proto, sizeof(*v9ses->transport));

if ((retval = v9ses->transport->init(v9ses, dev_name, data)) < 0) {
eprintk(KERN_ERR, "problem initializing transport\n");
Expand Down

0 comments on commit a8e63bf

Please sign in to comment.