linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] msync: fix incorrect fstart calculation
@ 2014-06-27 11:38 Namjae Jeon
  2014-06-27 11:51 ` Lukáš Czerner
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Namjae Jeon @ 2014-06-27 11:38 UTC (permalink / raw)
  To: 'Andrew Morton'
  Cc: linux-mm, linux-ext4, Lukáš Czerner,
	'Matthew Wilcox', 'Eric Whitney', Ashish Sangwan

Fix a regression caused by Commit 7fc34a62ca mm/msync.c: sync only
the requested range in msync().
xfstests generic/075 fail occured on ext4 data=journal mode because
the intended range was not syncing due to wrong fstart calculation.

Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
Cc: Lukáš Czerner <lczerner@redhat.com>
Reported-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
---
 mm/msync.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/msync.c b/mm/msync.c
index a5c6736..ad97dce 100644
--- a/mm/msync.c
+++ b/mm/msync.c
@@ -78,7 +78,8 @@ SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags)
 			goto out_unlock;
 		}
 		file = vma->vm_file;
-		fstart = start + ((loff_t)vma->vm_pgoff << PAGE_SHIFT);
+		fstart = (start - vma->vm_start) +
+			 ((loff_t)vma->vm_pgoff << PAGE_SHIFT);
 		fend = fstart + (min(end, vma->vm_end) - start) - 1;
 		start = vma->vm_end;
 		if ((flags & MS_SYNC) && file &&
-- 
1.7.11-rc0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-06-28 19:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-27 11:38 [PATCH] msync: fix incorrect fstart calculation Namjae Jeon
2014-06-27 11:51 ` Lukáš Czerner
2014-06-27 12:43 ` Wilcox, Matthew R
2014-06-27 16:12   ` Eric Whitney
2014-06-28 19:14 ` Theodore Ts'o
2014-06-28 19:44   ` Andrew Morton
2014-06-28 19:57     ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).