[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wjcSFM+aqLnh7ucx3_tHpc1+9sJ+FfhSgVFH316uX2FZQ@mail.gmail.com>
Date: Mon, 23 Nov 2020 20:26:48 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Hugh Dickins <hughd@...gle.com>
Cc: Jan Kara <jack@...e.cz>,
syzbot <syzbot+3622cea378100f45d59f@...kaller.appspotmail.com>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Ext4 Developers List <linux-ext4@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
syzkaller-bugs <syzkaller-bugs@...glegroups.com>,
"Theodore Ts'o" <tytso@....edu>, Linux-MM <linux-mm@...ck.org>,
Oleg Nesterov <oleg@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"Kirill A. Shutemov" <kirill@...temov.name>,
Nicholas Piggin <npiggin@...il.com>,
Alex Shi <alex.shi@...ux.alibaba.com>, Qian Cai <cai@....pw>,
Christoph Hellwig <hch@...radead.org>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
Matthew Wilcox <willy@...radead.org>,
William Kucharski <william.kucharski@...cle.com>,
Jens Axboe <axboe@...nel.dk>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
linux-xfs <linux-xfs@...r.kernel.org>
Subject: Re: kernel BUG at fs/ext4/inode.c:LINE!
On Mon, Nov 23, 2020 at 8:07 PM Hugh Dickins <hughd@...gle.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
Powered by blists - more mailing lists