Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4188813pxj; Tue, 15 Jun 2021 17:52:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIK7a8YzjJbsqLBBSS/1sbUMrcOxZqaRfzL6Wj9G1cWHujTvNA3FycHYxkRlEBwvEeFQzg X-Received: by 2002:a05:6402:3c1:: with SMTP id t1mr990683edw.270.1623804738909; Tue, 15 Jun 2021 17:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623804738; cv=none; d=google.com; s=arc-20160816; b=hRTRoKUTys9Y47FN+r2b8Gjrh4Tdz/um2i26KXJ1rUR/R4Xuzy+Mr6yKOtmGEWhkY2 I2H1I6Zw3uUAePqhmn7FVKyOMwCfFb1CRTz9bccM9RtbQGZpsytAeARPdf0Zx9KFt0uS 5zx24aCfU1VVnZYvDgWLUrTEjM/4PukqmAL7Z7WsMlq5KPGOWlJLWX0B+A8uHqS2c1n4 O0TNdK01glN+vEIlPoR8mtJzU+bEm7RI6B9vSduaCbwWhPL95x1UL4HaumZXoJeuN0YG J6hGQHJG5nNJSAixCpADjIcjkGpDkOmSnt8oMmJCKVA/UiRdP/TvbbGokoXJ/Kqy5gbQ RLFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=N705IiD7n6FnNdMOVPwQtLkiV4KgkJ6X1/De6zQZWwI=; b=yP5hUjxYOeMzIgQjt6ynqj+IjtBLTGkD/6DhL8RzjcrfEStMjeoKhxxUPGoIktucmS DVK/bCXG6j3NRUOh6Ro3n1X1Grx9Xzto4HFPfcQ6Iy+T5zWXutmCx2K+WpM+zBIIWsVG 5GqcQwKBNFx80l5251FL4jHkvM/tvyT/7wXtIf9BwvVuXahhYEgu6BiBYBtHjOwfkX/s LXA+mLtsJW15H3hZspQNzmMFK1wWaW+Znu8CFtIWi1DfK7JL5GWVnbPd6XJxH2AbMKCd hAQFZdute1xShAekLTitBrkwfynINwJk/uY0G1f/Mr8jnCcpgwBGo+r+paWTxke8YoYx h/HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Vdg0YlGJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s3si566973ejs.220.2021.06.15.17.51.55; Tue, 15 Jun 2021 17:52:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Vdg0YlGJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230265AbhFPAvG (ORCPT + 99 others); Tue, 15 Jun 2021 20:51:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230507AbhFPAvF (ORCPT ); Tue, 15 Jun 2021 20:51:05 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89989C06175F for ; Tue, 15 Jun 2021 17:49:00 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id u18so261785plc.0 for ; Tue, 15 Jun 2021 17:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=N705IiD7n6FnNdMOVPwQtLkiV4KgkJ6X1/De6zQZWwI=; b=Vdg0YlGJ8YdIQxJsskt857Kp1UiDME+54VPtdHVPVXgoShl4VVVAaR6LXE0dbZKVV2 +W+U4JeT3w/znleh/vZYdYXLbeE/pb0HV5ZEWUPDcvLxO26mt2qXZgivFzn3uSvahElD IwGdaPoF4IcRH7qJIdQjXQmZCbal2lLL+QkYNIl2RRjAfHR9PYesk+uc+Sgyx5CZHFfl e2DUPodC5WlhmtLJUFdwdvpJ9eljMdTNGqS+3FoZy7nhDaFOgT1hWfV8NXRx6YQNwhKl h2XdYcERWOQAJ9xAgYdgl/J4fe3qT8u41yhXFC39k2ZstvQJHVRG9+iqruFGveOSagxS R4dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=N705IiD7n6FnNdMOVPwQtLkiV4KgkJ6X1/De6zQZWwI=; b=dYheVtJKCTNv29MgKrzXBmViBJjf/rgREGQKgMBnEl4dcOpBqAn5NuGVFbFGPHFduh pmdON7+71nAuCoc3jjP+4UPQXbeduB1XYcOSzcllxZkzVBmwXeoBjgnkYaKcurHG3aEu zkcr/+vlmBEFNTMxUXK098gSse+KjPvvdtgBPTqwKFrpDD7WorRwdQPcpcUN24brjYmA Jq8wSL2wai50zfaGz0DQmxI3jGEDJrDcGEOJQPWSgqUDPqLPCSwQYtcr3RtuL5U/gMB9 96T99d4PVhTJXwHTVvpYZ2dTMoGa56WlDADShEvtOUlKvhz+PTbEOxZ8lBFt532pVXUj fqeg== X-Gm-Message-State: AOAM530d6DiYDkRp9UUQEa2UeEX03TGHXTxcIlmbiqGd9nlrhlm9fEKa fPanIlKHy3n0cGZhHCuWsfoLsVMUK0mCtoma/+I0Nw== X-Received: by 2002:a17:90a:8589:: with SMTP id m9mr7683966pjn.168.1623804539893; Tue, 15 Jun 2021 17:48:59 -0700 (PDT) MIME-Version: 1.0 References: <20210604011844.1756145-1-ruansy.fnst@fujitsu.com> <20210604011844.1756145-4-ruansy.fnst@fujitsu.com> In-Reply-To: <20210604011844.1756145-4-ruansy.fnst@fujitsu.com> From: Dan Williams Date: Tue, 15 Jun 2021 17:48:49 -0700 Message-ID: Subject: Re: [PATCH v4 03/10] fs: Introduce ->corrupted_range() for superblock To: Shiyang Ruan Cc: Linux Kernel Mailing List , linux-xfs , Linux MM , linux-fsdevel , device-mapper development , "Darrick J. Wong" , david , Christoph Hellwig , Alasdair Kergon , Mike Snitzer , Goldwyn Rodrigues , Linux NVDIMM Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ drop old linux-nvdimm@lists.01.org, add nvdimm@lists.linux.dev ] On Thu, Jun 3, 2021 at 6:19 PM Shiyang Ruan wrote: > > Memory failure occurs in fsdax mode will finally be handled in > filesystem. We introduce this interface to find out files or metadata > affected by the corrupted range, and try to recover the corrupted data > if possiable. > > Signed-off-by: Shiyang Ruan > --- > include/linux/fs.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/linux/fs.h b/include/linux/fs.h > index c3c88fdb9b2a..92af36c4225f 100644 > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -2176,6 +2176,8 @@ struct super_operations { > struct shrink_control *); > long (*free_cached_objects)(struct super_block *, > struct shrink_control *); > + int (*corrupted_range)(struct super_block *sb, struct block_device *bdev, > + loff_t offset, size_t len, void *data); Why does the superblock need a new operation? Wouldn't whatever function is specified here just be specified to the dax_dev as the ->notify_failure() holder callback?