X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=mm%2Fshmem.c;h=79997e8cf807c54b8a8217df6f9b70ef9f4e981f;hb=57eae3d8eb904bf06cf186f681ab1e19c32e9a44;hp=b82e56ebabdd6ed7e1f270d504d80e7e8fa24811;hpb=023861726fc0899139add9dd47905b8de7644257;p=firefly-linux-kernel-4.4.55.git diff --git a/mm/shmem.c b/mm/shmem.c index b82e56ebabdd..79997e8cf807 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2153,9 +2153,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; }