aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs/vnode.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2007-05-11 01:22:20 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-11 11:29:32 -0400
commit0f300ca9284caabdd2c07c7f91b90f1f530f614e (patch)
tree12c64af9cbaeafbe47e63872a750badb623a7e81 /fs/afs/vnode.c
parent9d577b6a31a53a19d3b0fe414d645a61ef201846 (diff)
AFS: fix a couple of problems with unlinking AFS files
Fix a couple of problems with unlinking AFS files. (1) The parent directory wasn't being updated properly between unlink() and the following lookup(). It seems that, for some reason, invalidate_remote_inode() wasn't discarding the directory contents correctly, so this patch calls invalidate_inode_pages2() instead on non-regular files. (2) afs_vnode_deleted_remotely() should handle vnodes that don't have a source server recorded without oopsing. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/afs/vnode.c')
-rw-r--r--fs/afs/vnode.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/fs/afs/vnode.c b/fs/afs/vnode.c
index ec814660209..bea8bd9e7b2 100644
--- a/fs/afs/vnode.c
+++ b/fs/afs/vnode.c
@@ -175,24 +175,33 @@ static void afs_vnode_deleted_remotely(struct afs_vnode *vnode)
175{ 175{
176 struct afs_server *server; 176 struct afs_server *server;
177 177
178 _enter("{%p}", vnode->server);
179
178 set_bit(AFS_VNODE_DELETED, &vnode->flags); 180 set_bit(AFS_VNODE_DELETED, &vnode->flags);
179 181
180 server = vnode->server; 182 server = vnode->server;
181 if (vnode->cb_promised) { 183 if (server) {
182 spin_lock(&server->cb_lock);
183 if (vnode->cb_promised) { 184 if (vnode->cb_promised) {
184 rb_erase(&vnode->cb_promise, &server->cb_promises); 185 spin_lock(&server->cb_lock);
185 vnode->cb_promised = false; 186 if (vnode->cb_promised) {
187 rb_erase(&vnode->cb_promise,
188 &server->cb_promises);
189 vnode->cb_promised = false;
190 }
191 spin_unlock(&server->cb_lock);
186 } 192 }
187 spin_unlock(&server->cb_lock);
188 }
189 193
190 spin_lock(&vnode->server->fs_lock); 194 spin_lock(&server->fs_lock);
191 rb_erase(&vnode->server_rb, &vnode->server->fs_vnodes); 195 rb_erase(&vnode->server_rb, &server->fs_vnodes);
192 spin_unlock(&vnode->server->fs_lock); 196 spin_unlock(&server->fs_lock);
193 197
194 vnode->server = NULL; 198 vnode->server = NULL;
195 afs_put_server(server); 199 afs_put_server(server);
200 } else {
201 ASSERT(!vnode->cb_promised);
202 }
203
204 _leave("");
196} 205}
197 206
198/* 207/*
@@ -225,7 +234,7 @@ void afs_vnode_finalise_status_update(struct afs_vnode *vnode,
225 */ 234 */
226static void afs_vnode_status_update_failed(struct afs_vnode *vnode, int ret) 235static void afs_vnode_status_update_failed(struct afs_vnode *vnode, int ret)
227{ 236{
228 _enter("%p,%d", vnode, ret); 237 _enter("{%x:%u},%d", vnode->fid.vid, vnode->fid.vnode, ret);
229 238
230 spin_lock(&vnode->lock); 239 spin_lock(&vnode->lock);
231 240