Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1437263pxm; Thu, 24 Feb 2022 03:12:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaVPcf2jhhnskHWTgFf1laoru06eHCRBBSHF0FiykRBa5wLNMNWCYB0k8/F8uZofFrOKKY X-Received: by 2002:a63:f24b:0:b0:343:9666:eca9 with SMTP id d11-20020a63f24b000000b003439666eca9mr1928180pgk.274.1645701145026; Thu, 24 Feb 2022 03:12:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645701145; cv=none; d=google.com; s=arc-20160816; b=c3P+cJ8cMIKJgGFBwmUJ6UDGx1/kK1VYllvJ++afXvltbHzBRHXk8ELx8axfqhZ4Oe KE6mj4L7xqClNVAzNvktlrlPHNC7FFXZUJs2BlNLzMd7Etu4ZA8GRWBwXKZEuzqBZNnd AwIKV+jyesuiGQdTF89zDA3vVhmRLY8pthq9F63ehjCtvF73jOLS33NnNpz2Mwa4VoNb 1aKtoHMCc1F3VL6IqxBg2/PnmDto+FARdmP7EvMq8FgYQvFwViFyZgTRe1KdoRoK86fD EJRIs/3A6u8VnR3Z1RnDdvOOyfh6Vubj8A0ELHzWkMdYzyDO3NnKF+5aB3fm2n5UZhUH LE6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=CA1Zc8Rm1qEO6GkVqGPIoHGh5M9CzpZY0tO6O2hpBjU=; b=A4pjUkJ1HhWywAVW0nnfv7lbvjn1XOSWxnGZgHsBJB2I5Jr+k93kfBjV8iqSGr5/1y gQ7FrKMz1HyiIVAVp3pRJhvV7tjJ2S2lPsUkxP6KsMiqQ3UmcjHrwuohxjly+783gogM qYMtkxZIEV3jVK62OeXRGdsdAD6jWMwG7PMRXMeaVOGNLQYTuj21bS6rVUlLKX3bUP4R 2AiiTnqMSd87Zdz2j/IfIdiL1j9V+8j7tw40azbNHQZXWRzUK1TGrxAXRxDOLrUHaqHY 6FsLHCLg70IDDv4nWD7rb0kjOQfHWrzgMuJBDGssUSojfYToqSl9WkOIM5Ryt/HyTKkH QtQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u39si2221283pfg.208.2022.02.24.03.12.10; Thu, 24 Feb 2022 03:12:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233429AbiBXK3h (ORCPT + 99 others); Thu, 24 Feb 2022 05:29:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233314AbiBXK3f (ORCPT ); Thu, 24 Feb 2022 05:29:35 -0500 Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4F5D11E1484; Thu, 24 Feb 2022 02:29:05 -0800 (PST) Received: from dread.disaster.area (pa49-186-17-0.pa.vic.optusnet.com.au [49.186.17.0]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 377EB10E3F4B; Thu, 24 Feb 2022 21:29:01 +1100 (AEDT) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1nNBMr-00FpGo-82; Thu, 24 Feb 2022 21:29:01 +1100 Date: Thu, 24 Feb 2022 21:29:01 +1100 From: Dave Chinner To: Theodore Ts'o Cc: Greg Kroah-Hartman , John Hubbard , Lee Jones , linux-ext4@vger.kernel.org, Christoph Hellwig , Dave Chinner , Goldwyn Rodrigues , "Darrick J . Wong" , Bob Peterson , Damien Le Moal , Andreas Gruenbacher , Ritesh Harjani , Johannes Thumshirn , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, cluster-devel@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [REPORT] kernel BUG at fs/ext4/inode.c:2620 - page_buffers() Message-ID: <20220224102901.GN59715@dread.disaster.area> References: <82d0f4e4-c911-a245-4701-4712453592d9@nvidia.com> <20220224014842.GM59715@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.4 cv=deDjYVbe c=1 sm=1 tr=0 ts=62175def a=+dVDrTVfsjPpH/ci3UuFng==:117 a=+dVDrTVfsjPpH/ci3UuFng==:17 a=kj9zAlcOel0A:10 a=oGFeUVbbRNcA:10 a=7-415B0cAAAA:8 a=nNeadVlkB5BEUYMxFkMA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 23, 2022 at 10:50:09PM -0500, Theodore Ts'o wrote: > On Thu, Feb 24, 2022 at 12:48:42PM +1100, Dave Chinner wrote: > > > Fair enough; on the other hand, we could also view this as making ext4 > > > more robust against buggy code in other subsystems, and while other > > > file systems may be losing user data if they are actually trying to do > > > remote memory access to file-backed memory, apparently other file > > > systems aren't noticing and so they're not crashing. > > > > Oh, we've noticed them, no question about that. We've got bug > > reports going back years for systems being crashed, triggering BUGs > > and/or corrupting data on both XFS and ext4 filesystems due to users > > trying to run RDMA applications with file backed pages. > > Is this issue causing XFS to crash? I didn't know that. I have no idea if crashes nowdays - go back a few years before and search for XFS BUGging out in ->invalidate_page (or was it ->release_page?) because of unexpected dirty pages. I think it could also trigger BUGs in writeback when ->writepages tripped over a dirty page without a delayed allocation mapping over the hole... We were pretty aggressive about telling people reporting such issues that they get to keep all the borken bits to themselves and to stop wasting our time with unsolvable problems caused by their broken-by-design RDMA applications. Hence people have largely stopped bothering us with random filesystem crashes on systems using RDMA on file-backed pages... > I tried the Syzbot reproducer with XFS mounted, and it didn't trigger > any crashes. I'm sure data was getting corrupted, but I figured I > should bring ext4 to the XFS level of "at least we're not reliably > killing the kernel". Oh, well, good to know XFS didn't die a horrible death immediately. Thanks for checking, Ted. > On ext4, an unprivileged process can use process_vm_writev(2) to crash > the system. I don't know how quickly we can get a fix into mm/gup.c, > but if some other kernel path tries calling set_page_dirty() on a > file-backed page without first asking permission from the file system, > it seems to be nice if the file system doesn't BUG() --- as near as I > can tell, xfs isn't crashing in this case, but ext4 is. iomap is probably refusing to map holes for writepage - we've cleaned up most of the weird edge cases to return errors, so I'm guessing iomap is just ignoring such pages these days. Yeah, see iomap_writepage_map(): error = wpc->ops->map_blocks(wpc, inode, pos); if (error) break; if (WARN_ON_ONCE(wpc->iomap.type == IOMAP_INLINE)) continue; if (wpc->iomap.type == IOMAP_HOLE) continue; Yeah, so if writeback maps a hole rather than converts a delalloc region to IOMAP_MAPPED, it'll just skip over the block/page. IIRC, they essentially become uncleanable pages, and I think eventually inode reclaim will just toss them out of memory. Cheers, Dave. -- Dave Chinner david@fromorbit.com