Message ID | 20230511091308.10509-1-frank.li@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4229354vqo; Thu, 11 May 2023 02:22:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72INbgkV/yaiF0jCSG2IzAF1mBjx6LhxGGj4Ub7sWE/bl63T9J93ORcZK6UbGy3/YMwZit X-Received: by 2002:a05:6a00:23cd:b0:643:6aed:3a9 with SMTP id g13-20020a056a0023cd00b006436aed03a9mr28828010pfc.0.1683796942140; Thu, 11 May 2023 02:22:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683796942; cv=pass; d=google.com; s=arc-20160816; b=f4cCGjTkauwN06bgzlIKI0LuyblzD2Jbn8rr0c9CFqACH34O4m5HGj5ux+w+0SegPJ rEWrtjsCm7N4I8bf1z5HqScZ1uq+Z4o3OfTh+Ddwx5cs1qWYzokuNaGbRhsOYJBAe3vU eYGndXV3BwX9l1IyHeLSk+5La61oHtvoa9qWcbZvrhlylQfPxe0C5mJGLmPBujl2IKfS NnNuywr2ibS7OiDtAU6ap5P4gJYQElGB4rAyOLXh8+eujWSzDi+Kt7+TdKRAobz89EbY HbXt+6cXXp4pUUEvaz2tCevtg/jI3My0Jeo7dhlYKC6gz5trrVKObYR3CiiW9PdDaGM+ qZRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=eyd01Gz0989Bi0WTGp7Or6Ye52CZFtSQKD8g4oqItE4=; b=R5Oi7BHivD50hKcLxZEPmS35ZZTYbIn5t31aAe7hBz4zpsK5opVyqIX3mSeYt15HbI DURs4ggdl0rBfLjBvM8iUEB83yhI7n6oayz2TwiAEoABxApv9bX4Hct6ttQRiHGrQnMB sf4NsbYAdLxbrAL4fmGuK9vHBBpJ7fWq3vdJ7oqoWyZp/Vl9FVU8YBTGRu/uD4NOcyyd UVmSR6XoWBL0yOJtoU+Y2/qNxUwk0I8L15pzTCK1MAEYYSrv4tC4tGHuhS3jDvCi/kLi aD0iRrH7VBnVl/73xCnrMR2IqqfH4SnXOIVFunvNhPa+jmGBP0nVwkYsnvjYcf2H6RxX 5ccA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=ROMZx3Cv; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r11-20020aa7962b000000b0064309ecbad9si6982027pfg.30.2023.05.11.02.22.05; Thu, 11 May 2023 02:22:22 -0700 (PDT) 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; dkim=pass header.i=@vivo.com header.s=selector2 header.b=ROMZx3Cv; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237261AbjEKJNa (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Thu, 11 May 2023 05:13:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232267AbjEKJN2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 11 May 2023 05:13:28 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2109.outbound.protection.outlook.com [40.107.215.109]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D2AFAF for <linux-kernel@vger.kernel.org>; Thu, 11 May 2023 02:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZYnq6kUfCl+QQIiVYluBtfVfKlc7OP6YtfB/t+b4yz317tv2RYH5kDN1eGR1/E7k0JyyN25W4Ukd7/ZbFQ2n5o67Fq0pD4zAXLpQUROWnoRzxo5XjSKNLzJRI9I9Du6IGqI532G2tXHJYjF0IaNL7hPom/ypw8zk16jL5PLwipRIJA29TOdvdZtjFSjzX3FreZSDw+JXfY0UejIFci/ZuqmUqq3RkAWreCooixrrXBZolRNZhKS/gKPQEy9SzCqdaCEjpbKs5pjPIql3EaHYxim2Eqa7WXBgMtWpeUNqTZUVXyG2zBRt1MQaZkgquVVJbzYhujaYNGegb8DUw7OYrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eyd01Gz0989Bi0WTGp7Or6Ye52CZFtSQKD8g4oqItE4=; b=nlhRa/Y7kXvXKrj+f4JhmsJl7UC0C4Yw+wtYj7lRjmcgs5G4nikASq3/UGYHMl2Mq4NABdGw2cQY7bIpw7JlcFdeNYSZlfotyI+KcTw1yCRn9t8ZZ4ZtMc82eyAe8qxwsS/JX4XBb5Hn1YnoVZeSH1Xz2n6TYdmESpfWzHSx8GARw6AeEqQoSOBpcM/r4QXq46TRWGNRkobj22ulKaZa6nvqIDTzJk5Y890TCc8wuROF1i+cCXvUmwmtX3R5GJGY2yiqBSdg/BXOCnpQRxa5zBb3SB1YIt21cQIEsT2koOoSXTSMHit/DteOqqEHtN4t5fom6Ci0xkSUg5dOEJBCeQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eyd01Gz0989Bi0WTGp7Or6Ye52CZFtSQKD8g4oqItE4=; b=ROMZx3CvIU4DnpGtlyKLcLymz+P0m4yj9hmN78kzrH4UPZ1oX6c+VkKm1a9+u9gCWL3UUCkbYI0Y+s+02F7uqMTExppTl/VgphmU0lUYWmJ6P+85hs1iBdr97HGgYbDGx/lVDCpR76q5k8YxQxx+0+T1HcKnsYwWaQArDPhMsFG0WMTg3mA3IaFM0/VHVN3sT+yHPSJTV8N/reurhL7q/eK6WJr1RsdkpmoBWA5h5RePHtkwQh2a1lJ2FYxlClgo6nVuqI8rB+3kXgNiwoDZIrLNtoXV+TPQjl+Eul9tHNgRnan5f+EPoRC6aRn4iCZhAYY+D67No7uE89PcK1o5rQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SG2PR06MB5059.apcprd06.prod.outlook.com (2603:1096:4:1c7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Thu, 11 May 2023 09:13:20 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::76d6:4828:7e80:2965]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::76d6:4828:7e80:2965%3]) with mapi id 15.20.6363.033; Thu, 11 May 2023 09:13:20 +0000 From: Yangtao Li <frank.li@vivo.com> To: Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <chao@kernel.org> Cc: Yangtao Li <frank.li@vivo.com>, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] f2fs: add fsnotify_sb_error() in f2fs_save_errors Date: Thu, 11 May 2023 17:13:07 +0800 Message-Id: <20230511091308.10509-1-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI1PR02CA0009.apcprd02.prod.outlook.com (2603:1096:4:1f7::10) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SG2PR06MB5059:EE_ X-MS-Office365-Filtering-Correlation-Id: 399be76b-3a3c-4fc4-625c-08db51fff692 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +/OEu5ZDeKkm1dmg8xQamukUWhVOQgOkvdlX7Ea1GqCn3dvyvTuMVyZXTBwoNWfl2YF2nqYdBIj7ZomzeMHaDwniKqcscOa8tzp+db5CUjrmdwzPj/07t7snMpIulJBzyyjeP2ulMy87CAH+uWWi5NBGK9HH7gaDfT6XKy9qLpeI/L2ktFp7VBVuDEozT455X8iAJbE4mnkT4FvQH6rgo0A7p9lb4f0A2SMSo4qQsp+J1OJWAsxe71UmRmtpG6TAIMDClPiaf2voIUlfGLkk329VCVXxsKgMNvwLs/FzahSh4TZgOWdeOaT6Ki7QbjxdMylSvAcV7SQgATffrX2E3wYv3C+Cd59HrF5vtB9kQEKnzrM6OTeJeppXeDKvjSi9LQxuv7Hl8DPZ66qjlRjUOB7Ha2ecxCPqJu8dSTe4dIz/YpsJfuxG2zKC4miCWlDCBlxXg2oZ+wPiI8XH8bLdMp1mNYOU3uS+3ZoqqnB8xC46dm/q1Y49Tt5yo74gVYKMVzPsiT+mWYx7TLXUC99NMtUdQeLnT2xX3aXAvYbbPatsLasM+DeDcSO4Yn8D1miDkA109OFUyFkMrOIb+ij9djxCCKseElyU0i8rS8nNHctggTldJVcorzqwSuLqkOXN X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(396003)(376002)(39860400002)(346002)(451199021)(478600001)(8676002)(66556008)(66946007)(41300700001)(66476007)(6666004)(4326008)(110136005)(8936002)(6486002)(52116002)(316002)(86362001)(5660300002)(1076003)(38350700002)(186003)(6512007)(6506007)(38100700002)(4744005)(2906002)(26005)(83380400001)(2616005)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: i1/ie3MIU1/k/2BfBZuV4OtLrXQep2/XOEOd+qB4BSv5xEyfRryfA/Ac7GRd4ZSaSWXfD3W9Bo/67SAetxZFKn71lCtWjVKLiKBUevu5RTTKrjh/OTa2G7p1tXvZIGe4TWKxnjO4jr+BfXtYZR1LgZkucxvWJarPP1ggSZqEN9pbMaYLH4JtRwbbJGezz7rj8lql1Chl53ekOUpQllskaaQaIJERnHcUs9O4iKdE8cT2dZpeO1yqZMnFkswsofAeA3Nblj0Qe0KVbKzhT/F/f3280UjIyahUi1GHFwLs/IdKr4kKV9A7br38gC9HfcG0LDtwakk1gYqfKG2czhTmu6nO9dhM/SxbCs1nPdzbc3dsNWKxxh7lAUrfyVnUrqFZcl/WTW7Yff5/hfMSD5bDHpfhCe5qJZ8PvwzuT6fkrafApZVTiCb9SrvA5ksi5PchbiMl0s7VKXowIYKGVWbYncfEOakrQEPSPoObKg1L6GK00m8A80Bh1Fm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/r2O8PUKSR0i/uTi X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 399be76b-3a3c-4fc4-625c-08db51fff692 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 09:13:20.0890 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: w2en42UKMFD6QFVxrmDQaSlhl3i/GvzJKu9ejhZ1eVgXJeEn8P86uoCUgy6olkNIoR99kAVX6Pu6RbHt8nPM+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB5059 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765589062348600520?= X-GMAIL-MSGID: =?utf-8?q?1765589062348600520?= |
Series |
f2fs: add fsnotify_sb_error() in f2fs_save_errors
|
|
Commit Message
李扬韬
May 11, 2023, 9:13 a.m. UTC
When an EFSCORRUPTED error occurs in f2fs, report the error to
userspace monitoring tools.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
fs/f2fs/super.c | 3 +++
1 file changed, 3 insertions(+)
Comments
On 2023/5/11 17:13, Yangtao Li wrote: > When an EFSCORRUPTED error occurs in f2fs, report the error to > userspace monitoring tools. > > Signed-off-by: Yangtao Li <frank.li@vivo.com> > --- > fs/f2fs/super.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index 51812f459581..42d5aa504afe 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -28,6 +28,7 @@ > #include <linux/part_stat.h> > #include <linux/zstd.h> > #include <linux/lz4.h> > +#include <linux/fsnotify.h> > > #include "f2fs.h" > #include "node.h" > @@ -4000,6 +4001,8 @@ void f2fs_save_errors(struct f2fs_sb_info *sbi, unsigned char flag) > sbi->error_dirty = true; > } > spin_unlock_irqrestore(&sbi->error_lock, flags); > + > + fsnotify_sb_error(sbi->sb, NULL, EFSCORRUPTED); Can we call this function in irq context? - f2fs_decompress_cluster - f2fs_save_errors Thanks, > } > > static bool f2fs_update_errors(struct f2fs_sb_info *sbi)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 51812f459581..42d5aa504afe 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -28,6 +28,7 @@ #include <linux/part_stat.h> #include <linux/zstd.h> #include <linux/lz4.h> +#include <linux/fsnotify.h> #include "f2fs.h" #include "node.h" @@ -4000,6 +4001,8 @@ void f2fs_save_errors(struct f2fs_sb_info *sbi, unsigned char flag) sbi->error_dirty = true; } spin_unlock_irqrestore(&sbi->error_lock, flags); + + fsnotify_sb_error(sbi->sb, NULL, EFSCORRUPTED); } static bool f2fs_update_errors(struct f2fs_sb_info *sbi)