From: Andreas Rohner <andreas.rohner-hi6Y0CQ0nG0@public.gmane.org>
To: Ryusuke Konishi
<konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
Cc: linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] nilfs2: fix data loss with mmap()
Date: Tue, 16 Sep 2014 10:38:29 +0200 [thread overview]
Message-ID: <5417F705.8020306@gmx.net> (raw)
In-Reply-To: <20140916.134218.1694651966300542167.konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
On 2014-09-16 06:42, Ryusuke Konishi wrote:
> On Tue, 16 Sep 2014 00:24:05 +0200, Andreas Rohner wrote:
>> On 2014-09-16 00:01, Ryusuke Konishi wrote:
>>> Hi Andreas,
>>> On Mon, 15 Sep 2014 21:47:30 +0200, Andreas Rohner wrote:
>>>> This bug leads to reproducible silent data loss, despite the use of
>>>> msync(), sync() and a clean unmount of the file system. It is easily
>>>> reproducible with the following script:
>> <snip>
>>> Thank you for reporting this issue.
>>
>> I just stumbled upon the weird behaviour of mmap() while testing the
>> nilfs_sync_fs() patch.
>>
>>> I'd like to look into this patch, it looks to point out an important
>>> regression, but it may take some time since I am quite busy this week..
>>
>> Of course. I understand.
>
> The patch looks correct. It is my mistake that the commit 136e877
> leaked consideration for the case where the page doesn't have buffer
> heads. This fix should be backported to stable kernels. (I'll add a
> "Cc: stable" tag when sending this to Andrew.)
>
> Did you confirm that the patch works as expected ?
Yes at least with the current master kernel:
BEFORE MMAP: 281ed1d5ae50e8419f9b978aab16de83 /mnt/testfile
AFTER MMAP: 3d9183f1c471b9baff15c9cc8d12c303 /mnt/testfile
AFTER REMOUNT: 3d9183f1c471b9baff15c9cc8d12c303 /mnt/testfile
For the record here is the little tool I used for testing mmap:
https://github.com/zeitgeist87/mmaptest
It writes pages with random bytes at a certain offset using mmap. The
frequent umounts and mounts in the test script are necessary to purge
the page cache. There is probably a better way of doing that.
> I'd appreciate your help on testing the patch for some old kernels.
> (And, please declare a "Tested-by" tag in the reply mail, if the test
> is ok).
Sure I have everything set up. Which kernels do I have to test? Was
commit 136e877 backported? I presume at least stable and some of the
longterm kernels on https://www.kernel.org/...
By the way thanks for your continued effort and time investment in
reviewing my patches.
br,
Andreas Rohner
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-09-16 8:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-15 19:47 [PATCH] nilfs2: fix data loss with mmap() Andreas Rohner
[not found] ` <1410810450-2637-1-git-send-email-andreas.rohner-hi6Y0CQ0nG0@public.gmane.org>
2014-09-15 22:01 ` Ryusuke Konishi
[not found] ` <20140916.070130.858349725408024032.konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
2014-09-15 22:24 ` Andreas Rohner
[not found] ` <54176705.6080107-hi6Y0CQ0nG0@public.gmane.org>
2014-09-16 4:42 ` Ryusuke Konishi
[not found] ` <20140916.134218.1694651966300542167.konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
2014-09-16 8:38 ` Andreas Rohner [this message]
[not found] ` <5417F705.8020306-hi6Y0CQ0nG0@public.gmane.org>
2014-09-16 13:57 ` Ryusuke Konishi
[not found] ` <20140916.225726.1211879952201061873.konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
2014-09-17 8:16 ` Andreas Rohner
[not found] ` <5419436E.4030501-hi6Y0CQ0nG0@public.gmane.org>
2014-09-17 12:34 ` Ryusuke Konishi
[not found] ` <20140917.213439.867924114484975245.konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
2014-09-18 7:24 ` Ryusuke Konishi
[not found] ` <20140918.162416.1553343892940167544.konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
2014-09-18 10:44 ` Andreas Rohner
2014-09-16 15:11 ` Andreas Rohner
-- strict thread matches above, loose matches on Subject: below --
2014-09-18 14:56 [PATCH 0/1] " Ryusuke Konishi
[not found] ` <1411052185-8118-1-git-send-email-konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
2014-09-18 14:56 ` [PATCH] " Ryusuke Konishi
[not found] ` <1411052185-8118-2-git-send-email-konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
2014-09-18 19:17 ` Andrew Morton
[not found] ` <20140918121708.c9e9678c9ea76b057377d843-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2014-09-18 23:41 ` Ryusuke Konishi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5417F705.8020306@gmx.net \
--to=andreas.rohner-hi6y0cq0ng0@public.gmane.org \
--cc=konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org \
--cc=linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox