+ tmpfs-dont-undo-fallocate-past-its-last-page.patch added to -mm tree

From: akpm@linux-foundation.org
Date: 2016-06-08 20:47:43

The patch titled
     Subject: tmpfs: don't undo fallocate past its last page
has been added to the -mm tree.  Its filename is
     tmpfs-dont-undo-fallocate-past-its-last-page.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/tmpfs-dont-undo-fallocate-past-its-last-page.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/tmpfs-dont-undo-fallocate-past-its-last-page.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Anthony Romano <redacted>
Subject: tmpfs: don't undo fallocate past its last page

When fallocate is interrupted it will undo a range that extends one byte
past its range of allocated pages.  This can corrupt an in-use page by
zeroing out its first byte.  Instead, undo using the inclusive byte range.

Fixes: 1635f6a74152f1d ("tmpfs: undo fallocation on failure")
Link: http://lkml.kernel.org/r/1462713387-16724-1-git-send-email-anthony.romano@coreos.com
Signed-off-by: Anthony Romano <redacted>
Cc: Vlastimil Babka <redacted>
Cc: Hugh Dickins <hughd@google.com>
Cc: <redacted>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/shmem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN mm/shmem.c~tmpfs-dont-undo-fallocate-past-its-last-page mm/shmem.c
--- a/mm/shmem.c~tmpfs-dont-undo-fallocate-past-its-last-page
+++ a/mm/shmem.c
@@ -2227,7 +2227,7 @@ static long shmem_fallocate(struct file
 			/* Remove the !PageUptodate pages we added */
 			shmem_undo_range(inode,
 				(loff_t)start << PAGE_SHIFT,
-				(loff_t)index << PAGE_SHIFT, true);
+				((loff_t)index << PAGE_SHIFT) - 1, true);
 			goto undone;
 		}
 
_

Patches currently in -mm which might be from anthony.romano@coreos.com are

tmpfs-dont-undo-fallocate-past-its-last-page.patch
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help