mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
fuse: Replace page without copying in fuse_writepage_in_flight()
It looks like we can optimize page replacement and avoid copying by simple updating the request's page. [SzM: swap with new request's tmp page to avoid use after free.] Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
parent
e2653bd53a
commit
c5de16cca2
1 changed files with 1 additions and 1 deletions
|
@ -1789,7 +1789,7 @@ static bool fuse_writepage_in_flight(struct fuse_req *new_req,
|
|||
if (curr_index == page->index) {
|
||||
WARN_ON(tmp->num_pages != 1);
|
||||
WARN_ON(!test_bit(FR_PENDING, &tmp->flags));
|
||||
copy_highpage(tmp->pages[0], page);
|
||||
swap(tmp->pages[0], new_req->pages[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue