From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF8C7C352B6 for ; Tue, 14 Apr 2020 11:29:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8FEA72072D for ; Tue, 14 Apr 2020 11:29:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FEA72072D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 34B818E0008; Tue, 14 Apr 2020 07:29:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2FB7B8E0001; Tue, 14 Apr 2020 07:29:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2381E8E0008; Tue, 14 Apr 2020 07:29:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id 0D36C8E0001 for ; Tue, 14 Apr 2020 07:29:57 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BDC498245571 for ; Tue, 14 Apr 2020 11:29:56 +0000 (UTC) X-FDA: 76706241192.26.brick55_73b38b683c71c X-HE-Tag: brick55_73b38b683c71c X-Filterd-Recvd-Size: 4186 Received: from mail3-162.sinamail.sina.com.cn (mail3-162.sinamail.sina.com.cn [202.108.3.162]) by imf46.hostedemail.com (Postfix) with SMTP for ; Tue, 14 Apr 2020 11:29:54 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([221.219.5.127]) by sina.com with ESMTP id 5E959EAC00007AC7; Tue, 14 Apr 2020 19:29:50 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 76184549284065 From: Hillf Danton To: Dmitry Vyukov Cc: Andrew Morton , syzbot , LKML , Linux-MM , syzkaller-bugs , Evan Green , Martijn Coenen , Jens Axboe Subject: Re: WARNING in unaccount_page_cache_page (2) Date: Tue, 14 Apr 2020 19:29:39 +0800 Message-Id: <20200414112939.20352-1-hdanton@sina.com> In-Reply-To: <20200413133216.df03bc0a952276abdaa610cd@linux-foundation.org> References: <0000000000002ce79705a3275559@google.com> <20200413133216.df03bc0a952276abdaa610cd@linux-foundation.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 14 Apr 2020 09:23:40 +0200 Dmitry Vyukov wrote: >=20 > On Mon, Apr 13, 2020 at 10:32 PM Andrew Morton > wrote: > > > > On Mon, 13 Apr 2020 00:50:11 -0700 syzbot zkaller.appspotmail.com> wrote: > > > > > Hello, > > > > > > syzbot found the following crash on: > > > > > > HEAD commit: ae46d2aa mm/gup: Let __get_user_pages_locked() retu= rn -=3D > EIN.. > > > git tree: upstream > > > console output: https://syzkaller.appspot.com/x/log.txt?x=3D3D12b60= 343e00=3D > 000 > > > kernel config: https://syzkaller.appspot.com/x/.config?x=3D3Dca759= 79eeeb=3D > f06c2 > > > dashboard link: https://syzkaller.appspot.com/bug?extid=3D3D2854d22= c7dd95=3D > 7a6519a > > > compiler: gcc (GCC) 9.0.0 20181231 (experimental) > > > > > > Unfortunately, I don't have any reproducer for this crash yet. > > > > > > IMPORTANT: if you fix the bug, please add the following tag to the = comm=3D > it: > > > Reported-by: syzbot+2854d22c7dd957a6519a@syzkaller.appspotmail.com > > > > (cc's added) > > > > Looks like the loop backing device's pagecache still has a dirty page= , > > despite us having just run sync_blockdev(). It may well be a race of > > some form - do we have any description of what the test is doing? >=20 >=20 > Yes, it's probably loop related. And this is probably a very hard to > trigger race. > Below are the suspect programs that triggered this. > This also happened on upstream before: > https://syzkaller.appspot.com/bug?id=3D3D77543faae8aa91ae9993d8e0d34df4= 1926b2=3D > dc8f > And also on ChromeOS 4.19 and one 4.15 tree. But in all cases the rate > is very low and syzkaller was never able to reproduce this. So I would > assume this is a race with an inconsistency window around few > instructions. But I think it is real because over the past year it > happened 14 times and reports are similar each time and the suspect > programs are similar and there are no red flags in these crashes. If its comment is still correct, is it making sense to lock inode? /** * truncate_inode_pages - truncate *all* the pages from an offset * @mapping: mapping to truncate * @lstart: offset from which to truncate * * Called under (and serialised by) inode->i_mutex. * * Note: When this function returns, there can be a page in the process o= f * deletion (inside __delete_from_page_cache()) in the specified range. = Thus * mapping->nrpages can be non-zero when this function returns even after * truncation of the whole mapping. */ (BTW, a tree-wide cleanup of comment in terms of i_mutex looks needed.) --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -83,7 +83,9 @@ void kill_bdev(struct block_device *bdev return; =20 invalidate_bh_lrus(); + inode_lock(bdev->bd_inode); truncate_inode_pages(mapping, 0); + inode_unlock(bdev->bd_inode); }=09 EXPORT_SYMBOL(kill_bdev); =20