From patchwork Thu Sep 8 09:23:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Maiolino X-Patchwork-Id: 9320747 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 016196077F for ; Thu, 8 Sep 2016 09:24:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE7EC29754 for ; Thu, 8 Sep 2016 09:24:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2E2D29756; Thu, 8 Sep 2016 09:24:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from oss.sgi.com (oss.sgi.com [192.48.182.195]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A091229755 for ; Thu, 8 Sep 2016 09:24:08 +0000 (UTC) Received: from oss.sgi.com (localhost [IPv6:::1]) by oss.sgi.com (Postfix) with ESMTP id 0EC487CBC; Thu, 8 Sep 2016 04:24:07 -0500 (CDT) X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 16AA27CB9 for ; Thu, 8 Sep 2016 04:24:05 -0500 (CDT) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id BEEC08F8040 for ; Thu, 8 Sep 2016 02:24:04 -0700 (PDT) X-ASG-Debug-ID: 1473326643-0bf8155c7482ff50001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id OV8w6nvBinFYB0Gy (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 08 Sep 2016 02:24:03 -0700 (PDT) X-Barracuda-Envelope-From: cmaiolino@redhat.com X-Barracuda-Effective-Source-IP: mx1.redhat.com[209.132.183.28] X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EAF45155E4; Thu, 8 Sep 2016 09:24:02 +0000 (UTC) Received: from gfs-i24c-02.mpc.lab.eng.bos.redhat.com (gfs-i24c-02.mpc.lab.eng.bos.redhat.com [10.16.144.214]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u889O23c002195; Thu, 8 Sep 2016 05:24:02 -0400 From: Carlos Maiolino To: linux-xfs@vger.kernel.org, xfs@oss.sgi.com Subject: [PATCH] xfs: Document error handlers behavior Date: Thu, 8 Sep 2016 05:23:55 -0400 X-ASG-Orig-Subj: [PATCH] xfs: Document error handlers behavior Message-Id: <1473326635-30209-1-git-send-email-cmaiolino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 08 Sep 2016 09:24:02 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1473326643 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 3753 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-BeenThere: xfs@oss.sgi.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com X-Virus-Scanned: ClamAV using ClamSMTP Document the implementation of error handlers into sysfs. Changelog: V2: - Add a description of the precedence order of each option, focusing on the behavior of "fail_at_unmount" which was not well explained in V1 V3: - Fix English spelling mistakes suggested by Eric Signed-off-by: Carlos Maiolino --- Documentation/filesystems/xfs.txt | 70 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/Documentation/filesystems/xfs.txt b/Documentation/filesystems/xfs.txt index 8146e9f..8b6c861 100644 --- a/Documentation/filesystems/xfs.txt +++ b/Documentation/filesystems/xfs.txt @@ -348,3 +348,73 @@ Removed Sysctls ---- ------- fs.xfs.xfsbufd_centisec v4.0 fs.xfs.age_buffer_centisecs v4.0 + +Error handling +============== + +XFS can act differently according to the type of error found +during its operation. The implementation introduces the following +concepts to the error handler: + + -failure speed: + Defines how fast XFS should shut down when of a specific error is found + during the filesystem operation. It can shut down immediately, after a + defined number of retries, after a set time period, or simply retry + forever. The old "retry forever" behavior is still the default, except + during unmount, where any IOs retrying due to errors will be cancelled + and unmount will be allowed to proceed. + + -error classes: + Specifies the subsystem/location where the error handlers, such as + metadata or memory allocation. Only metadata IO errors are handled + at this time. + + -error handlers: + Defines the behavior for a specific error. + +The filesystem behavior during an error can be set via sysfs files, where the +errors are organized with the structure below. Each configuration option works +independently, the first condition met for a specific configuration will cause +the filesystem to shut down: + + /sys/fs/xfs//error/// + +Each directory contains: + + /sys/fs/xfs//error/ + + fail_at_unmount (Min: 0 Default: 1 Max: 1) + Defines the global error behavior at unmount time. If set to the + default value of 1, XFS will cancel any pending IO retries, shut + down, and unmount. If set to 0, pending IO retries may prevent + the filesystem from unmounting. + + subdirectories + Contains specific error handlers configuration + (Ex: /sys/fs/xfs//error/metadata, see below). + + /sys/fs/xfs//error// + + Directory containing configuration for a specific error ; + currently only the "metadata" is implemented. + The contents of this directory are specific, since each + might need to handle different types of errors. + + /sys/fs/xfs//error/// + + Contains the failure speed configuration files for specific errors in + this directory + contains the following configuration files: + + max_retries (Min: -1 Default: -1 Max: INTMAX) + Defines the allowed number of retries of a specific error before + the filesystem will shut down. The default value of "-1" will + cause XFS to retry forever for this specific error. Setting it + to "0" will cause XFS to fail immediately when the specific + error is found, and setting it to "N," where N is greater than 0, + will make XFS retry "N" times before shutting down. + + retry_timeout_seconds (Min: 0 Default: 0 Max: INTMAX) + Define the amount of time (in seconds) that the filesystem is + allowed to retry its operations when the specific error is + found. The default value of "0" will cause XFS to retry forever.