summaryrefslogtreecommitdiff
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-08-05 02:19:08 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-08-05 02:19:08 -0300
commit8dec7c70575785729a6a9e6719a955e9c545bcab (patch)
tree897b1b743b2ceb44ace956e8176b6a7e36751019 /mm/shmem.c
parent4411a04f871d94ae997fb7262a428fe2ee988eb3 (diff)
Linux-libre 4.6.5-gnupck-4.6.5-gnu
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 83e44bb6f..6c775e6cd 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2238,9 +2238,11 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset,
NULL);
if (error) {
/* Remove the !PageUptodate pages we added */
- shmem_undo_range(inode,
- (loff_t)start << PAGE_SHIFT,
- (loff_t)index << PAGE_SHIFT, true);
+ if (index > start) {
+ shmem_undo_range(inode,
+ (loff_t)start << PAGE_SHIFT,
+ ((loff_t)index << PAGE_SHIFT) - 1, true);
+ }
goto undone;
}