From patchwork Fri Aug 26 17:17:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 12956330 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 7B92BECAAA3 for ; Fri, 26 Aug 2022 17:17:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1158E6B0074; Fri, 26 Aug 2022 13:17:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 09D45940008; Fri, 26 Aug 2022 13:17:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E590F6B0078; Fri, 26 Aug 2022 13:17:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id CFDBB6B0074 for ; Fri, 26 Aug 2022 13:17:51 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B04064057D for ; Fri, 26 Aug 2022 17:17:51 +0000 (UTC) X-FDA: 79842401142.10.6114A2D Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf25.hostedemail.com (Postfix) with ESMTP id 99EECA0024 for ; Fri, 26 Aug 2022 17:17:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661534270; x=1693070270; h=subject:from:to:cc:date:message-id:mime-version: content-transfer-encoding; bh=KwjNfQYAzpFvaPY/cJlUEOzalTxntNE7gB2sV8ipr7o=; b=lchMF85z9FkNJAh+b0l7Px1xIEQXtZIYk6gvknN+xPKDZ/gnkc0dd9C0 m2xuAQHbTW7rDU7c73Jmb/UDN4KV4rPS3v0xUiYTg9Fh+SlD0083FqEoJ oQ1vjUK/xh3xuh3IL0qJH4Pq85oY82hXt6lfMuu0PPOE+6ZNHSfq3Wmv7 X0ob4q9lesD2FNTsCdEyhMTzyMWIw0iyUjKWSbb7DaDHSw1L24zi87Sby w+r56U1cKNNMHS0c77gl17ibU4Te+ePDzW4c2DQOfRykyhxAx6vAebet3 gkGkDf5LCbhGPnWrGgJ1x/xLrd5JYeLzZlGutGpvmiwRUWNgguaJ/r+mK A==; X-IronPort-AV: E=McAfee;i="6500,9779,10451"; a="293297689" X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208";a="293297689" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 10:17:49 -0700 X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208";a="856078731" Received: from jodirobx-mobl2.amr.corp.intel.com (HELO dwillia2-xfh.jf.intel.com) ([10.209.108.22]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 10:17:48 -0700 Subject: [PATCH 0/4] mm, xfs, dax: Fixes for memory_failure() handling From: Dan Williams To: akpm@linux-foundation.org, djwong@kernel.org Cc: Goldwyn Rodrigues , Jane Chu , Shiyang Ruan , Miaohe Lin , Christoph Hellwig , Dave Chinner , Matthew Wilcox , Ritesh Harjani , Naoya Horiguchi , Al Viro , nvdimm@lists.linux.dev, linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Date: Fri, 26 Aug 2022 10:17:48 -0700 Message-ID: <166153426798.2758201.15108211981034512993.stgit@dwillia2-xfh.jf.intel.com> User-Agent: StGit/0.18-3-g996c MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661534271; a=rsa-sha256; cv=none; b=aBZo2q5V+xgMx64wDNch+tyd2iQGPem9+Ch5zNeaihxT0tKWDIx4NJ+kDmC0nPPptq70EM o9+/EfbiSCIfXJZEsMlVyVtTDBVh8RDTEIkTOKzm1s175LBH/SMLHTkINB9stlgYHkjFdC GuA9t7EOoIEjWvv1OZxuG/3pbi29X4U= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=lchMF85z; spf=pass (imf25.hostedemail.com: domain of dan.j.williams@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661534271; 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: references:dkim-signature; bh=5IpDRxOePmKW+d8bIjhzWsCdAGT9NOYriPP1AdAEY4Y=; b=SdWfmOPgNg0JK/sVcWvOGf6R7WhwEg2/eznDi9ADkxO38uV/SEJLkBShSui+OCf/b3RRKL dhGNpm4GhNfZxavoFj6k6TFjmGdB/+36ysWWqku6thJ2qXr2qopqqHhmg/Hy1xgFxisq1K FvQszDW80Mv64qYcOx/C4+i/qsLC2FA= X-Stat-Signature: nfenyrn9ya89zdhfo8ao9efcpqzwchxh X-Rspamd-Queue-Id: 99EECA0024 Authentication-Results: imf25.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=lchMF85z; spf=pass (imf25.hostedemail.com: domain of dan.j.williams@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspam-User: X-Rspamd-Server: rspam02 X-HE-Tag: 1661534270-729501 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: I failed to run the memory error injection section of the ndctl test suite on linux-next prior to the merge window and as a result some bugs were missed. While the new enabling targeted reflink enabled XFS filesystems the bugs cropped up in the surrounding cases of DAX error injection on ext4-fsdax and device-dax. One new assumption / clarification in this set is the notion that if a filesystem's ->notify_failure() handler returns -EOPNOTSUPP, then it must be the case that the fsdax usage of page->index and page->mapping are valid. I am fairly certain this is true for xfs_dax_notify_failure(), but would appreciate another set of eyes. The bulk of the change is in mm/memory-failure.c, so perhaps this set should go through Andrew's tree. --- Dan Williams (4): xfs: Quiet notify_failure EOPNOTSUPP cases xfs: Fix SB_BORN check in xfs_dax_notify_failure() mm/memory-failure: Fix detection of memory_failure() handlers mm/memory-failure: Fall back to vma_address() when ->notify_failure() fails fs/xfs/xfs_notify_failure.c | 6 +++--- include/linux/memremap.h | 5 +++++ mm/memory-failure.c | 24 +++++++++++++----------- 3 files changed, 21 insertions(+), 14 deletions(-) base-commit: 1c23f9e627a7b412978b4e852793c5e3c3efc555