From patchwork Tue Jul 19 10:04:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Maiolino X-Patchwork-Id: 9236677 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 09A2B6075D for ; Tue, 19 Jul 2016 10:04:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE3871FF21 for ; Tue, 19 Jul 2016 10:04:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E22DC20072; Tue, 19 Jul 2016 10:04:34 +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 AC4201FF21 for ; Tue, 19 Jul 2016 10:04:33 +0000 (UTC) Received: from oss.sgi.com (localhost [IPv6:::1]) by oss.sgi.com (Postfix) with ESMTP id B6B3C7CA1; Tue, 19 Jul 2016 05:04:31 -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 30F177CA0 for ; Tue, 19 Jul 2016 05:04:29 -0500 (CDT) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 0275A8F8033 for ; Tue, 19 Jul 2016 03:04:25 -0700 (PDT) X-ASG-Debug-ID: 1468922664-04cb6c4da285030001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id sh2tlj7OR3uJ2ufn (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 19 Jul 2016 03:04:24 -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-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 EB94F81F03 for ; Tue, 19 Jul 2016 10:04:23 +0000 (UTC) Received: from zion.usersys.redhat.com (vpn-55-34.rdu2.redhat.com [10.10.55.34]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6JA4MwG027722 for ; Tue, 19 Jul 2016 06:04:23 -0400 From: Carlos Maiolino To: xfs@oss.sgi.com Subject: [PATCH] xfs: Document error handling behavior Date: Tue, 19 Jul 2016 12:04:17 +0200 X-ASG-Orig-Subj: [PATCH] xfs: Document error handling behavior Message-Id: <1468922657-3895-1-git-send-email-cmaiolino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 19 Jul 2016 10:04:23 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1468922664 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 3910 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 This is the first try to document the implementation of error handlers into sysfs. Reviews and comments are appreciated, please also notice I'm not english-native, so, spelling corrections are also appreciated :) Signed-off-by: Carlos Maiolino --- Documentation/filesystems/xfs.txt | 78 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/Documentation/filesystems/xfs.txt b/Documentation/filesystems/xfs.txt index 8146e9f..1df868a 100644 --- a/Documentation/filesystems/xfs.txt +++ b/Documentation/filesystems/xfs.txt @@ -348,3 +348,81 @@ Removed Sysctls ---- ------- fs.xfs.xfsbufd_centisec v4.0 fs.xfs.age_buffer_centisecs v4.0 + +Error handling +============== + +XFS can act differently according with 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 shutdown in case of a specific + error is found during the filesystem operation. It can + shutdown immediately, after a defined number of tries, or + simply try forever, which was the old behavior and is now + set as default behavior, except during unmount time, where + in case of a error is found while unmounting, the filesystem + will shutdown. + + -error classes: + Specifies the subsystem/location where the error handlers + configure the behavior for, such as metadata or memory allocation. + + -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 following structure: + + /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 during unmount time. If set to + "1", XFS will shutdown in case of any error is found, otherwise, + if set to "0", the filesystem will indefinitely retry to cleanly + unmount the filesystem. + + subdirectories + Contains specific error handlers configuration + (Ex: /sys/fs/xfs//error/metadata). + + /sys/fs/xfs//error// + + The contents of this directory are specific, since each + might need to handle different types of errors. All directory + though, contains the "default" directory, which is a global configuration + for errors not available for independent configuration. + + /sys/fs/xfs//error// + + Contains the failure speed configuration files for each specific error, + including the "default" behavior, which contains the same configuration + options as the specific errors. + + The available configurations for each error type are: + + max_retries (Min: -1 Default: -1 Max: INTMAX) + Define how many tries the filesystem is allowed to retry its + operations during the specific error, before shutdown the + filesystem. Setting this file to "-1", will set XFS to retry + forever in the specific error, setting it to "0", will make + XFS to fail immediately after the specific error is found, + while setting it to a "N" value, where N is greater than 0, + will make XFS retry "N" times before shutdown. + + 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. "0" means no wait time. + + + "max_retries" takes precedence over "retry_timeout_seconds", where, + "retry_timeout_seconds" will only be tested if the "max_retries" limit + were not reached yet or is set to retry forever ("-1"). If "max_retries" + limit is reached, the filesystem will shutdown, wether or not + "retry_timeout_seconds" has been reached.