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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD874C0502A for ; Tue, 30 Aug 2022 06:17:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 112956B0073; Tue, 30 Aug 2022 02:17:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C9096B0074; Tue, 30 Aug 2022 02:17:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ECB96940007; Tue, 30 Aug 2022 02:17:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id DDF4A6B0073 for ; Tue, 30 Aug 2022 02:17:50 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A7559140C4D for ; Tue, 30 Aug 2022 06:17:50 +0000 (UTC) X-FDA: 79855253100.30.9936D7F Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf18.hostedemail.com (Postfix) with ESMTP id CE16A1C0010 for ; Tue, 30 Aug 2022 06:17:49 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MGxrb3cJSzHnVd; Tue, 30 Aug 2022 14:15:59 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 30 Aug 2022 14:17:44 +0800 Subject: Re: [PATCH 4/4] mm/memory-failure: Fall back to vma_address() when ->notify_failure() fails To: Dan Williams CC: Shiyang Ruan , Christoph Hellwig , Naoya Horiguchi , Al Viro , Dave Chinner , Goldwyn Rodrigues , Jane Chu , Matthew Wilcox , Ritesh Harjani , , , , , , References: <166153426798.2758201.15108211981034512993.stgit@dwillia2-xfh.jf.intel.com> <166153429427.2758201.14605968329933175594.stgit@dwillia2-xfh.jf.intel.com> <76fb4464-73eb-256c-60e0-a0c3dc152e78@huawei.com> <630d8a902231b_259e5b29490@dwillia2-xfh.jf.intel.com.notmuch> From: Miaohe Lin Message-ID: Date: Tue, 30 Aug 2022 14:17:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <630d8a902231b_259e5b29490@dwillia2-xfh.jf.intel.com.notmuch> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661840270; a=rsa-sha256; cv=none; b=jD9o4pUYKYjDnDYVXElgtyZFpp+SlEYRXXpQKIiL44cSseIxt+sr90MMM1ghtZ0V5QmXLX iE2XlaTeDsTPWxH4q1rjLgxSGEPSvCrJZlRUea5JNyzrYYldk2A6RpOrrfdvurvIDbkTSX 877fgnQlpLxbtIodBaoahlN3dzzW4yE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661840270; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gYCChQFj8/pK6tlooKtDzy522urohF228s/SKwr8298=; b=zVCJ7PN2jkcYicRyEj4Swyt6qpxq28H7gYllOuZdgI6iNBsuOvKutTiUyMAPEVZvkilzBH 1ySvaUoXdLcVV68CFfvV1xb08S9ijwhbzscZh235BWlHZ3l+APcdQKX6hACDPrnWqSg7oX Le7EoGX3eoXF0JAt8rCS470N1jjXhHI= X-Rspamd-Queue-Id: CE16A1C0010 X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspamd-Server: rspam02 X-Stat-Signature: ikruw1r6xbs3zz7mae4oi36h4g1zrf5w X-HE-Tag: 1661840269-833889 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 2022/8/30 11:57, Dan Williams wrote: > Miaohe Lin wrote: >> On 2022/8/27 1:18, Dan Williams wrote: >>> In the case where a filesystem is polled to take over the memory failure >>> and receives -EOPNOTSUPP it indicates that page->index and page->mapping >>> are valid for reverse mapping the failure address. Introduce >>> FSDAX_INVALID_PGOFF to distinguish when add_to_kill() is being called >>> from mf_dax_kill_procs() by a filesytem vs the typical memory_failure() >>> path. >> >> Thanks for fixing. >> I'm sorry but I can't find the bug report email. > > Report is here: > > https://lore.kernel.org/all/63069db388d43_1b3229426@dwillia2-xfh.jf.intel.com.notmuch/ > >> Do you mean mf_dax_kill_procs() can pass an invalid pgoff to the >> add_to_kill()? > > No, the problem is that ->notify_failure() returns -EOPNOTSUPP so > memory_failure_dev_pagemap() falls back to mf_generic_kill_procs(). > However, mf_generic_kill_procs() end up passing '0' for fsdax_pgoff from > collect_procs_file() to add_to_kill(). A '0' for fsdax_pgoff results in > vma_pgoff_address() returning -EFAULT which causes the VM_BUG_ON() in > dev_pagemap_mapping_shift(). Many thanks for your explanation. Reviewed-by: Miaohe Lin Thanks, Miaohe Lin