Skip to content

Commit

Permalink
afs: Fix signal handling in some file ops
Browse files Browse the repository at this point in the history
afs_mkdir(), afs_create(), afs_link() and afs_symlink() all need to drop
the target dentry if a signal causes the operation to be killed immediately
before we try to contact the server.

Signed-off-by: David Howells <[email protected]>
  • Loading branch information
dhowells committed Nov 24, 2017
1 parent bc1527d commit 4433b69
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fs/afs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,8 @@ static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
ret = afs_end_vnode_operation(&fc);
if (ret < 0)
goto error_key;
} else {
goto error_key;
}

key_put(key);
Expand Down Expand Up @@ -1006,6 +1008,8 @@ static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
ret = afs_end_vnode_operation(&fc);
if (ret < 0)
goto error_key;
} else {
goto error_key;
}

key_put(key);
Expand Down Expand Up @@ -1071,6 +1075,8 @@ static int afs_link(struct dentry *from, struct inode *dir,
ret = afs_end_vnode_operation(&fc);
if (ret < 0)
goto error_key;
} else {
goto error_key;
}

key_put(key);
Expand Down Expand Up @@ -1130,6 +1136,8 @@ static int afs_symlink(struct inode *dir, struct dentry *dentry,
ret = afs_end_vnode_operation(&fc);
if (ret < 0)
goto error_key;
} else {
goto error_key;
}

key_put(key);
Expand Down

0 comments on commit 4433b69

Please sign in to comment.