Commit c5de16cc authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Miklos Szeredi

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: default avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent e2653bd5
......@@ -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;
}
}
......
Markdown is supported
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