Re: [PATCH v2 4/5] swapfile: use ->read_iter and ->write_iter
From: Al Viro
Date: Sat Dec 20 2014 - 01:14:22 EST
On Fri, Dec 19, 2014 at 07:18:28PM -0800, Omar Sandoval wrote:
> + ret = swap_file->f_op->read_iter(&kiocb, &to);
> + if (ret == PAGE_SIZE) {
> + SetPageUptodate(page);
> count_vm_event(PSWPIN);
> + ret = 0;
> + } else {
> + ClearPageUptodate(page);
> + SetPageError(page);
> + }
> + unlock_page(page);
Umm... What's to guarantee that ->read_iter() won't try lock_page() on what
turns out to be equal to page?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/