linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolaus Rath <Nikolaus@rath.org>
To: Maxim Patlasov <mpatlasov@virtuozzo.com>
Cc: mszeredi@redhat.com,
	"fuse-devel\@lists.sourceforge.net"
	<fuse-devel@lists.sourceforge.net>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [fuse-devel] [fuse] getattr() results ignored when writeback cache is active
Date: Thu, 21 Sep 2017 20:21:08 +0100	[thread overview]
Message-ID: <87lgl7ame3.fsf@vostro.rath.org> (raw)
In-Reply-To: <dbe25d00-68d8-78cc-6dbd-2c4e48fd0435@virtuozzo.com> (Maxim Patlasov's message of "Thu, 21 Sep 2017 11:45:46 -0700")

On Sep 21 2017, Maxim Patlasov <mpatlasov@virtuozzo.com> wrote:
> On 09/21/2017 11:31 AM, Nikolaus Rath wrote:
>
>> On Sep 21 2017, Maxim Patlasov <mpatlasov@virtuozzo.com> wrote:
>>> On 09/21/2017 10:53 AM, Nikolaus Rath wrote:
>>>
>>>> On Sep 21 2017, Maxim Patlasov <mpatlasov@virtuozzo.com> wrote:
>>>>> On 09/21/2017 03:12 AM, Nikolaus Rath wrote:
>>>>>
>>>>>> On Sep 20 2017, Miklos Szeredi <mszeredi@redhat.com> wrote:
>>>>>>> In writeback-cache mode (enabled by the FUSE_WRITEBACK_CACHE flaga) writes go to
>>>>>>> the cache only, which means that the write(2) syscall can often complete very
>>>>>>> fast.  The dirty pages are later sent to userspace using write requests.  This
>>>>>>> mode assumes that the file is never changed outside the mounted filesystem, so
>>>>>>> it's not suitable for any network fs.
>>>>>> .."this mode of operation is not suitable for any network filesystem
>>>>>> even if no write operations are actually carried out".
>>>>> Not true. A network filesystem can guarantee that the file is never
>>>>> changed outside by implementing exclusive write lease semantics: when
>>>>> someone opens file for writing first time the metadata server grants
>>>>> exclusive rights for that mount, then declines all subsequent open
>>>>> requests from other mounts; and similarly while a file is being kept
>>>>> opened for reading, the metadata server declines all open-for-writing
>>>>> requests from other mounts.
>>>> In practice that doesn't seem to work, see the example in my first
>>>> message. The file is only ever accessed on one mount at a time, yet the
>>>> changes do not propagate (and would result in data corruption if another
>>>> mount would attempt to read or modify the file afterwards).
>>> In your example you modified file bypassing fuse mount:
>>>
>>>> echo -e "\nrevision 2" >> /tmp/issue_93/file_1
>>> That's like mangling block device while ordinary local fs is running
>>> on top of it.
>> Huh? That's exactly what a network filesystem would see when another
>> host writes to the filesystem. The change doesn't come through the local
>> FUSE layer.
>
> In your example the change didn't come through any FUSE layer.

It did. The filesystem reported the updated mtime and size in its
getattr() response. The kernel ignored it.

> When another host writes to a network filesystem, the filesystem has a
> choice to process the request intelligently. In your example, you
> didn't give FUSE a chance because "/tmp/issue_93" was not fuse mount.

Right. /tmp/issue_93 substitutes for the network. The filesystem gets
notification through the network, aka by reading this mountpoint. It
then attempts to pass this on to the FUSE layer, but is being ignored.

Best,
-Nikolaus


-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

  reply	other threads:[~2017-09-21 19:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20 11:50 [fuse] getattr() results ignored when writeback cache is active Nikolaus Rath
2017-09-20 15:23 ` Miklos Szeredi
2017-09-20 15:31   ` [fuse-devel] " Nikolaus Rath
2017-09-20 15:59     ` Miklos Szeredi
2017-09-20 16:37       ` Nikolaus Rath
2017-09-21 15:04         ` Miklos Szeredi
2017-09-21 17:59           ` Nikolaus Rath
2017-09-25  9:12             ` Miklos Szeredi
2017-09-25  9:25               ` Nikolaus Rath
2017-09-21 10:12       ` Nikolaus Rath
2017-09-21 17:28         ` Maxim Patlasov
2017-09-21 17:53           ` Nikolaus Rath
2017-09-21 18:24             ` Maxim Patlasov
2017-09-21 18:31               ` Nikolaus Rath
2017-09-21 18:45                 ` Maxim Patlasov
2017-09-21 19:21                   ` Nikolaus Rath [this message]
2017-09-21 19:44                     ` Maxim Patlasov
2017-09-22  9:34                       ` Nikolaus Rath
2017-09-26  6:55                         ` 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=87lgl7ame3.fsf@vostro.rath.org \
    --to=nikolaus@rath.org \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mpatlasov@virtuozzo.com \
    --cc=mszeredi@redhat.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).