Why doesn't FUSE use stable writes?
I'm looking at fuse_writepage_locked() and it allocates a new page, then copies from the page cache into that page before sending that page to userspace. I imagine you want to prevent torn writes, so why not set SB_I_STABLE_WRITES instead of having this memcpy?
Quoted 6 lines · Matthew Wilcox
I'm looking at
fuse_writepage_locked()and it allocates a new page, then copies from the page cache into that page before sending that page to userspace. I imagine you want to prevent torn writes, so why not setSB_I_STABLE_WRITESinstead of having this memcpy?
It's not as simple as that. Fuse wants to do its writes independently of the mm's reclaim mechanisms so that it doesn't get into the sort of deadlock that PF_MEMALLOC is supposed to prevent inside the kernel. I don't remember the details, but the last time I looked this issue (which wasn't recently) there was no feasible alternative to copying the page.
Thanks,
Miklos