Commit f5ef3c10 authored by Eric Van Hensbergen's avatar Eric Van Hensbergen Committed by Linus Torvalds
Browse files

[PATCH] v9fs: fix fd_close

If a 9pfs server crashes, v9fs_fd_close() is called.  Subsequently, in
cleaning up by performing a umount() on the FS that was provided by this
server v9fs_fd_close() is called again, and uses the old, freed valus of
trans->priv.  This patch ensures that trans->priv can be freed only once,
otherwise this function bails early.

Signed-off-by: default avatarMichal Ostrowski <>
Signed-off-by: Eric Van Hensbergen's avatarEric Van Hensbergen <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 7e7f358c
......@@ -148,12 +148,12 @@ static void v9fs_fd_close(struct v9fs_transport *trans)
if (!trans)
trans->status = Disconnected;
ts = trans->priv;
ts = xchg(&trans->priv, NULL);
if (!ts)
trans->status = Disconnected;
if (ts->in_file)
Supports Markdown
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