X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=mm%2Fshmem.c;h=171dee7a131f6959fe444405f280374be7eb25d0;hb=622c202c4a4697636334761d7ca295ebd35074e4;hp=24463b67b6efa5817e7c1e806d1bf6337d300ba2;hpb=086e3eb65e3b04d7186f5e527aa6fc375dd5495c;p=deliverable%2Flinux.git diff --git a/mm/shmem.c b/mm/shmem.c index 24463b67b6ef..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) - 1, true); + if (index > start) { + shmem_undo_range(inode, + (loff_t)start << PAGE_SHIFT, + ((loff_t)index << PAGE_SHIFT) - 1, true); + } goto undone; }