From: Miklos Szeredi <miklos@szeredi.hu>
To: Maxim Patlasov <mpatlasov@parallels.com>
Cc: Pavel Emelianov <xemul@parallels.com>,
fuse-devel <fuse-devel@lists.sourceforge.net>,
Brian Foster <bfoster@redhat.com>,
Kernel Mailing List <linux-kernel@vger.kernel.org>,
James Bottomley <jbottomley@parallels.com>,
Linux-Fsdevel <linux-fsdevel@vger.kernel.org>,
devel@openvz.org
Subject: Re: [PATCH] fuse: hotfix truncate_pagecache() issue
Date: Thu, 29 Aug 2013 18:18:09 +0200 [thread overview]
Message-ID: <CAJfpegvLcu1o+FUyRL1phCGMKvB4tReyjMLXBb6JabNJxooRSw@mail.gmail.com> (raw)
In-Reply-To: <521F4612.9090708@parallels.com>
On Thu, Aug 29, 2013 at 3:01 PM, Maxim Patlasov <mpatlasov@parallels.com> wrote:
> The patch looks fine, but it solves only one side of the problem (exactly
> what you formulated above). Another side is opposite: truncating page cache
> too late, when the state of inode changed significantly. The beginning may
> be as in the scenario above: fuse_dentry_revalidate() discovered that i_size
> changed (due to our own fuse_do_setattr()) and is going to call
> truncate_pagecache() for some 'new_size' it believes valid right now. But by
> the time that particular truncate_pagecache() is called, a lot of things may
> happen:
>
> 1) fuse_do_setattr() called truncate_pagecache() according to your patch
> 2) the file was extended either by write(2) or ftruncate(2) or fallocate(2).
> 3) mmap-ed write make a page in the extended region dirty
>
> The result will be the lost of data user wrote on the step '3)'. (my patch
> solves the issue at least for all cases w/o external changes)
I get it.
Could you please resend the patch with all these failure cases
described in the header?
Thanks,
Miklos
next prev parent reply other threads:[~2013-08-29 16:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-28 12:21 [PATCH] fuse: hotfix truncate_pagecache() issue Maxim Patlasov
2013-08-29 9:25 ` Miklos Szeredi
2013-08-29 13:01 ` Maxim Patlasov
2013-08-29 16:18 ` Miklos Szeredi [this message]
[not found] ` <CAJfpegvLcu1o+FUyRL1phCGMKvB4tReyjMLXBb6JabNJxooRSw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-08-30 13:06 ` [PATCH] fuse: hotfix truncate_pagecache() issue -v2 Maxim Patlasov
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=CAJfpegvLcu1o+FUyRL1phCGMKvB4tReyjMLXBb6JabNJxooRSw@mail.gmail.com \
--to=miklos@szeredi.hu \
--cc=bfoster@redhat.com \
--cc=devel@openvz.org \
--cc=fuse-devel@lists.sourceforge.net \
--cc=jbottomley@parallels.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpatlasov@parallels.com \
--cc=xemul@parallels.com \
/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;
as well as URLs for NNTP newsgroup(s).