diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index e159c529fd2bbc845bbd893f645ac7633d91b9eb..38b8ab554924cd2d4a9ddf11ce3a79efe3d411cd 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -775,6 +775,13 @@ static int ceph_writepages_start(struct address_space *mapping, ci->i_truncate_seq, ci->i_truncate_size, &inode->i_mtime, true, 1, 0); + + if (!req) { + rc = -ENOMEM; + unlock_page(page); + break; + } + max_pages = req->r_num_pages; alloc_page_vec(fsc, req);