X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=mm%2Fshmem.c;h=171dee7a131f6959fe444405f280374be7eb25d0;hb=622c202c4a4697636334761d7ca295ebd35074e4;hp=a36144909b2840213c087f3eb32fbd10d7c880ee;hpb=00e8cb00bc72f5279fde9d014b47f36dc4805dd8;p=deliverable%2Flinux.git diff --git a/mm/shmem.c b/mm/shmem.c index a36144909b28..171dee7a131f 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2225,9 +2225,11 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset, error = shmem_getpage(inode, index, &page, SGP_FALLOC); 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; }