You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FreeBSD: zfs_putpages: don't undirty pages until after write completes
zfs_putpages() would put the entire range of pages onto the ZIL, then
return VM_PAGER_OK for each page to the kernel. However, an associated
zil_commit() or txg sync had not happened at this point, so the write
may not actually be on disk.
So, we rework it to use a ZIL commit callback, and do the post-write
work of undirtying the page and signaling completion there. We return
VM_PAGER_PEND to the kernel instead so it knows that we will take care
of it.
We change from a single zfs_log_write() to cover the whole range, to
multiple calls, each for a single page. This is because if
zfs_log_write() receives a write too large to fit into a single ZIL
block, it will split it into multiple writes, but each will receive the
same callback and argument. This will lead to the callback being called
multiple times, but we don't which pages/range the call is for, and so
can't clean them up. This way is not ideal, but is simple and correct,
and so is a good start.
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <[email protected]>
0 commit comments