diff options
author | David Howells <dhowells@redhat.com> | 2017-11-20 17:41:00 -0500 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2017-11-24 08:55:35 -0500 |
commit | 4433b69141864b8c8ba50d0a3ed38341eec9c469 (patch) | |
tree | f69fafb038b71ddc0cdb6ed21d3c3aa6e6823d47 | |
parent | bc1527dcb422ead9e1808def6824b4c0e469cc1c (diff) |
afs: Fix signal handling in some file ops
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 <dhowells@redhat.com>
-rw-r--r-- | fs/afs/dir.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/afs/dir.c b/fs/afs/dir.c index bb89876fbb8e..c02324969429 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c | |||
@@ -818,6 +818,8 @@ static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
818 | ret = afs_end_vnode_operation(&fc); | 818 | ret = afs_end_vnode_operation(&fc); |
819 | if (ret < 0) | 819 | if (ret < 0) |
820 | goto error_key; | 820 | goto error_key; |
821 | } else { | ||
822 | goto error_key; | ||
821 | } | 823 | } |
822 | 824 | ||
823 | key_put(key); | 825 | key_put(key); |
@@ -1006,6 +1008,8 @@ static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode, | |||
1006 | ret = afs_end_vnode_operation(&fc); | 1008 | ret = afs_end_vnode_operation(&fc); |
1007 | if (ret < 0) | 1009 | if (ret < 0) |
1008 | goto error_key; | 1010 | goto error_key; |
1011 | } else { | ||
1012 | goto error_key; | ||
1009 | } | 1013 | } |
1010 | 1014 | ||
1011 | key_put(key); | 1015 | key_put(key); |
@@ -1071,6 +1075,8 @@ static int afs_link(struct dentry *from, struct inode *dir, | |||
1071 | ret = afs_end_vnode_operation(&fc); | 1075 | ret = afs_end_vnode_operation(&fc); |
1072 | if (ret < 0) | 1076 | if (ret < 0) |
1073 | goto error_key; | 1077 | goto error_key; |
1078 | } else { | ||
1079 | goto error_key; | ||
1074 | } | 1080 | } |
1075 | 1081 | ||
1076 | key_put(key); | 1082 | key_put(key); |
@@ -1130,6 +1136,8 @@ static int afs_symlink(struct inode *dir, struct dentry *dentry, | |||
1130 | ret = afs_end_vnode_operation(&fc); | 1136 | ret = afs_end_vnode_operation(&fc); |
1131 | if (ret < 0) | 1137 | if (ret < 0) |
1132 | goto error_key; | 1138 | goto error_key; |
1139 | } else { | ||
1140 | goto error_key; | ||
1133 | } | 1141 | } |
1134 | 1142 | ||
1135 | key_put(key); | 1143 | key_put(key); |