Skip to contentSkip to conversation

What happens with dirty pages on NOTIFY_INVAL_INODE?

fuse Nikolaus Rath 2 participants 4 messages Sep 24, 2018 VFS

lore
Share & tools
lore
#0 lore raw

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

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

             »Time flies like an arrow, fruit flies like a Banana.«
#1 lore raw
Quoted 5 lines · Nikolaus Rath

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.

Quoted 2 lines

To me neither behaviour seems correct...

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

Thanks,
Miklos

#2 lore raw
Quoted 9 lines · Miklos Szeredi
Quoted 5 lines · Nikolaus Rath

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"?

Quoted 8 lines

However, it doesn't wait on already queued
writes. So it's a bit of a mess at the moment.

Quoted 2 lines

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

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

             »Time flies like an arrow, fruit flies like a Banana.«
#3 lore raw
Quoted 8 lines · Nikolaus Rath
Quoted 7 lines · Miklos Szeredi
Quoted 5 lines · Nikolaus Rath

Hi,

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

Quoted 5 lines
Quoted 2 lines

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.

Quoted 12 lines
Quoted 9 lines

However, it doesn't wait on already queued
writes. So it's a bit of a mess at the moment.

Quoted 2 lines

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?

Quoted 7 lines

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