Messages in this thread | | | From | Linus Torvalds <> | Date | Mon, 23 Nov 2020 20:26:48 -0800 | Subject | Re: kernel BUG at fs/ext4/inode.c:LINE! |
| |
On Mon, Nov 23, 2020 at 8:07 PM Hugh Dickins <hughd@google.com> wrote: > > The problem is that PageWriteback is not accompanied by a page reference > (as the NOTE at the end of test_clear_page_writeback() acknowledges): as > soon as TestClearPageWriteback has been done, that page could be removed > from page cache, freed, and reused for something else by the time that > wake_up_page() is reached.
Ugh.
Would it be possible to instead just make PageWriteback take the ref?
I don't hate your patch per se, but looking at that long explanation, and looking at the gyrations end_page_writeback() does, I go "why don't we do that?"
IOW, why couldn't we just make the __test_set_page_writeback() increment the page count if the writeback flag wasn't already set, and then make the end_page_writeback() do a put_page() after it all?
Linus
| |