diff options
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r-- | fs/ceph/file.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 26cc95421cca..18c045e2ead6 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -74,12 +74,9 @@ dio_get_pages_alloc(const struct iov_iter *it, size_t nbytes, | |||
74 | align = (unsigned long)(it->iov->iov_base + it->iov_offset) & | 74 | align = (unsigned long)(it->iov->iov_base + it->iov_offset) & |
75 | (PAGE_SIZE - 1); | 75 | (PAGE_SIZE - 1); |
76 | npages = calc_pages_for(align, nbytes); | 76 | npages = calc_pages_for(align, nbytes); |
77 | pages = kmalloc(sizeof(*pages) * npages, GFP_KERNEL); | 77 | pages = kvmalloc(sizeof(*pages) * npages, GFP_KERNEL); |
78 | if (!pages) { | 78 | if (!pages) |
79 | pages = vmalloc(sizeof(*pages) * npages); | 79 | return ERR_PTR(-ENOMEM); |
80 | if (!pages) | ||
81 | return ERR_PTR(-ENOMEM); | ||
82 | } | ||
83 | 80 | ||
84 | for (idx = 0; idx < npages; ) { | 81 | for (idx = 0; idx < npages; ) { |
85 | size_t start; | 82 | size_t start; |