From patchwork Fri Aug 9 21:37:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 11087655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 78FBA1709 for ; Fri, 9 Aug 2019 21:37:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63823204C1 for ; Fri, 9 Aug 2019 21:37:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57B0A212D9; Fri, 9 Aug 2019 21:37:49 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E740E204C1 for ; Fri, 9 Aug 2019 21:37:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728188AbfHIVhs (ORCPT ); Fri, 9 Aug 2019 17:37:48 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:55612 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728202AbfHIVhr (ORCPT ); Fri, 9 Aug 2019 17:37:47 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x79LYWf3092777 for ; Fri, 9 Aug 2019 21:37:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2019-08-05; bh=JfMyMPTkoz9PmxZq37r985v8LODspwcuvC1ykz2C6C8=; b=d46QkTdpUwu5wFWXq87aRBKsUXQZwbiSa8tNewd/4iWXugtiul7h+mAGjo2iVAGtgv/Y En+IVISr+Jq7+7+2N8xO2f2TcJek6davMMeG+nxURfmaaAaGT3KvIUH5qy8pp22lWP3R kcAbkqmHSQAjS+rKAydR95SKo8wyycdTl1IkUBUx6vHjPo0WgXYQnCAzrIupyaD36HMe iyOfqIWlOeD1Vmux1jS1AvnO7agZsD6QA2BlVhgaK8WcDoMlVvetrpj5lBXN9oWjizil /WihgVZ/YzuFMlxPA28LvebxJlPKHTrK4S+BWxt2AlV/NQOwCT3peNmlnE5iG64c+gJ6 Cw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=JfMyMPTkoz9PmxZq37r985v8LODspwcuvC1ykz2C6C8=; b=llRrL5+8aStBomFnxHuqy9BzLD8YN4PkchL6hP5u89RHWGVe3E/31pQN7CppTxY44wqv YXUcob0l1j89HuLevJxyun4RreF4IWeVbBdVlfr5ejj6Ij08JcKPKWeGu/FOUnL4VlHX JLy+AMd/Jr09iv5YZNbqX/Fhcb+2BTh58sR1P8lYmHvh2Asi2nMZKRI9vQB68qowH3/e nQTkWCb1ep+4QMCzzbaugKD/qdyYwsCOM6u4vSsmDESxgSg7ADaP/OoCIjbtOb/xDI83 K398oo3QakyxZ32WxVZESRG6TBlUYJ8sscUe0DVkYKOI1uJl4reuw9u+sTmgsCqOJLcM fQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2u8hasj985-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 09 Aug 2019 21:37:45 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x79LNLFU071981 for ; Fri, 9 Aug 2019 21:37:45 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 2u8x9fxjwm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 09 Aug 2019 21:37:45 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x79Lbh64019000 for ; Fri, 9 Aug 2019 21:37:44 GMT Received: from localhost.localdomain (/70.176.225.12) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 09 Aug 2019 14:37:38 -0700 From: Allison Collins To: linux-xfs@vger.kernel.org Subject: [PATCH v2 18/18] xfs: Add delayed attributes error tag Date: Fri, 9 Aug 2019 14:37:26 -0700 Message-Id: <20190809213726.32336-19-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190809213726.32336-1-allison.henderson@oracle.com> References: <20190809213726.32336-1-allison.henderson@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9344 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908090207 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9344 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908090208 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Allison Henderson This patch adds an error tag that we can use to test delayed attribute recovery and replay Signed-off-by: Allison Collins Reviewed-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_errortag.h | 4 +++- fs/xfs/xfs_attr_item.c | 8 ++++++++ fs/xfs/xfs_error.c | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/fs/xfs/libxfs/xfs_errortag.h b/fs/xfs/libxfs/xfs_errortag.h index 79e6c4f..85d5850 100644 --- a/fs/xfs/libxfs/xfs_errortag.h +++ b/fs/xfs/libxfs/xfs_errortag.h @@ -55,7 +55,8 @@ #define XFS_ERRTAG_FORCE_SCRUB_REPAIR 32 #define XFS_ERRTAG_FORCE_SUMMARY_RECALC 33 #define XFS_ERRTAG_IUNLINK_FALLBACK 34 -#define XFS_ERRTAG_MAX 35 +#define XFS_ERRTAG_DELAYED_ATTR 35 +#define XFS_ERRTAG_MAX 36 /* * Random factors for above tags, 1 means always, 2 means 1/2 time, etc. @@ -95,5 +96,6 @@ #define XFS_RANDOM_FORCE_SCRUB_REPAIR 1 #define XFS_RANDOM_FORCE_SUMMARY_RECALC 1 #define XFS_RANDOM_IUNLINK_FALLBACK (XFS_RANDOM_DEFAULT/10) +#define XFS_RANDOM_DELAYED_ATTR 1 #endif /* __XFS_ERRORTAG_H_ */ diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c index 6693880..045d23a 100644 --- a/fs/xfs/xfs_attr_item.c +++ b/fs/xfs/xfs_attr_item.c @@ -33,6 +33,8 @@ #include "libxfs/xfs_da_format.h" #include "xfs_inode.h" #include "xfs_quota.h" +#include "xfs_error.h" +#include "xfs_errortag.h" /* @@ -74,6 +76,11 @@ xfs_trans_attr( if (error) return error; + if (XFS_TEST_ERROR(false, args->dp->i_mount, XFS_ERRTAG_DELAYED_ATTR)) { + error = -EIO; + goto out; + } + switch (op_flags) { case XFS_ATTR_OP_FLAGS_SET: args->op_flags |= XFS_DA_OP_ADDNAME; @@ -87,6 +94,7 @@ xfs_trans_attr( error = -EFSCORRUPTED; } +out: /* * Mark the transaction dirty, even on error. This ensures the * transaction is aborted, which: diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c index 544c948..9b2de63 100644 --- a/fs/xfs/xfs_error.c +++ b/fs/xfs/xfs_error.c @@ -53,6 +53,7 @@ static unsigned int xfs_errortag_random_default[] = { XFS_RANDOM_FORCE_SCRUB_REPAIR, XFS_RANDOM_FORCE_SUMMARY_RECALC, XFS_RANDOM_IUNLINK_FALLBACK, + XFS_RANDOM_DELAYED_ATTR, }; struct xfs_errortag_attr { @@ -162,6 +163,7 @@ XFS_ERRORTAG_ATTR_RW(buf_lru_ref, XFS_ERRTAG_BUF_LRU_REF); XFS_ERRORTAG_ATTR_RW(force_repair, XFS_ERRTAG_FORCE_SCRUB_REPAIR); XFS_ERRORTAG_ATTR_RW(bad_summary, XFS_ERRTAG_FORCE_SUMMARY_RECALC); XFS_ERRORTAG_ATTR_RW(iunlink_fallback, XFS_ERRTAG_IUNLINK_FALLBACK); +XFS_ERRORTAG_ATTR_RW(delayed_attr, XFS_ERRTAG_DELAYED_ATTR); static struct attribute *xfs_errortag_attrs[] = { XFS_ERRORTAG_ATTR_LIST(noerror), @@ -199,6 +201,7 @@ static struct attribute *xfs_errortag_attrs[] = { XFS_ERRORTAG_ATTR_LIST(force_repair), XFS_ERRORTAG_ATTR_LIST(bad_summary), XFS_ERRORTAG_ATTR_LIST(iunlink_fallback), + XFS_ERRORTAG_ATTR_LIST(delayed_attr), NULL, };