aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Van Hensbergen <ericvh@gmail.com>2006-01-08 04:04:56 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-08 23:14:05 -0500
commitf5ef3c105bee3a52486d7b55cef3330fcde9bca6 (patch)
tree528a6b32cb8fbbeeced3a147e77fc544567e3a6f
parent7e7f358c8f8f836c504faa293fda0c1c0733b63c (diff)
[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: Michal Ostrowski <mostrows@watson.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/9p/trans_fd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/9p/trans_fd.c b/fs/9p/trans_fd.c
index 63b58ce98ff4..b7ffb9859588 100644
--- a/fs/9p/trans_fd.c
+++ b/fs/9p/trans_fd.c
@@ -148,12 +148,12 @@ static void v9fs_fd_close(struct v9fs_transport *trans)
148 if (!trans) 148 if (!trans)
149 return; 149 return;
150 150
151 trans->status = Disconnected; 151 ts = xchg(&trans->priv, NULL);
152 ts = trans->priv;
153 152
154 if (!ts) 153 if (!ts)
155 return; 154 return;
156 155
156 trans->status = Disconnected;
157 if (ts->in_file) 157 if (ts->in_file)
158 fput(ts->in_file); 158 fput(ts->in_file);
159 159