summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2016-07-24 23:09:02 +0200
committerTrond Myklebust <trond.myklebust@primarydata.com>2016-07-24 23:09:02 +0200
commit1592c4d62a89bbca895c568d65ce290dfbc36ecc (patch)
tree6b979bc02ded2ea7e644c34e6939ffbbb7ee001d /mm
parentMerge branch 'pnfs' (diff)
parentMerge tag 'nfs-rdma-4.8-2' of git://git.linux-nfs.org/projects/anna/nfs-rdma (diff)
downloadlinux-1592c4d62a89bbca895c568d65ce290dfbc36ecc.tar.xz
linux-1592c4d62a89bbca895c568d65ce290dfbc36ecc.zip
Merge branch 'nfs-rdma'
Diffstat (limited to 'mm')
-rw-r--r--mm/shmem.c8
1 files changed, 5 insertions, 3 deletions
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;
}