X-Git-Url: https://git.stricted.de/?a=blobdiff_plain;f=mm%2Fshmem.c;h=d95e308fc4aae57d04959613c8ed479fc73d351e;hb=HEAD;hp=e490ad476f01381e6b210a9130f96a62ec7409bd;hpb=5d8d08710cbc9121d40167f37db6aa0385e59d62;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git diff --git a/mm/shmem.c b/mm/shmem.c index e490ad476f01..d95e308fc4aa 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1958,9 +1958,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_CACHE_SHIFT, - (loff_t)index << PAGE_CACHE_SHIFT, true); + if (index > start) { + shmem_undo_range(inode, + (loff_t)start << PAGE_CACHE_SHIFT, + ((loff_t)index << PAGE_CACHE_SHIFT) - 1, true); + } goto undone; }