diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 3fee28ee6374599ff4ef181c3e1e8b8f5633f71b..8a98ffd5e4b67500d76e94fde34e790e5cac6408 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -905,17 +905,17 @@ static int fuse_try_move_page(struct fuse_copy_state *cs, struct page **pagep) goto out_put_old; } + get_page(newpage); + + if (!(buf->flags & PIPE_BUF_FLAG_LRU)) + lru_cache_add_file(newpage); + /* * Release while we have extra ref on stolen page. Otherwise * anon_pipe_buf_release() might think the page can be reused. */ pipe_buf_release(cs->pipe, buf); - get_page(newpage); - - if (!(buf->flags & PIPE_BUF_FLAG_LRU)) - lru_cache_add_file(newpage); - err = 0; spin_lock(&cs->req->waitq.lock); if (test_bit(FR_ABORTED, &cs->req->flags))