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>
This commit is contained in:
committed by
Linus Torvalds
parent
9d577b6a31
commit
0f300ca928
@@ -209,11 +209,15 @@ bad_inode:
|
||||
*/
|
||||
void afs_zap_data(struct afs_vnode *vnode)
|
||||
{
|
||||
_enter("zap data {%x:%u}", vnode->fid.vid, vnode->fid.vnode);
|
||||
_enter("{%x:%u}", vnode->fid.vid, vnode->fid.vnode);
|
||||
|
||||
/* nuke all the non-dirty pages that aren't locked, mapped or being
|
||||
* written back */
|
||||
invalidate_remote_inode(&vnode->vfs_inode);
|
||||
* written back in a regular file and completely discard the pages in a
|
||||
* directory or symlink */
|
||||
if (S_ISREG(vnode->vfs_inode.i_mode))
|
||||
invalidate_remote_inode(&vnode->vfs_inode);
|
||||
else
|
||||
invalidate_inode_pages2(vnode->vfs_inode.i_mapping);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user