Commit c1437c6d authored by Jens Axboe's avatar Jens Axboe Committed by Bernhard Thoben
Browse files

fs: move filp_close() outside of __close_fd_get_file()

Just one caller of this, and just use filp_close() there manually.
This is important to allow async close/removal of the fd.
Signed-off-by: default avatarJens Axboe <>
(cherry picked from commit 6e802a4ba056a6f2f51ac9d54eead3ed6f9829a2)
parent 29043942
......@@ -2386,10 +2386,12 @@ static void binder_deferred_fd_close(int fd)
init_task_work(&twcb->twork, binder_do_fd_close);
__close_fd_get_file(fd, &twcb->file);
if (twcb->file)
if (twcb->file) {
filp_close(twcb->file, current->files);
task_work_add(current, &twcb->twork, true);
} else {
static void binder_transaction_buffer_release(struct binder_proc *proc,
......@@ -672,7 +672,9 @@ out_unlock:
* variant of __close_fd that gets a ref on the file for later fput
* variant of __close_fd that gets a ref on the file for later fput.
* The caller must ensure that filp_close() called on the file, and then
* an fput().
int __close_fd_get_file(unsigned int fd, struct file **res)
......@@ -692,7 +694,7 @@ int __close_fd_get_file(unsigned int fd, struct file **res)
*res = file;
return filp_close(file, files);
return 0;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment