diff options
author | David Howells <dhowells@redhat.com> | 2020-06-16 00:34:09 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2020-06-16 16:26:57 +0100 |
commit | 728279a5a1fd9fa9fa268f807391c4d19ad2822c (patch) | |
tree | 14449edf632b36d26b200931233b844fdaab9683 /fs/afs/fs_operation.c | |
parent | 44767c353127cfcbee49a89bab39a3680ecd2a45 (diff) | |
download | lwn-728279a5a1fd9fa9fa268f807391c4d19ad2822c.tar.gz lwn-728279a5a1fd9fa9fa268f807391c4d19ad2822c.zip |
afs: Fix use of afs_check_for_remote_deletion()
afs_check_for_remote_deletion() checks to see if error ENOENT is returned
by the server in response to an operation and, if so, marks the primary
vnode as having been deleted as the FID is no longer valid.
However, it's being called from the operation success functions, where no
abort has happened - and if an inline abort is recorded, it's handled by
afs_vnode_commit_status().
Fix this by actually calling the operation aborted method if provided and
having that point to afs_check_for_remote_deletion().
Fixes: e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept")
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/fs_operation.c')
-rw-r--r-- | fs/afs/fs_operation.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/afs/fs_operation.c b/fs/afs/fs_operation.c index 2d2dff5688a4..c264839b2fd0 100644 --- a/fs/afs/fs_operation.c +++ b/fs/afs/fs_operation.c @@ -187,9 +187,17 @@ void afs_wait_for_operation(struct afs_operation *op) op->error = afs_wait_for_call_to_complete(op->call, &op->ac); } - if (op->error == 0) { + switch (op->error) { + case 0: _debug("success"); op->ops->success(op); + break; + case -ECONNABORTED: + if (op->ops->aborted) + op->ops->aborted(op); + break; + default: + break; } afs_end_vnode_operation(op); |