diff options
author | David Howells <dhowells@redhat.com> | 2020-10-22 16:08:23 +0300 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2020-10-29 16:53:04 +0300 |
commit | f86726a69dec5df6ba051baf9265584419478b64 (patch) | |
tree | 0f4a04caa4a282b0a44b4d63b0fca1126dc33868 /include/trace | |
parent | 65dd2d6072d393a3aa14ded8afa9a12f27d9c8ad (diff) | |
download | linux-f86726a69dec5df6ba051baf9265584419478b64.tar.xz |
afs: Fix afs_invalidatepage to adjust the dirty region
Fix afs_invalidatepage() to adjust the dirty region recorded in
page->private when truncating a page. If the dirty region is entirely
removed, then the private data is cleared and the page dirty state is
cleared.
Without this, if the page is truncated and then expanded again by truncate,
zeros from the expanded, but no-longer dirty region may get written back to
the server if the page gets laundered due to a conflicting 3rd-party write.
It mustn't, however, shorten the dirty region of the page if that page is
still mmapped and has been marked dirty by afs_page_mkwrite(), so a flag is
stored in page->private to record this.
Fixes: 4343d00872e1 ("afs: Get rid of the afs_writeback record")
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/afs.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/trace/events/afs.h b/include/trace/events/afs.h index 866fc67d5aa5..4eef374d4413 100644 --- a/include/trace/events/afs.h +++ b/include/trace/events/afs.h @@ -986,10 +986,11 @@ TRACE_EVENT(afs_page_dirty, __entry->priv = priv; ), - TP_printk("vn=%p %lx %s %zx-%zx", + TP_printk("vn=%p %lx %s %zx-%zx%s", __entry->vnode, __entry->page, __entry->where, afs_page_dirty_from(__entry->priv), - afs_page_dirty_to(__entry->priv)) + afs_page_dirty_to(__entry->priv), + afs_is_page_dirty_mmapped(__entry->priv) ? " M" : "") ); TRACE_EVENT(afs_call_state, |