linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [fuse] What happens with dirty pages on NOTIFY_INVAL_INODE?
@ 2018-09-24  8:06 Nikolaus Rath
  2018-09-24  8:22 ` Miklos Szeredi
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolaus Rath @ 2018-09-24  8:06 UTC (permalink / raw)
  To: fuse-devel, linux-fsdevel, Miklos Szeredi

Hi,

What happens with dirty pages when a (writeback-cache enabled) FUSE
filesystem sends a NOTIFY_INVAL_INODE request? Are they dropped?
flushed?

To me neither behaviour seems correct... 


Best,
-Nikolaus

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

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

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

* Re: [fuse] What happens with dirty pages on NOTIFY_INVAL_INODE?
  2018-09-24  8:06 [fuse] What happens with dirty pages on NOTIFY_INVAL_INODE? Nikolaus Rath
@ 2018-09-24  8:22 ` Miklos Szeredi
  2018-09-24  8:43   ` [fuse-devel] " Nikolaus Rath
  0 siblings, 1 reply; 4+ messages in thread
From: Miklos Szeredi @ 2018-09-24  8:22 UTC (permalink / raw)
  To: fuse-devel, linux-fsdevel, Miklos Szeredi

On Mon, Sep 24, 2018 at 10:06 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
> Hi,
>
> What happens with dirty pages when a (writeback-cache enabled) FUSE
> filesystem sends a NOTIFY_INVAL_INODE request? Are they dropped?
> flushed?

Haven't tried, but AFAICS it flushes dirty pages and waits on
writeback for these.  However, it doesn't wait on already queued
writes.  So it's a bit of a mess at the moment.

>
> To me neither behaviour seems correct...

What would be the correct operation be if neither flushing not
dropping them is correct?

Thanks,
Miklos

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

* Re: [fuse-devel] [fuse] What happens with dirty pages on NOTIFY_INVAL_INODE?
  2018-09-24  8:22 ` Miklos Szeredi
@ 2018-09-24  8:43   ` Nikolaus Rath
  2018-09-24 13:38     ` Miklos Szeredi
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolaus Rath @ 2018-09-24  8:43 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: fuse-devel, linux-fsdevel

On Sep 24 2018, Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Mon, Sep 24, 2018 at 10:06 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
>> Hi,
>>
>> What happens with dirty pages when a (writeback-cache enabled) FUSE
>> filesystem sends a NOTIFY_INVAL_INODE request? Are they dropped?
>> flushed?
>
> Haven't tried, but AFAICS it flushes dirty pages and waits on
> writeback for these.

"waits on writeback" means "wait until the write requests have
completed"?

> However, it doesn't wait on already queued
> writes.  So it's a bit of a mess at the moment.
>
>>
>> To me neither behaviour seems correct...
>
> What would be the correct operation be if neither flushing not
> dropping them is correct?

What about returning an error?

My thinking is that if the filesystem issues an inval request, then the
data has already been changed/disappeared. So a writeback at this point
would most likely not do the right thing - since it would partially
write back old data that has actually been mutated.

Similarly, just dropping the cache seems bad because most likely this
causes data loss for the new data that hasn't been flushed.

Best,
-Nikolaus

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

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

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

* Re: [fuse-devel] [fuse] What happens with dirty pages on NOTIFY_INVAL_INODE?
  2018-09-24  8:43   ` [fuse-devel] " Nikolaus Rath
@ 2018-09-24 13:38     ` Miklos Szeredi
  0 siblings, 0 replies; 4+ messages in thread
From: Miklos Szeredi @ 2018-09-24 13:38 UTC (permalink / raw)
  To: Miklos Szeredi, fuse-devel, linux-fsdevel

On Mon, Sep 24, 2018 at 10:43 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
> On Sep 24 2018, Miklos Szeredi <miklos@szeredi.hu> wrote:
>> On Mon, Sep 24, 2018 at 10:06 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
>>> Hi,
>>>
>>> What happens with dirty pages when a (writeback-cache enabled) FUSE
>>> filesystem sends a NOTIFY_INVAL_INODE request? Are they dropped?
>>> flushed?
>>
>> Haven't tried, but AFAICS it flushes dirty pages and waits on
>> writeback for these.
>
> "waits on writeback" means "wait until the write requests have
> completed"?

Appears to be so.  An so there we have the blocking notification
you've asked about.

>
>> However, it doesn't wait on already queued
>> writes.  So it's a bit of a mess at the moment.
>>
>>>
>>> To me neither behaviour seems correct...
>>
>> What would be the correct operation be if neither flushing not
>> dropping them is correct?
>
> What about returning an error?
>
> My thinking is that if the filesystem issues an inval request, then the
> data has already been changed/disappeared. So a writeback at this point
> would most likely not do the right thing - since it would partially
> write back old data that has actually been mutated.
>
> Similarly, just dropping the cache seems bad because most likely this
> causes data loss for the new data that hasn't been flushed.

This is a pretty complicated issue.  For reference we should look at
what NFS is doing, because NFS has a long history and likely that
behavior is the most acceptable when cached writes are mixed with
concurrent remote updates.

And I don't think NFS will report an error in such a situation.   More
likely it will accept the reordered writes.

Thanks,
Miklos

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

end of thread, other threads:[~2018-09-24 19:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-24  8:06 [fuse] What happens with dirty pages on NOTIFY_INVAL_INODE? Nikolaus Rath
2018-09-24  8:22 ` Miklos Szeredi
2018-09-24  8:43   ` [fuse-devel] " Nikolaus Rath
2018-09-24 13:38     ` Miklos Szeredi

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).