]> git.baikalelectronics.ru Git - kernel.git/commitdiff
afs: Fix signal handling in some file ops
authorDavid Howells <dhowells@redhat.com>
Mon, 20 Nov 2017 22:41:00 +0000 (22:41 +0000)
committerDavid Howells <dhowells@redhat.com>
Fri, 24 Nov 2017 13:55:35 +0000 (13:55 +0000)
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>
fs/afs/dir.c

index bb89876fbb8e8c365cf76c86134ff2be3c16b995..c023249694299915e8162b82b26b0f759145c3f7 100644 (file)
@@ -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);
@@ -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);
@@ -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);
@@ -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);