diff options
Diffstat (limited to 'fs/ramfs')
-rw-r--r-- | fs/ramfs/file-nommu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index b9b567a28376..5d7c7ececa64 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c | |||
@@ -114,6 +114,9 @@ int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) | |||
114 | if (!pagevec_add(&lru_pvec, page)) | 114 | if (!pagevec_add(&lru_pvec, page)) |
115 | __pagevec_lru_add_file(&lru_pvec); | 115 | __pagevec_lru_add_file(&lru_pvec); |
116 | 116 | ||
117 | /* prevent the page from being discarded on memory pressure */ | ||
118 | SetPageDirty(page); | ||
119 | |||
117 | unlock_page(page); | 120 | unlock_page(page); |
118 | } | 121 | } |
119 | 122 | ||
@@ -126,6 +129,7 @@ int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) | |||
126 | return -EFBIG; | 129 | return -EFBIG; |
127 | 130 | ||
128 | add_error: | 131 | add_error: |
132 | pagevec_lru_add_file(&lru_pvec); | ||
129 | page_cache_release(pages + loop); | 133 | page_cache_release(pages + loop); |
130 | for (loop++; loop < npages; loop++) | 134 | for (loop++; loop < npages; loop++) |
131 | __free_page(pages + loop); | 135 | __free_page(pages + loop); |