[Devel] [PATCH] fuse: fix race in fuse_writepages()

Miklos Szeredi miklos at szeredi.hu
Thu Aug 29 09:21:59 PDT 2013


On Thu, Aug 29, 2013 at 2:38 PM, Maxim Patlasov <mpatlasov at parallels.com> wrote:

>> Just one nit, why orig_pages? req->pages is already there, so why
>> duplicate it?
>
>
> req->pages is there, but it is already occupied by new pages (allocated by
> fuse_writepages_fill). We can't re-use req->pages for original pages because
> as soon as we put the request to bg_queue (in fuse_writepages_send) and
> released fc->lock, req->pages may be accessed w/o any delay. So we have two
> bunches of pointers to "struct page" to be stashed somewhere : original and
> new one. req->pages is for new pages, orig_pages[] is for original ones.

Yeah.  Applied the original patch.

Thanks,
Miklos



More information about the Devel mailing list