From patchwork Tue Jul 27 06:18:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8404C43214 for ; Tue, 27 Jul 2021 06:19:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A989761131 for ; Tue, 27 Jul 2021 06:19:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235616AbhG0GTt (ORCPT ); Tue, 27 Jul 2021 02:19:49 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:23154 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235323AbhG0GTq (ORCPT ); Tue, 27 Jul 2021 02:19:46 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6I7sb006844 for ; Tue, 27 Jul 2021 06:19:47 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 : content-type : mime-version; s=corp-2021-07-09; bh=dMgTBZvovZyAossUjIP5PcShwGlzv1iisl+yEsc5p6w=; b=gmNt9PGhix0pAHfJ7obLfXHBm5ZnbT4eImqEoX7Q9ixwjW9SYORmjsomWjHy0ibeLwGX ceM0geWpdf/T7iNpFdbHMt4T12Gi/Rrz3XYOuohg8vU4PcGdT+PgWJAiO4F6SNrpQ6C8 QIP0qxDXbIZWtfacDQAlGJGfGV8w9QS5FSUV4KKf3P41Uoad7x+z9iIWgdvKWQIJPIwU YXu/Y9HY6vXkiu36wYdrTQy9eYnU9KRRbTFMddVNerd1Edfcg7zdReazg8IeZaK9XlhF mgd2N1t17BbE1w7IL9DNPl7pQi/tiPy7MtCSTIg35lc9+yohKEPatFZg9SjQt0Au17pa xA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=dMgTBZvovZyAossUjIP5PcShwGlzv1iisl+yEsc5p6w=; b=ZPO99uWC6+o623AbphJp5C0sWOWryS5OzdgzBUcq6ATheDTpS3/OQiq1KhIlY1gecgZQ tjwYSFxQdGIO4AwaKIRB5LG9S2gdw4WTayBB5bmmTyAy+6+xH9difz0qiYk9Kg7b6/4x 5UjkxQBXVy6v2+gFkwQ30y8l/2hMErzLtm55TUwTrk+3k9vB+V6KJ7PcYcdkRRvuhkPW RDPHmbzZgp7SclYPPwq6tQfEpDyGawmfhWiykXKz/hLAN+exuBm+hWeUXUuIL8uH5dfu /0u60d3jJV9V6d/4HCk+EnWnSJxhIHh9t6ZfXi9wI6UuJw1FUH/uoh2jztFh+fXI30cf aA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a2356gua0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:47 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6Eia6065026 for ; Tue, 27 Jul 2021 06:19:46 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by userp3020.oracle.com with ESMTP id 3a234uvntm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iDHAhX93h0GSN6T3xG3vatBs3QF9ildFBwh3SMxyo6psRmev6VN4YFJWt2+Gd/4NLLA63bGmoHaEqriPBk0voq09cwUODu5gCIX1ArSLImT7Fr1MCzfM/E/4SpJ2r1eWilV6H9Rhq9PRaax63izx+Eyrzo6ZGvV/kVuANzEhtuBPd1AgFwsR7rle17+yQ5D66Zocx2Xz4cTxNUANiZ6jmBTgaaBfjj9R7Z71Up3mB8VCk/LzEGqC73Cp3QXdg7GF0W8cCqkUdlB4ANW/HA4dk8+wvFZEjPdmrHXwIAKIuPsNQgPd5sjlhEJZWFGvUkPJad/+O05TABPrDPQS9C/uQw== 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-SenderADCheck; bh=dMgTBZvovZyAossUjIP5PcShwGlzv1iisl+yEsc5p6w=; b=MJdkNWIwyJZtEToBX0xEiFBBRpqxiZZSeHlhYGSngErkduocx5HM9rdg9rojm49qE/QnyZAHkAaiqlkTJ4t78wB/8pGFYiNuUvb5yEqpT6nJ0hj76j2sMknhoHOR+n4EqspOZdb3b4XROK5EeDxiXlvtt+tddYhTRvQ6Wgji9ffD8kg7QLsV+1S3lPOL5zuLSqxLKcaZDBbA2SVL4rAtreaYI14+uXA0+fIopAhgblNfqO+hVW3vNVlkmAUDrdz+JhyEFECN6j711v7NyKGTipMe/P2vfWme0qxSCHhvdwvai4QLc79GzpuB10k9YcRtUyjjcrEf4PlUZzrsyFhZ+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dMgTBZvovZyAossUjIP5PcShwGlzv1iisl+yEsc5p6w=; b=FVVz+aCYOfU3AeUjiDAkZMo+ZAR+o9dvQ4nrN4NLuZl4T/9Qfads3tZ6MraJ7xKCZbJlvkIJZxEI90Z/wBZ/wp7SgjjiqgEuuE+p+vNgU+qRqCF0xaIjgixvsQO3pFz13NtYNtK246Yatnrey2n3nlE5cyhpAC2afKaXSKvSgkw= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB3669.namprd10.prod.outlook.com (2603:10b6:a03:119::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17; Tue, 27 Jul 2021 06:19:39 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:39 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 01/27] xfsprogs: Reverse apply 72b97ea40d Date: Mon, 26 Jul 2021 23:18:38 -0700 Message-Id: <20210727061904.11084-2-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1d9fd56a-2a52-4a3c-7f05-08d950c683b8 X-MS-TrafficTypeDiagnostic: BYAPR10MB3669: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:644; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y9S4j/UnePv/qnxydZ88yMtvKYa8Qv0PHkMWGFCTuXwjJsIdO7+n7ee7t5NdXJr8LeK0+KnC8JJFkNoNgcADoRKcc0crHrCMoNmaMfn5I4w3EGUaFD10MwOkuC5PBctu6kir4fBBk8yfh1tSkKofBYJyUKbKPFkc8WZzL0RKjLsEb30INTje4fsm/YHpKkj6lcl0yoiAmMwg47LDTSRlrxK+Kndf/lI4rt+QejTBj1ExC2yYKv5ZRZZzgL7y5YwIVDKfqfkdZT4l8g6v7wIlcJQCGymyvIevrQeRBpkgSvQOO6BJd6+heI364aCOfxxjrH438e0aR5HKKR5zsaae+dt5T3kxFcusWCQVVDJ6/sGRraaXFAMk91E/q3fv/EOT2MOEWYTJyYJ8bvTLr1XV9yjXP+5BLrqJbFFFCZD++HKN1QWHqWI5GWtJvSgVbreuKfSHo3+BVl2ZQeYl1chcyozMUvEAECTxgKBBBcbRjKXZ7LfcFaWkntmDpdklwuodtBUTzoMh7cHc4i8pvjouLoYqKs+KxmtSeoo5JMy557TWQuf7Sc6xNdOPjWQsnyzEr6Jz7txudCW7uXL6zVVYljqQ8thkJYtn2ZRpzTFBgmR148NAYTQZ7vw3FO7AA4EawhsHWY3OQfSWkCd0eTP5OLIpXNxbVJiQyPr9TkPQQm+vTIHsIuCoGr07prd0wf0pe/3oc/QweJ78WbLR0+i2kw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(346002)(396003)(136003)(39860400002)(366004)(44832011)(478600001)(38100700002)(38350700002)(52116002)(2906002)(6486002)(186003)(6512007)(26005)(1076003)(8936002)(8676002)(83380400001)(6506007)(5660300002)(36756003)(6916009)(86362001)(956004)(2616005)(316002)(66556008)(66946007)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VkqhK+fPn2KcvsTXw/lfcb+PCn7ZRMYqYwrn3r28NhVZKlzXVUxCmooZD3eAEfIYmEfvfEHqoexDENaaw6Q2QQ0Zdj3pDMrCsbpWxZ2v8EUJf1VDqMsHQQqNlxKb3EhfZX3W5rRngageWF4hXSUErdf8PJDDkRRCbDvWuZktwCjcSGMLZiQ2WIYNEHFQqbx2v6Jugeb+dqzH6SxafkpU25SepeLfrtvlRVa7hhkl6PHkou6bf4AM+xFac5mcP/V/Imin6yN9PC1sIOxKzU36wyTxmPi2o6tubzWl3WAuKk9R7oAtAPc5ZmuCAkKcreEt8A0IGKg1GwaPfbv3dPqPlMFXkZRT1h5bymib7RAVGyR+P5ih38g8uCvFLPWtH0YKxnEpp/4LZeYlUiGoJ4Cw151Y2BJsRmV+yEixm5KI8v4xDf71d1sDdFVtrD7dGORWdUDyH9D3HwIVRmXJ6dElNz7TgIESNBAXAgh81Pi84ClTfwQPzQsc0/U9/WGl5KiUgv0ks1StbssNqoGIR+kgGESMiSDrUxUF4LZ33LJFlQstTWTVR53j40hJbkwFo3bl/1y3iqp7mMoRZnGdaqrraWEA7RU7aD25MVknCXsgRFGzPMm6zhpOnOuaXmRbM4sp2htNVbq2p/cl8ZREMpPYtMG6XHhR6KkKAocgiBEzWQf0kJBvXMc6FAnHX72iBUwP39YKnJIjNcp9sT96nffR8AuU3pxmkjZ9rlHsexeYHL7jb2mryGZRwE4KPvGECSC5Ewi3zSCKbyfRSN9RpXdmeq6Zg8/rW5IpzXm85Mw1mWwYJfWmweggRa07Rrdk4IBiyOxObsuqH1mK/t+5U1bJeu4aGUAO4S6VNOZagtMp/e3eGEl80bHi5bTKmN/mzMz/DGs2Wax3rQHT4kEPxWq4NJwdS/3KemxTi6WMlX27nr2icl8lT3yJbDsMPJKt1YrmOSytVURBCsbzVaUA9K5rRVhRvDSGx74xE0y/qSptPYcb5s2YBTFklfaqi9fDOKTnsaj+YONFmi2dtHneT2xiSftA5FO0CVRLXnm67VvkEPxC459urww3GfOKRB4YxO/iyodZfiMJbLsi5ApuEjm3wiOApqXIAY1riIBmLXxBSz9p1astLjupLQB4lNkeMan6dS2FR1GC445cwfQhJzACBBG6y8LCmm0FLItg9ka5x2+hdERQqReutuVthm1eJ19y5IyTYyJcXKJWozOMigYCYsWJQh5CpSN/ALhqcKxRBWoh5Ytbn08CFgdFH9f+I3rrs7qm2cx1s7grxqbM8hpTyMaw6HA9/eO18H6tgJe7redQ7WYxt/nm/8P3yu0AffQT X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d9fd56a-2a52-4a3c-7f05-08d950c683b8 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:39.5220 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tl2hwOD0O0mcKtQWX0oCVOiWSO1zg6cbl1l13b64pPvD5yTPJdLiNPiywKaEfExm2IWlrVaDx+QWI9He9LGFaTahn6p0Tlfn/l4Grap5g20= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3669 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-ORIG-GUID: BhmeVgSiuEOwcS9bUytuodW_Kzj8IblM X-Proofpoint-GUID: BhmeVgSiuEOwcS9bUytuodW_Kzj8IblM Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Originally we added this patch to help modularize the attr code in preparation for delayed attributes and the state machine it requires. However, later reviews found that this slightly alters the transaction handling as the helper function is ambiguous as to whether the transaction is diry or clean. This may cause a dirty transaction to be included in the next roll, where previously it had not. To preserve the existing code flow, we reverse apply this commit. Signed-off-by: Allison Henderson Reviewed-by: Brian Foster Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- libxfs/xfs_attr.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index dce7ded..1c60bdd 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -1214,24 +1214,6 @@ int xfs_attr_node_removename_setup( return 0; } -STATIC int -xfs_attr_node_remove_rmt( - struct xfs_da_args *args, - struct xfs_da_state *state) -{ - int error = 0; - - error = xfs_attr_rmtval_remove(args); - if (error) - return error; - - /* - * Refill the state structure with buffers, the prior calls released our - * buffers. - */ - return xfs_attr_refillstate(state); -} - /* * Remove a name from a B-tree attribute list. * @@ -1260,7 +1242,15 @@ xfs_attr_node_removename( * overflow the maximum size of a transaction and/or hit a deadlock. */ if (args->rmtblkno > 0) { - error = xfs_attr_node_remove_rmt(args, state); + error = xfs_attr_rmtval_remove(args); + if (error) + goto out; + + /* + * Refill the state structure with buffers, the prior calls + * released our buffers. + */ + error = xfs_attr_refillstate(state); if (error) goto out; } From patchwork Tue Jul 27 06:18:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401725 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B811C432BE for ; Tue, 27 Jul 2021 06:19:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A7D46112D for ; Tue, 27 Jul 2021 06:19:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235579AbhG0GTs (ORCPT ); Tue, 27 Jul 2021 02:19:48 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:23046 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235041AbhG0GTq (ORCPT ); Tue, 27 Jul 2021 02:19:46 -0400 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6HCDd010859 for ; Tue, 27 Jul 2021 06:19:47 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 : content-type : mime-version; s=corp-2021-07-09; bh=0z7D+hJkG3VQYeCB6JFZbrJtESfer7OF1K0RdKWEpPA=; b=Q/S67478ONtopNDzrJ3vClWrFblWocywQ8KjZbvzz739wtHEO9CgGY46Ab/GgInHscEN qugPbjJcG850a199r0s150rfo7ilOlHGtVFAoUqpSk7OjATyhWGM1k99njv8/9590N4q cjZ/lT/d62XfELxGBGz28spqqc6IY3zEpXHjxRz8CDe1qS6KjldO+MWJUWYzaLLg4go7 VTyONqdkRgIN/kbLBqDw4fWPqfCNi30LLJkMrA6n5ddOHBApHDqT259rlKEj+gAMqqF1 dV4PFvlx0nmwlb/W0JUtMBgEHgcuJg5ZR8H8DeodAZdXAfKI40azCtmclR3Oaos9cmm0 rw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=0z7D+hJkG3VQYeCB6JFZbrJtESfer7OF1K0RdKWEpPA=; b=JHoKbVSDCnZMvQssT5PovDhKFaOqkslHEvNOYBiG3kDRSyJTn41UjOty9rbiuJ4gFt4N M6TE22tXvePFuD8PJ+cPeO+E1b7b0fv7F0AUnMGk8GCAbMYncV9jwrbaaVkZHjYjP0Ol ozRw3XYQKj/orVvfg8BH/6wF1TfT3J2jKgpr0o+zvGXbvdZNhNEeLLAcAnR15HPWWeOt GXfKEX/02C54IPg2Fj5sRtfPVTyAlTBnJ2FL3sy0Bz41mTe8nSxk0JjPxElRziKJq+Fa YEjvPVuSGLqDeKxJehj2I1nowvrvmksBeld0smNT69gRtttoHDm/gRXeo9/37SgRTFlQ KQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a234w0v6a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:47 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6Eia5065026 for ; Tue, 27 Jul 2021 06:19:45 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by userp3020.oracle.com with ESMTP id 3a234uvnq3-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b3L11BFrxA9I43k8f/XrZg0B2fRglbewizbgo2QO1C3YMw4hu97P6aaKt9JrgBqs3/Q1745N26LnBbwxdSp3yYep9ZGfKGAI25kcOJy0DbRZnE2WVPSZ08FW+cselDKBcrPXSyY7p/crsaWhMv7GnFY2T8gl95KXN6VZYhgR6tvMwVbKOkHwyYxAClKXL0iEr9sSMYOOeV56u1Y4E57G/PTX7cGqF1OjUj2KW0FENiqHrDPdHWB2XS3k9jMoheUZB0v4VVcXuvDv9dSB98pTZ5pG/0VLD/M2wksVj/RvtN67nIF0tGhYhaAr6p78WMRtOqc6WyDcLynL5uZRU4Ijpw== 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-SenderADCheck; bh=0z7D+hJkG3VQYeCB6JFZbrJtESfer7OF1K0RdKWEpPA=; b=EWeS6K4KYwzHQ0Gr72Sq08XjGcEoau+eZn2tmd7DwVUolmrmNJ94UTV4c+EwkSQj1nY5SsocNtTA8sNRszBEk5pnbaUjfM91osIGqNkZ+7MAMfVkO796AACtSaKWoQDuArYaoLYXrdDH4cOZCdhprNQEShQ4+87fvGl27ez4k0jLXIk9wQJcD0X/rwELGlaDujQPeTySo7DMPB4ko4w5C1C3OPWeI2tfWvySWqAM/IDUaODTWHRwMrPPa0bH09C9bNju65qbYZEaKG8iLCRQSoTtGP+UMX79khb27H8rUsv6OOOzU1C3RcP/Dfr0dAGHOybQU6HBQK0q2yVD127ByQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0z7D+hJkG3VQYeCB6JFZbrJtESfer7OF1K0RdKWEpPA=; b=y1BpjpxsyURYEhxp70f0lU2wo59vcx4zb3bgrh00AiNwsjPyZHgjKZ5z7yCGeRaRzHtMroXGYMNsSJaJMKtOaSYAgoY+zGfnTn7HcIUUZ01lhm5s++ihYoHMwf319sPmm0cQFpXxbWV6zfjMt8ZdwJhOEwZg+kfNTpY5GXThtDU= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB3669.namprd10.prod.outlook.com (2603:10b6:a03:119::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17; Tue, 27 Jul 2021 06:19:40 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:40 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 02/27] xfsprogs: Add xfs_attr_node_remove_name Date: Mon, 26 Jul 2021 23:18:39 -0700 Message-Id: <20210727061904.11084-3-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c8c5c3e8-e026-4001-b87b-08d950c683f5 X-MS-TrafficTypeDiagnostic: BYAPR10MB3669: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:854; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v11K6RpIVK0tP1ZBibZA7C9BUUS/Astw9SR6RtnvP1Gg3F1epGX9vFDjJqSni/DftKUpk84PPK0HmqReQabcwySzzDZPCUTGfosmS5b4ioZ8BNsA8GVQTftb+KgqSh5mA8r5AOu76eu1x7/1In7OYigj/SoGj7Ytu+xLrcwnG4ocaZR6oPCOC1RD3Ql0BLcyZLo5H4tDG6UJ2n1zoPgunWPtAYygMgPVtLpYnbQ0A7XBPNT6GvPRZjbtG6k6EzYgL05VOJZ6QHTiLpvA0dNk2epNsaNM9gvABRFJ5urCsi23FIEhyJFMR/psD7f9gyvGfqq74jaZxBZFeZGX9hiufpHI/IuH+LdDrg4kbe6sf5Wdpfvuyq/+7SmfEgwmBjB+ie3uttO9fscD7+GGJVw+q3yEW5QgtErrQJxXPDLG490yidO/PbiWD54l/30tevpjGKBO2fhUxSzDYSdkO7OjDkXBsLOn1ayqwR8yMFDRXJKjNqNJH6592iZRspws7TTalZTvQhiH956PHkHUXAbggGxhoOh09s8zH5gb9sL3/v0LFCn6LYqTz+XWotGVWdx3CONOOFj8laOkYs9QDPa4/hefERpWM0erhoWwwX+budjrGtnPbkoPILKJSeWuAfMSYAy3aJ4p69Wih8GcQOfFwmrY10emVJbOupn1SLRsDtO2sgZvtIv8bN/8yfuFDQt84zY89XhjaL+iYn+61Yl/lQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(346002)(396003)(136003)(39860400002)(366004)(44832011)(478600001)(38100700002)(38350700002)(52116002)(2906002)(6486002)(186003)(6512007)(26005)(1076003)(8936002)(8676002)(83380400001)(6506007)(5660300002)(36756003)(6916009)(86362001)(956004)(2616005)(316002)(66556008)(66946007)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hPtRHrSPeHUxdkgVf+KeO6+1TQ7o58kZmoQOGFbN9bu68ud+aaLPwpcXVKmRmcSQwHlS3qUNQJdj79/30H7ptEPQYBtWpKPHVUCc2mI0A3+pWEAFqovdIrimeV1MX6DbhtVDGbrtvwU9VtEAi345RAVs52jI+yULjInq76CPCaGXY/h5qxjmR5hLdHTYZG5mnXPemKzjJyef7diJOelz+8XPA03n0qGzPCO7lnZFeO8Z+aF9zRIdVoKESpsUko+NGlcAMQXDEXMbVMJZzuOOKDB2GoVpROIplUmrF9mfgfURZyft5eW7FE8yJvcSYR6Oz8D8h7VM9l1dlvbqRlGrAeAUTZfZnRxhYeLVe7nyvoqU8XA9C9fLSqBGd2G1s5ZlehCWOITSaasQQz61wFVTYUs6/HDPgTkbDAycDG+/3o+cufDxZnPm/fUXBDjVcSRhR/ACE/w55tWZaq27KvCPBQb4AubamTK5RcWke7VoMOIFB/4GhuhAbpqPLlVmspnQKnlq4CJ32Jy8pf7SNwZo0C4lslfep6rGD/AnYspVjWAhQZF+m0Cn1RF4kK1kSbJVSodcmJbNkH3b37fLYrV8yFziHITsaU9kMgSM5ZyDg6ypsuTWIuhC9tpJ1a7UKlySI0TImuKvqZvI/pTCTf0prRJ8KoL73ZcNJAjRZE5+qHugKmdTtVJMPADdrkdPDifhRfuX60HY7ZdCaFrx8Az22s86oL70yUwTJhNnbzFT5xDgBUQht9XXIerAvSXvt3X3Fww30yqI6i6J+JvaGEZ3Zct9vZV0Ldd1NuErQHPSDSPHtIwamuSlUd+UXtXdTvBkwGidaiL9bqoVaaa1S0TCz1sytehzOn4eHBGDx3GJKTdqf3U+K5o8d8uXYUbV6P2uBdPXO2j+hg9CUdXgBh6rHTXiCDyWqe4bnVx80NURLs8zvnb+TfvAM+5dKbyfcXpykYDzKkTI/0X1phItoRmZGrqiWM9uFUPin2clZBMNFV9GPWbmAa2Qw/H8gJcd/qMqeZkWTygb1+HBgaPxmrTQ55Msc3VCstxcEK6uFYILm7MhfMe607dpwunsUmeNAImkz668qQHZ8C2cjZ5RO5/3oLo46nO91HZEKIei3HkZe8cc2zfOvhzqAgsQVZYxq07Gww6HV85CYLGr3PnMS+onWrqpzigswLCNnvDBx4NiiOEwIQRJ4Q1vuZB7C3/ULJkmI605zhUjNi8iZNNK5ppU8HBcIq1//ip38cNtwCMoyihObqaiP8aK+TnXpbwVWAuz/IITWSO2WTMOzv5H6g5DL9u8DHI6L+CwDIFmp/LzfcXoxmkpMt4Av01qQp9M5rhq X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8c5c3e8-e026-4001-b87b-08d950c683f5 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:39.9083 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7a3ZEsEDYOHi6cNdzbkXYFFO3OBcIPKC1guE0wO46LUCbHrEDQfg9HENrQ2Yv+yN8HS+bF/o7ZWH8QWTAQ9ITLN/bMITgAhgzxXeIwJZUPs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3669 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-ORIG-GUID: LJZHWTLj9AFuqWpGrCGfFhcxaMi_O4hN X-Proofpoint-GUID: LJZHWTLj9AFuqWpGrCGfFhcxaMi_O4hN Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Source kernel commit: 4078af18570ef0f89fce18e9ed9c1fa0c827f37b This patch pulls a new helper function xfs_attr_node_remove_name out of xfs_attr_node_remove_step. This helps to modularize xfs_attr_node_remove_step which will help make the delayed attribute code easier to follow Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Reviewed-by: Brian Foster --- libxfs/xfs_attr.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 1c60bdd..5da3ec3 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -1214,6 +1214,25 @@ int xfs_attr_node_removename_setup( return 0; } +STATIC int +xfs_attr_node_remove_name( + struct xfs_da_args *args, + struct xfs_da_state *state) +{ + struct xfs_da_state_blk *blk; + int retval; + + /* + * Remove the name and update the hashvals in the tree. + */ + blk = &state->path.blk[state->path.active-1]; + ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC); + retval = xfs_attr3_leaf_remove(blk->bp, args); + xfs_da3_fixhashpath(state, &state->path); + + return retval; +} + /* * Remove a name from a B-tree attribute list. * @@ -1226,7 +1245,6 @@ xfs_attr_node_removename( struct xfs_da_args *args) { struct xfs_da_state *state; - struct xfs_da_state_blk *blk; int retval, error; struct xfs_inode *dp = args->dp; @@ -1254,14 +1272,7 @@ xfs_attr_node_removename( if (error) goto out; } - - /* - * Remove the name and update the hashvals in the tree. - */ - blk = &state->path.blk[ state->path.active-1 ]; - ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC); - retval = xfs_attr3_leaf_remove(blk->bp, args); - xfs_da3_fixhashpath(state, &state->path); + retval = xfs_attr_node_remove_name(args, state); /* * Check to see if the tree needs to be collapsed. From patchwork Tue Jul 27 06:18:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401741 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED977C4320A for ; Tue, 27 Jul 2021 06:19:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D5E1861108 for ; Tue, 27 Jul 2021 06:19:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235518AbhG0GTz (ORCPT ); Tue, 27 Jul 2021 02:19:55 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:48454 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234905AbhG0GTs (ORCPT ); Tue, 27 Jul 2021 02:19:48 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6G8QL024358 for ; Tue, 27 Jul 2021 06:19:48 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 : content-type : mime-version; s=corp-2021-07-09; bh=L8+EUA5xLKHXKe5fsJI6RCdbvOoCYQ5a/PYwvMf19ew=; b=qD87eoWf5FZcUbshmXWg6w/BBFxKV0XX4Q1ETBQCDLGt1v0/pDvkinFaZOFOQNgwjUwl 2AvsUJUgukxohhDDhZVBT75akgtwnps55rSxdRNCTiDoBrUevV+a6s1G1FM5GTgm2YYl SIeb4c1++Tkw/lUVrGtkGbEPVOQLJP9hy8IkQXXO1AEfFy26AQc8hfGtztwfa4nQjjak ETh315/kiS+uklOJn1ABQG/XMwo61XxOCCBg2wnZ89YLzcm/u5rseJm75TS/BoPy/KY6 Ki6rhao16gp6ZBT64QSExySkYHNfXiYNzhK6Sg/3eXSA2blbO5N0hCs/UY4DOGiXGfxD RQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=L8+EUA5xLKHXKe5fsJI6RCdbvOoCYQ5a/PYwvMf19ew=; b=fmWIdqaGLElsrDe77fgPTqy4a/XA4JSPwl1qNdGA6DEywzawgw/m7jTBjjM9LwO2xMON pS4yZpbg8xNtBsheTLWGxud1WaaTR4yt643LDi4BSuF6VmpnmxI+Q7/KZ/QBQoBMwNnL Nul/eVk4p4MUXfCDret++GvS+Y0wyMjWNWyWn0h4WljNVvWsdhUH+j7KSKVLVfenzetH R8aaBDYc1ki5nU/YBK2D2z2ujsNHK5TEnvT5yPbYQ/WicO5XvoKxaHBZu4OwkgDESHgB t9GkPT2NBaslRnXhR/0SH1IuZQiRcrh1SBo4ZhGm/l4mnJBZ9BWh6vIMLONkkB0sFrJg xg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a235drun4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:48 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6Eia9065026 for ; Tue, 27 Jul 2021 06:19:47 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by userp3020.oracle.com with ESMTP id 3a234uvnq3-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GzDWMJwUUzYi4YIAgNytnaogD3m2yt0QCuRUOGiZ/BayuPTIauLK51E5ADwPqLv1okRzELVhaSvayJ5exSFElJ7oFDBTIVlM+B3gj94PiTPkNnecX2Ah28DIqbeWZGG5+CFSnnvZA9TF30/Ix66khhsiZbdbpwTiSms9jEbx7xgDNyG+cCPJu0arIZmVgaTZjPbs/Z0IdzAaDMdWPyaZoZ8OzZd8q07HOkdM9FXGzpsJCwfbVazeujT6GkVu+ngKbA3go62AjebxvmC7fNgWqGcnE2MmKOTSD86BYDddm42L8GyKfNNmfD8XkRKjnI7t0KU0bnN7m9qY3CfCWLVfQQ== 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-SenderADCheck; bh=L8+EUA5xLKHXKe5fsJI6RCdbvOoCYQ5a/PYwvMf19ew=; b=kWe7KLjneZYGk7oy9J2htGGfFU5yvos/a54GFgoxBs9+17Wopaj95Jbuum7Gqc05U0wFfaDN1uDY0nNhwZqFcsUsTDYOb7Rt0I/k3oAAnONnxMDR+w95Ago91rV0tbxn9tefyNz5NG1u3rPxFdZoHmf0CVW238X6PEwFiNEd1qMej+uXql49xbBiYT4kadYqF2x4MS2ZZZcEGRpfWZ4XtsG146DYQUudL1OslqCwtV0hz4n4XFAj15KpdqmTYa2cSKcbaRTdsf4/GdnDiFhvnDoSrEoDbvCjZQp067fnxgttdDO2vMq041uimp/YEpTZsz9dM2KfBZTdwFIiYXU+Tg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L8+EUA5xLKHXKe5fsJI6RCdbvOoCYQ5a/PYwvMf19ew=; b=IPZetPn7mLU3igY1eKMrEajeYaxkDeMd4Ott+1kgkZGWol2NeoMQ+slwiW6GjAR5VBthc3/DqJ7pHSIwRw+1mqyTQ0isU8r4uDkW9bkviJkua9GepmEiD6OXclD2hS47D+dgnAGc7y9J8hO1+cLRSHzQX3Wg9zIp8A3f2q/vKr4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB3669.namprd10.prod.outlook.com (2603:10b6:a03:119::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17; Tue, 27 Jul 2021 06:19:40 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:40 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 03/27] xfsprogs: Refactor xfs_attr_set_shortform Date: Mon, 26 Jul 2021 23:18:40 -0700 Message-Id: <20210727061904.11084-4-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4cb27b4f-50d0-49fc-c11e-08d950c6842f X-MS-TrafficTypeDiagnostic: BYAPR10MB3669: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qqWYlU97yLsjKjo4rWXHVk2QXYSPAXMuL1pJSvPzMA9SKLgISnKavckA0DhPflxd1RrS8va3TwomjiWds4S+LPYaMJsvdCISlc5MaAqYz75oBgo1BZoY9x9tg95nszLkSHLzCfyX325zeY6PObxPAUwC7+i4UEl0+J3Yq+jur+ijvZETn+xKEoqMnYBFk7AKZ9i4bFZuEUK8usrNqzyIk5x1jEn1Hiu/rFb3TiYVUbtgrsf2d/taTJCXWzQlmyGrxRwQSY8f6/MaOWemGJUjg8OwTMYeuZqQzFkB0OQDxeGgf+By8zI2iw5XKZ4xxYGVk7BmEfhvOBS9I8KqcwgrqRHCT8LgO+4XKX8Is3lSh0PbdiuL8ZBKkoYblXRORTwA8ApDk3NNrdxylqTi3KZGL4v7CnIOwGXClU/YskIQt3C1ZeMSmX88CyjLWzUvGlvlFobBZz6dKAJ2vZPbfMrIc86Q63CW+1x+6FVgUvG0ANcVOZgmm/Pba3FRYjyEqOPeW8ul6ItNk0uguoXO1ibyIjMekL8y/RQCLVdcNVqZMYePHHV9XRlxLBGrXp2QoglVSLT6dux9CfvX506NpRUntgSo3TpIWIt9K6ljm2inODpPTAHWyw9QTPgbjnvB6XMf99ByBygYCp2uYaHxVkDYBjVAVLj1DMjYljC1yTC0zGFnVZfwH8HHhmwqGtXni8jxiuKblF3ujLMEX5SOhILVeg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(346002)(396003)(136003)(39860400002)(366004)(44832011)(478600001)(38100700002)(38350700002)(52116002)(2906002)(6486002)(186003)(6512007)(26005)(1076003)(8936002)(8676002)(83380400001)(6506007)(5660300002)(36756003)(6916009)(86362001)(956004)(2616005)(316002)(66556008)(66946007)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BnevooII6JjX8vYsQVlfdgbkR7VXCTFHDGU8ExUmvM16qS2e3635yuemCSVT+XbNXmAL/FhZsAux8hc2bfZ3x8r29HnIcQ/+TIDXfdlUclt0wq7uG4VPwqRVJ7kI2mq6aFaSh4ln7XHOvi/QU7DnMZjY93bfAxHcJRlMbFTZbpdmWEjGx9bFkT0yvlTbo8gdYJamENYpyJmQ87BKCl2HPy2E8X0+Ms+DgVHcNnf3VXZ47AdaTd6WGpv17Idm5gYy8dv0iJ6JyrPzXn/PGXZTv8oSvjDdvsLd6UOhbpzNcO4vmmFYVppkQFktyBo5WEwNhgf86YxeQxpa7OwmQSbJvA7hSrqwq4CvedXyqmruXhhdgyT0qC41h67yfxvbZPlsR/chy4RBiA2cayBR8TsdYPq7+7rANVbcTHBsOWi1TtrZFzd/iS2aKiTuwgHCEPXFXg3xAsyEAPc7rC0EEFo7eAk4hqCMPud4ZghPrBrsKNEOLXGDhekkhaVplGsLdqWiBVq5zibJyxDySSUO7GQS45H7c39FG59stFuOUGK7/VJABf8hiOEwLoKKFbgspqR9JhuclSj72kkmeGt1abUrEJLqKcEDHn2VTYUul2bu125cDUoPKR1p+HhcRButQFy6XfT6CXSNrct3OPvbzaYSku/3xGhVsx5Si0HB8dZfHOMGk3OoCuEcnJxxKpuXfu23gw+oRGahGo8krnpT4SoOswrjg7wc1tvpKKkAIy4K7MaqqmC2DO5Pn+kHF1Grx1v9JcDgW6t1v0xy2CtpbZob9TNqM48VfU7IoawKCqY00BclfsFW6b5NIyxfgb9gDsyteDUSatIN9VO/gD6Z5czTB6sy5sowX04/gF9ZTU1gf9yRk5wfMQkECzi72jaAOy/6xR3tlSg8Zd6F0ka+q9lGbdgTTOSjjQYVGJ+zCq+yczsaZ2j9MsKmZCXu9NzCQuNrZKaVx/Mb3izP4M0qBnsz1VR9AjdXUXYvGcjRoTor2aAIFnIyOIlQQz8+FsFN4hXBANNiKdbjHUnUOTdhoEtFaz/vJBYcqGbdQdM3mSSQXmEXfBOQ2ne2YB20ENg49WOPmKLyDe4AaRt8jklJcv877WUmfwDCRMtNUC6zuaOZa4OyfkNtUNPgR3KgPkulFF1G1JY2VPOom8hy35ng3ZlJcMrrHG/CcuIqrNWthH38aTZhCGVJyndHu+qOo4c1NlvGjPwy93/4ADr+bJ52hCotP1ju5e6XR782DtErX9izyVLhy9y3MACOsQxd1t6AFbhNtAN0YaezJL+JZoec6vo+ZH5+Pj0CsC/76vU+FBfrFIzG08vRfnSo1G03bT4nPusA X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4cb27b4f-50d0-49fc-c11e-08d950c6842f X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:40.2817 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: S/mKRIq5UQdZN8XvHTASFa9qGuhf8iAobNoNugMa/OUEFXFlhs28cQUZ0OQzT5maqlDADvKsM9aJSAFp2rC0CJ3VtG9flQtREctMpIaJfhY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3669 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: 6zXBGzI5S5vRZtM3baqWH6ByMsmLcb-d X-Proofpoint-ORIG-GUID: 6zXBGzI5S5vRZtM3baqWH6ByMsmLcb-d Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This patch is actually the combination of patches from the previous version (v18). Initially patch 3 hoisted xfs_attr_set_shortform, and the next added the helper xfs_attr_set_fmt. xfs_attr_set_fmt is similar the old xfs_attr_set_shortform. It returns 0 when the attr has been set and no further action is needed. It returns -EAGAIN when shortform has been transformed to leaf, and the calling function should proceed the set the attr in leaf form. Signed-off-by: Allison Henderson Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R --- libxfs/xfs_attr.c | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 5da3ec3..b181777 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -236,16 +236,11 @@ xfs_attr_is_shortform( ip->i_afp->if_nextents == 0); } -/* - * Attempts to set an attr in shortform, or converts short form to leaf form if - * there is not enough room. If the attr is set, the transaction is committed - * and set to NULL. - */ STATIC int -xfs_attr_set_shortform( - struct xfs_da_args *args, - struct xfs_buf **leaf_bp) +xfs_attr_set_fmt( + struct xfs_da_args *args) { + struct xfs_buf *leaf_bp = NULL; struct xfs_inode *dp = args->dp; int error, error2 = 0; @@ -258,29 +253,29 @@ xfs_attr_set_shortform( args->trans = NULL; return error ? error : error2; } + /* * It won't fit in the shortform, transform to a leaf block. GROT: * another possible req'mt for a double-split btree op. */ - error = xfs_attr_shortform_to_leaf(args, leaf_bp); + error = xfs_attr_shortform_to_leaf(args, &leaf_bp); if (error) return error; /* * Prevent the leaf buffer from being unlocked so that a concurrent AIL * push cannot grab the half-baked leaf buffer and run into problems - * with the write verifier. Once we're done rolling the transaction we - * can release the hold and add the attr to the leaf. + * with the write verifier. */ - xfs_trans_bhold(args->trans, *leaf_bp); + xfs_trans_bhold(args->trans, leaf_bp); error = xfs_defer_finish(&args->trans); - xfs_trans_bhold_release(args->trans, *leaf_bp); + xfs_trans_bhold_release(args->trans, leaf_bp); if (error) { - xfs_trans_brelse(args->trans, *leaf_bp); + xfs_trans_brelse(args->trans, leaf_bp); return error; } - return 0; + return -EAGAIN; } /* @@ -291,8 +286,7 @@ xfs_attr_set_args( struct xfs_da_args *args) { struct xfs_inode *dp = args->dp; - struct xfs_buf *leaf_bp = NULL; - int error = 0; + int error; /* * If the attribute list is already in leaf format, jump straight to @@ -301,15 +295,8 @@ xfs_attr_set_args( * again. */ if (xfs_attr_is_shortform(dp)) { - - /* - * If the attr was successfully set in shortform, the - * transaction is committed and set to NULL. Otherwise, is it - * converted from shortform to leaf, and the transaction is - * retained. - */ - error = xfs_attr_set_shortform(args, &leaf_bp); - if (error || !args->trans) + error = xfs_attr_set_fmt(args); + if (error != -EAGAIN) return error; } @@ -344,8 +331,7 @@ xfs_attr_set_args( return error; } - error = xfs_attr_node_addname(args); - return error; + return xfs_attr_node_addname(args); } /* From patchwork Tue Jul 27 06:18:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401739 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97FC0C432BE for ; Tue, 27 Jul 2021 06:19:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8139061108 for ; Tue, 27 Jul 2021 06:19:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235577AbhG0GTy (ORCPT ); Tue, 27 Jul 2021 02:19:54 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:48492 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235518AbhG0GTs (ORCPT ); Tue, 27 Jul 2021 02:19:48 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6GunI007326 for ; Tue, 27 Jul 2021 06:19:48 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 : content-type : mime-version; s=corp-2021-07-09; bh=Q5cZHIv1JxVLMdOvbPHzJ7N9Uz6X4UGFXPn6qvS4coE=; b=NE8UoK5lqxZpdz7VX7BA3ODOaWwKvHuKJyJ6kXS8luLJeIbtPrhXd2/NS21BZId7iy8J UJVYGl7+ih4Ig9/6rAykUnFofnJfnAx01QlT5IBaDl8lU1NiNPZ6LcpiFGC6WPeHx/w+ VhARcA+bj1/lntRcmu1xUyuGCgtu8h2371+kiCvuQ1PxdnycGT9DIxfjA9UKXiJmfL55 vP3yYlRLQWb7zQql2AgTBoIPhWc98pMngoGoWgQ/YaBmW2MPPtan8czViggG5dQILYNu yJI9Dt6s0R/3c1ElmHkYPJD7APibO0tw0k+Ux8FCEVvDM0Nnx2ja7rRGy+diAv4cltpV 9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=Q5cZHIv1JxVLMdOvbPHzJ7N9Uz6X4UGFXPn6qvS4coE=; b=ROhO5ftaSd7rKxOGsgQiWbq6JoI5UvsBJblCUgdbqx3OY+FgjKy6h1Sx3T5swa4BF+n8 2m3jDtOZ1IMnOwDnaggl3Y5giZ2w7A5WhRF02MbGKNV573eBXly7bht87cG5KsgUmDey EkXzpxIqNasB82+OaSS5qSHyYlcRNZvYEKk2K9zufFfN8al0oktOWehuAT3ZxvLB04yl /0jFV5ful/FgXwOWEFP1wiclqKVXYiUgMo+Y2zE+sHbILP+rW418Tni7JEZkTkLEbW0g VdPBH8EBKuyMhMY4UXrwKyKADHWxU4W2QqCvkOTukmn/LTXNNGDNlTU9wqrOsJkJ1oEk Cw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a234n0uds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:48 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6Eia8065026 for ; Tue, 27 Jul 2021 06:19:47 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by userp3020.oracle.com with ESMTP id 3a234uvntm-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VeTN36RgsC0LGIP2nHKtug70/pvQ/kBnK2Ubon4A4U4uxIxDOzqnnEm5IlAmHXlBOYPZJPpNGo+3xS0N3/GOuA/DPBdZAY/nx935gUz+sWM+Q8YJ5GBS6/ZDCYYvGdKRXWNjSvoBUDohP8XYYJ0v6eK1IB8Ws0zlozbYE9z1jLoxaXvMNWqlgkOfuZnVWDpMI9RhrxXXvCAIuqT4J6tnJmvYVppFrNsAlhr8vIms/s0rDGy3PMJxz/xv70TABw5xc3006MpT3Ls7iEdebKARM41Nhn00P+ZWIJtQglnIrG8WtfpBEwGhjzy9fx43uGn7NdfpTk+ZxDT1DEi8S1QJmA== 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-SenderADCheck; bh=Q5cZHIv1JxVLMdOvbPHzJ7N9Uz6X4UGFXPn6qvS4coE=; b=FdEoDNFbaIrArdC614PfupuwmnFJK694Kkistrb971p8EBbUxAWSgS/oJjAUz+NJA8XNmTEcyGRyM664EVQG2c3rVCBv+f4nyKRzKYBNYvuapR4EvTwBo2TTiM7yqbZI9U9R+8UOsw8nN3QCCftldBxa+T7FW8JA/GCHSjX4hRUhgwXLkwdQYMIhmdyo7llZZjdRXSCMoPKS126AAJqRzOsgq3Wox2UVuHuwW727za1duTqR9OwajdnIUp2dt1U/iOrKuy7SL1D/kmnIj8zWRLromefRRF6eMT1Vvl+dbsGHelutNuTd3fa38PeGCU2oKRHwRsbMdeIhrGzprV3btw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q5cZHIv1JxVLMdOvbPHzJ7N9Uz6X4UGFXPn6qvS4coE=; b=mOnRPUlyWnhU5TZBP3RlK84HrGsQtCJBj1e5ltro1QoVoL1SAu8+2ky0ZDwxjQa+BepJN5N4rZvnIAtdYajX+2P6GMi7XC/Dbailkm27O74z+aJmawD600PLbvb4ajaX8Ef0ePhZMvL2E/0I4X3AqP4HwvuTZZHDTd05Wd3dn4U= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB3669.namprd10.prod.outlook.com (2603:10b6:a03:119::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17; Tue, 27 Jul 2021 06:19:40 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:40 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 04/27] xfsprogs: Separate xfs_attr_node_addname and xfs_attr_node_addname_clear_incomplete Date: Mon, 26 Jul 2021 23:18:41 -0700 Message-Id: <20210727061904.11084-5-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: abc5c6de-05d4-4b87-27e6-08d950c6846b X-MS-TrafficTypeDiagnostic: BYAPR10MB3669: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:330; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: trNgo7sYz6E+Y8lQ1++a7xncxOc/W92oFh+8Wf1cqA7SK5nRA/zfF0oEQMgY9gYjzvL7yMXwGlYrCK1ZXmHusk+qGEeKja0l7q5xkrIfX5tjRj5XloYzeIWv8lY72HFEZpAvV3bKVo3I8Oizo+Ot+CzasyDc3V5Y1vQEL55z76U3BW2WL9B3asKPIiGkq9QD7Tc/CsRN1UEcg3srckOptSz5x+SemOP2NIbgfCAWml/IBb/tSBgZyC1LopprviUqLyF7U8KxMFb6MD9LD2n9vImysGfBISuyjOAy+HdhLz4wCh4YyEgzRoebTOD8W7Hy0OXcl/69d7ZMpfS2F4/+KSfIEuF5wHF6eKxAF2fkyemDflEb4bFo7X2V260o8hetVYTu4zGm7RdEOH10P/ytv4iflXp0gStenjY+qOz9jdavxNOP8BynebIzSIyEY/LnKsBESR9iPNCAH1dEgfITUhTprOeps05ipVF8gDdnEwuNTWsh6LIlN9UzK8Tl4E3mrt4a9HVuKHvTC7bd3WWPbGDTOfGY9YmL7PukUXN8eBemJ9fEIZCQk1FYVY1XYMSj6AQ5RtqShnIyO5sjc/A3OtvLBzY4goG/U/BMD7dmmYn827w82t98TEyteivC8Qmc/0nUPFQvBcyhsA4DftIjGJ5hAqzAU7lPpxgU2q32SglEh+hAZ0QPRU8sFAcEdzjZs0XE/GvC3JO2hNty1WsV8g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(346002)(396003)(136003)(39860400002)(366004)(44832011)(478600001)(38100700002)(38350700002)(52116002)(2906002)(6486002)(186003)(6512007)(26005)(1076003)(8936002)(8676002)(6506007)(5660300002)(36756003)(6916009)(86362001)(956004)(2616005)(316002)(66556008)(66946007)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aC13if0lZcWqGS/IKz/96XWqehDIkrfuWKi7SA5G10ZQI9aPuT8dtnPJeW6D14KpbHiipTK1USNuLOHrvDNBhkiu0jDup6SBwdz+N4OlEt3KDfFp9qLJzb5kyKZWSS1oYV1aucMC7VP93OVU9ZMpwPoferZ5jhCmcGoW1zESuxiBYJj18tqFLO6uH+b5SroP9SQpL+zRd0Ta6xmHyEJhqsHPT/d6VdCb5UT7YLeQhACh2FkIUHsf0LUDlLDSnglupSz7Myvyn6GM+mZVd0hA+SWvI9Yhz+eMYX8uoTFJVQGuQwVU6C0gpoRPxrN13UER9MBSrMH8DhhEmG0bfaM0Sepo4fz2pptjLsyVXETEpo3qebvY6WLEPelzW8oCh6j8vJ50S4Zsg/3hcFZci7ouYlzmHX0W12qWhDgFcf6OWYUCAMMmOmWGDdL8ddMeO9P6EvRsoqDIBoyU2AYdwu62g52xQAx3f0Qj5o9TV8qo5xPYJbFc4BvHUGQ8ykaHo8+PgS/5opx2lGhwQrJ3ie7nfMnDbSjC1d8JFefxi1rsjST3W+nYWL9mAc6JWDLa2N4TSBuY2A7w/WO79HBFapXWt3yERiTGVdfWvb/u8lepIlQ/nzRZiMo+GkGDaaC6UMKq0XJ6fv5VGDhb0HiENuEiG+qIua7OFqbWVxF4rjqMicsQkFswHJSjt0YXJGzyzsDGsFSZCFUanKTvnHBgR2vuRi+zbT05NHQj9h9r4+meht1ZYg/+Rd8YBP4zrpwMlHJAV9cTntKgtuXJqPrkmG6eMLHpcQ7hMWXe0aWt+9xIjg4enI1mWrKp8cIYFvH5CRnNMcoYKBTEsj08t+dwjscvNAtT3SrhSX9kUu6BFl1qzGIs6HRk5wWnSwznvGcaVa3pHs4oa/YPErRD2UoY05lZoDCH1vM0Us9rx9veMLYyXJaOBGsZC0VriTlvA4ut1oUGd0fkM2hDHJjdUWbmqZq047kJxA4YOuOCxKB9Wf57M2kfl+A9L39balVuPPzqbBw3dqkdtrZry4d1egISwVWMpJkfMYjCZOh1HfIVogZldRVPQMvUQNYzq4LxCcZayVplF9LMScTn6UxKhTC4FaTUV+rz6ifEXVyVeYwwAJGJF5l/Wi/8H/jL/X9DoNc/WGhx9eITd0rDtPrtWWY2Ftbf3mClmKrT+k1QKyxN0gDbCjjf6jP3enS7yc+7V/Ciph6uMYdgAvCkVspM0bnK2Lgobx21Q1PRSnXJGPolNnHHzRutpdnIoBeK+a2dOKgmGo+Ok15vv6LflRAh/oLn/rUsnJoTGibHm0W/AWyO7p/1tj8a7OTPiJp+CXgkeGbqRCUm X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: abc5c6de-05d4-4b87-27e6-08d950c6846b X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:40.6670 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9vP4g6knOSKbSCCml29LNmWHGIfjmIJDnzkkDvEvpTrEDYDWSnCzp3KYXVp9Z8uncd+9CCcsEqkmEVk6fe8eUKmktP4YoXeJWA4G6fuNjIk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3669 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-ORIG-GUID: s0WSPMxibgnAQV_9AeQSD4hxSSLUl21C X-Proofpoint-GUID: s0WSPMxibgnAQV_9AeQSD4hxSSLUl21C Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Source kernel commit: 392a7ea8080e3753aa179d4daaa2ad413d0ff441 This patch separate xfs_attr_node_addname into two functions. This will help to make it easier to hoist parts of xfs_attr_node_addname that need state management Signed-off-by: Allison Henderson Reviewed-by: Brian Foster Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- libxfs/xfs_attr.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index b181777..158149a 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -54,6 +54,7 @@ STATIC int xfs_attr_leaf_hasname(struct xfs_da_args *args, struct xfs_buf **bp); STATIC int xfs_attr_node_get(xfs_da_args_t *args); STATIC int xfs_attr_node_addname(xfs_da_args_t *args); STATIC int xfs_attr_node_removename(xfs_da_args_t *args); +STATIC int xfs_attr_node_addname_clear_incomplete(struct xfs_da_args *args); STATIC int xfs_attr_node_hasname(xfs_da_args_t *args, struct xfs_da_state **state); STATIC int xfs_attr_fillstate(xfs_da_state_t *state); @@ -1073,6 +1074,28 @@ restart: return error; } + error = xfs_attr_node_addname_clear_incomplete(args); + if (error) + goto out; + retval = 0; +out: + if (state) + xfs_da_state_free(state); + if (error) + return error; + return retval; +} + + +STATIC int +xfs_attr_node_addname_clear_incomplete( + struct xfs_da_args *args) +{ + struct xfs_da_state *state = NULL; + struct xfs_da_state_blk *blk; + int retval = 0; + int error = 0; + /* * Re-find the "old" attribute entry after any split ops. The INCOMPLETE * flag means that we will find the "old" attr, not the "new" one. From patchwork Tue Jul 27 06:18:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401735 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F01DDC43216 for ; Tue, 27 Jul 2021 06:19:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D557B61107 for ; Tue, 27 Jul 2021 06:19:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235508AbhG0GTx (ORCPT ); Tue, 27 Jul 2021 02:19:53 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:24694 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235558AbhG0GTs (ORCPT ); Tue, 27 Jul 2021 02:19:48 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6G3ao022414 for ; Tue, 27 Jul 2021 06:19:49 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 : content-type : mime-version; s=corp-2021-07-09; bh=kR432GBfiR8VhtMwV+h8aDCBcKV5kPlaLIGN2Oc/t4M=; b=OcgVj5zK/qF2MiXCcKFh84LisbSI+V8jo10XOS/YStK36CqsvodlPIYYHyTycZFhsQfo GUZDkvJL+RWXuUEUCxIWL5tyRw+Y8X6zIBviUYMVg8ew5JJ3jymQWg2CdWoXd9JoXIb2 Ulf0FR3YU6j/33C5dkuYk1tbmgvcl1Hs1wkpqZlxF9PU/YHkEmaXQ/E1LaJ8qJMQ7SYD XwtOeN1/cjXxiBVqBPXe36ArW3F9w/i0LUSTJWIWtGn2cCNW+7y0He8MbCN7yzgSJmb+ XjRLH2UsPvLFC4ChYkhTM8OLV8K0VRm3YeSY7x16TPG8R7V77BXn9ZCJLFbQnkUBgkPn 0g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=kR432GBfiR8VhtMwV+h8aDCBcKV5kPlaLIGN2Oc/t4M=; b=saV/poR+8HAL3VqXpdLvxrnezwxonfmUQ763duxgTuKWt3ornT1L/JZvkPf/NmeCOVJa ZBm8wXP72iFJ1jNa8DHZ3oE0UL2xYp6D3/9EvrMReuJysH8QHnpOSpD8IKbwB+KNPBbg VQZDR/TvSHA/mBeKIOwjrrwInhLGLiF1gjiMConOI535S/Oid2jO7M2S1F+Y7hfECuL1 DOG8xg8Z/kOhF+SmYzCSyp81p/x7AK1MwCozA6rJpwMA2M+vgZQmEW/Q7D6rTbL6wo+m YMr5hMb8nq+SsdqjWk7vv4c8QnjD+NQyEmKUVlzSIl3RyE25hbTW7zxGNuF3Dc8z3cP1 vQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a23588umu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:48 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6EiaA065026 for ; Tue, 27 Jul 2021 06:19:47 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by userp3020.oracle.com with ESMTP id 3a234uvntm-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mVRhgSRnPz4eWcLjxF2EptVsM+WgI3VHEr4JIu3uepY6CWijGxy+xajkJkkA0nrU/OSJ8mZ0plTKhl2pMUs2bG1n/eXBQYDVJHP0Noi+oq/K8vCJL8YBKzvnPtU8Bf6D2YncPMjrvva/eEdEXRt7Hy+OwQofxpKjs+aogisIJstRSPOEv5A0aTRVCfl74rrKs417uvqnhd5YHthGlU4mzNn4qOypVUza9H2HguTK8Ta2JAsbXtZp7ABFGdv8vlYgayo1QJqhC22oHPNO4xCuZvOtwVuDD7XPjm7mp0WSqmPmP+L1VJDx+LP2crmkKZWhmD3pvV9J55d2cjGhrr0UlQ== 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-SenderADCheck; bh=kR432GBfiR8VhtMwV+h8aDCBcKV5kPlaLIGN2Oc/t4M=; b=XAhJAqt8QIiQkPoN8DpwwNBvsdyADfwUUJy7kbkaPHCOxO6RLGsBku4icCLfBPNdrzky2qXMQ0I4ogg1Akle6i+pfSGE9xu4gPPqrSKATf+4Nd9++3t2+6aGX4Dt038Prx0I3wKIG7f1SkhEo8lPilKbyZ+6K/xepdWXBeIDLhn6/29h7zj0Y1JB2as7pjEYv4FXBn20VXke/96duh9NPqFmAzA3i9kHFDAsKlFcQM0fc7EukY/d0uccCqoGRDfGoBRmJ38YMsl2rxKyz7YFPIUY8R6GEet7HYkjE2ghGRLqkxy/HYKfbBHCvpvMOGw6FSMux0VAvF6YSCYS8Ud+UA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kR432GBfiR8VhtMwV+h8aDCBcKV5kPlaLIGN2Oc/t4M=; b=swfj90dlRCBJUltjKAiYtcNRYugsIjaMtneOb67cv/Sm4sZVweVspo0rxxw2Bya/CS6GkJ7sS3wbQH6DuBaOq1t/y2Exjv5NLQPNczdqJPJYB2L9cf/ce02TSJrUrudAbPEb+TORTyq5TLDLcZKkFwXdpJHDSEfNgg1XdJyxFwo= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB3669.namprd10.prod.outlook.com (2603:10b6:a03:119::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17; Tue, 27 Jul 2021 06:19:41 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:41 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 05/27] xfsprogs: Add helper xfs_attr_node_addname_find_attr Date: Mon, 26 Jul 2021 23:18:42 -0700 Message-Id: <20210727061904.11084-6-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e93f8752-0ced-45d8-ffe1-08d950c684a1 X-MS-TrafficTypeDiagnostic: BYAPR10MB3669: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HQcSvDibb+JLIRRk/3nozR/slBbJl4VYbDOlS9yvhwZRQctWJvztEqk5DzB17Ug2VxYF1zhYm+aNKbvlU0LVzgki0TcSADGK1i0zhEEehuvD8wDFieQOFWszdB+rH+RV+cw0h5RMRFLrOOSnYGstro299pHUs6iGFkwM/u5PxP4MJ+gnVMqg/OqrG4TMuAhmo7/El9TA/g2zNFDQ3GxGw51JieIehyQnWdnsXxGl2NlyzjoK64GO58aU4X3ncW5t/LMomSo3vwni2gBLXr9+hYZ7AW+v2UHCAlna+O+OoKNIb+ktLutTH303jWlXQDE032KCsZ8GYkcdIbSX1N6Q5tXoHOPbD75hLuYm9OqYcssljpo4feQ4NZsZLynbaqkf0VSv+Drub9180fXMxSKhp0WmvNmK/rVAz+SEyDnS0NWYlbaGUdzZFfVFR0/tLseLU4k1sNIIlmRELnsdFTJCwIvaBNnwDQKs/qf7Fpc92HsDUbFG/HWxX0n+2Ntq0sfv0aA4+s1oj2B2bVOV3rsvtGZFqjsvrDb1OU2dmkz9l6AcdIG3JltxDsZHSBu6eyuYiwSNxG1N1y2xZGU8mb6kEhoGDNplz+TrlLite7/34RJH2OSAUAs1oVDnL95dMeHIVMe71p6eIUOItU7+MpBkuFGYcHCS6hLPcdTlz3jL1VimBDUazDDvSLdwae5Rfn/mymorEEkMncapuI4NpEogiQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(346002)(396003)(136003)(39860400002)(366004)(44832011)(478600001)(38100700002)(38350700002)(52116002)(2906002)(6486002)(186003)(6512007)(26005)(1076003)(8936002)(8676002)(83380400001)(6506007)(5660300002)(36756003)(6916009)(86362001)(956004)(2616005)(316002)(66556008)(66946007)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: V4BS01h6U66KnZWuiURoC5f3/G+o43p7OKG8g1EavcxJRTva8sMowjdUyRA3p5cm1zQzAuv4IMCXEnflcyxWNfTLX1IkfwZYD03Dg7/o5KTgrXOzDmnHul746x+RrKl5qJM0bS4pksfMDzaRA5f13ImZRjJ7d620CQzCAO8DpjIwkilmpzKjRIVbbEeCr7UquOW6PNMHN98OMqK6h2XFtn2ukwensSliWiOxJsGWtO8+IPB3g7ZkLVpfo+ewQ+wLqdszsvxaPkQ1uj0abZuGyYIfr6yMLVZ2R0dCmvARPgMjC7NBXXJTycEZv4/eA/QCwkkileTK2FXWgbxYmPd3T2avUbsK3zOXaEusczDUh9gbVQ8vz+Czr8PdeiiKPLSxMI7oFv8+P0kNK10owK04v5a1aSjrwnSh/aNcTwkMIJukj8KXeD4muyLM1Qj29kyB5e2pmRbphZk4c3HXGyos11PC7CG2vCoWH2wMrfX9+jH0+XiFTYe87YyNb+PwgMx3XV8kkqrxQAdDDLFE6CBq6oRVutq2QadN8plOtexbz5bFeUemxIJZEQW2zP+21CwvAd55yRzrrQQ62b0II4GKVLQx6DLUOap6Sn2Mbg4AeSidILNn/vw07jsDDV016+3x2dUQwWncQAfdMEwf2o49x5oAy9SdQZ5mFFR/j8WOS4VxwquhoK6JWdeHLZSaxMgSQZ7A7QpZXBl4G0Oe2KLjGz7k7jPZP4aOtmmqBObvu8NU0ZyuuvK8vE8Dl03YBca9R+lVpuJZoJvA1IIwPUYlohxRhyadyDVBbY5VwKVLJKZ/4xQ8V3dCwrDE8tszjjgigMaUBBi01BN5uRHBHO5hy4ex3ba1NDbpTruyO5Z+YN1SYH2pxXuERaIv67paCwkjSFm68Y2R9xtJdBPFSfXT651AqpYj3cQjur0H6yhHFae8Jjp5vs3qSWrHk8FO9bIgKEAgYwTFdvUbL/jOHGnnUcFiPeBsYSNqWBjOQLq7sS0vnZ5oddU7EEU9KVVx6l07O5ZYtrRgttiDOxY1vGKxTTwSlcFLtarNw5MtF91NVAbpBh0F19jYs/QVpl60RFGMjvGU5J+BBQy4x7XbK9CYCZ2g+aOhMRWnvoJuf8lH04QZDGpAbTZsAnoevRzrvqLY1/5O0GeFpwBecmB18f4T4/IunZ94xB8RhH2031VcDpFmIkHB8iMAloQ/iVwMSuySZBS7uzpomS7XKQhBd2i/76TONoFEx5xMYzjJ/7IUoo6B+zZlnqX6+0L6ncibf6tI8hU3cuiDM2oaQAgVZDMX6O1aw7/EY59YlrMocpqol+ML1KJTvDgwfYYeHGjZ3GL5 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e93f8752-0ced-45d8-ffe1-08d950c684a1 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:41.0981 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: P5QaQssLQfv3KA1PqhqB3J/HaOrzXKuhKxS/BkOiZNK///sQyNWKky0zFs/Mcejup5RYmdowwlrcMVXH1N8Exnjc3Uyju5I7aesJoJGIeyU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3669 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: nXcqZ6Qt43kKC9Z0oINlsZcY26sNNM5_ X-Proofpoint-ORIG-GUID: nXcqZ6Qt43kKC9Z0oINlsZcY26sNNM5_ Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Source kernel commit: 1aeec98c3f70bff14cc0e65ef898e91c2c554d41 This patch separates the first half of xfs_attr_node_addname into a helper function xfs_attr_node_addname_find_attr. It also replaces the restart goto with an EAGAIN return code driven by a loop in the calling function. This looks odd now, but will clean up nicly once we introduce the state machine. It will also enable hoisting the last state out of xfs_attr_node_addname with out having to plumb in a "done" parameter to know if we need to move to the next state or not. Signed-off-by: Allison Henderson Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R --- libxfs/xfs_attr.c | 87 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 33 deletions(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 158149a..32a51d5 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -52,7 +52,10 @@ STATIC int xfs_attr_leaf_hasname(struct xfs_da_args *args, struct xfs_buf **bp); * Internal routines when attribute list is more than one block. */ STATIC int xfs_attr_node_get(xfs_da_args_t *args); -STATIC int xfs_attr_node_addname(xfs_da_args_t *args); +STATIC int xfs_attr_node_addname(struct xfs_da_args *args, + struct xfs_da_state *state); +STATIC int xfs_attr_node_addname_find_attr(struct xfs_da_args *args, + struct xfs_da_state **state); STATIC int xfs_attr_node_removename(xfs_da_args_t *args); STATIC int xfs_attr_node_addname_clear_incomplete(struct xfs_da_args *args); STATIC int xfs_attr_node_hasname(xfs_da_args_t *args, @@ -287,6 +290,7 @@ xfs_attr_set_args( struct xfs_da_args *args) { struct xfs_inode *dp = args->dp; + struct xfs_da_state *state; int error; /* @@ -332,7 +336,14 @@ xfs_attr_set_args( return error; } - return xfs_attr_node_addname(args); + do { + error = xfs_attr_node_addname_find_attr(args, &state); + if (error) + return error; + error = xfs_attr_node_addname(args, state); + } while (error == -EAGAIN); + + return error; } /* @@ -896,48 +907,26 @@ xfs_attr_node_hasname( * External routines when attribute list size > geo->blksize *========================================================================*/ -/* - * Add a name to a Btree-format attribute list. - * - * This will involve walking down the Btree, and may involve splitting - * leaf nodes and even splitting intermediate nodes up to and including - * the root node (a special case of an intermediate node). - * - * "Remote" attribute values confuse the issue and atomic rename operations - * add a whole extra layer of confusion on top of that. - */ STATIC int -xfs_attr_node_addname( - struct xfs_da_args *args) +xfs_attr_node_addname_find_attr( + struct xfs_da_args *args, + struct xfs_da_state **state) { - struct xfs_da_state *state; - struct xfs_da_state_blk *blk; - struct xfs_inode *dp; - int retval, error; - - trace_xfs_attr_node_addname(args); + int retval; /* - * Fill in bucket of arguments/results/context to carry around. - */ - dp = args->dp; -restart: - /* * Search to see if name already exists, and get back a pointer * to where it should go. */ - error = 0; - retval = xfs_attr_node_hasname(args, &state); + retval = xfs_attr_node_hasname(args, state); if (retval != -ENOATTR && retval != -EEXIST) - goto out; + goto error; - blk = &state->path.blk[ state->path.active-1 ]; - ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC); if (retval == -ENOATTR && (args->attr_flags & XATTR_REPLACE)) - goto out; + goto error; if (retval == -EEXIST) { if (args->attr_flags & XATTR_CREATE) - goto out; + goto error; trace_xfs_attr_node_replace(args); @@ -955,6 +944,38 @@ restart: args->rmtvaluelen = 0; } + return 0; +error: + if (*state) + xfs_da_state_free(*state); + return retval; +} + +/* + * Add a name to a Btree-format attribute list. + * + * This will involve walking down the Btree, and may involve splitting + * leaf nodes and even splitting intermediate nodes up to and including + * the root node (a special case of an intermediate node). + * + * "Remote" attribute values confuse the issue and atomic rename operations + * add a whole extra layer of confusion on top of that. + */ +STATIC int +xfs_attr_node_addname( + struct xfs_da_args *args, + struct xfs_da_state *state) +{ + struct xfs_da_state_blk *blk; + struct xfs_inode *dp; + int retval, error; + + trace_xfs_attr_node_addname(args); + + dp = args->dp; + blk = &state->path.blk[state->path.active-1]; + ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC); + retval = xfs_attr3_leaf_add(blk->bp, state->args); if (retval == -ENOSPC) { if (state->path.active == 1) { @@ -980,7 +1001,7 @@ restart: if (error) goto out; - goto restart; + return -EAGAIN; } /* From patchwork Tue Jul 27 06:18:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401737 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B69BC4338F for ; Tue, 27 Jul 2021 06:19:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E72261107 for ; Tue, 27 Jul 2021 06:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235558AbhG0GTx (ORCPT ); Tue, 27 Jul 2021 02:19:53 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:24764 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235577AbhG0GTs (ORCPT ); Tue, 27 Jul 2021 02:19:48 -0400 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6HBM5010846 for ; Tue, 27 Jul 2021 06:19:49 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 : content-type : mime-version; s=corp-2021-07-09; bh=rpWqdKX7FAN7lNEZ3/WcL1Fs+hjp3kaQvdLlSuyjE58=; b=KiCcuXWtF16NrBw1NRmXpJIp+rjngYNAzjom3WyMMIOqbemrUEHulmDCuNbznxtbhNOJ YuXsfH/MaRwtTfGGRn46nNc6hpS+GDo8JCbaAx7+fv48aj7Orfagm/o7TTSppLFLrdMj L+iYjILF9uUjCYRkU+xb58RvUsFI00pvQRNoQZWu7AkovQDyegVQppY0cLVByTNSLl0F ZnEPj+iIuCJCBQkBq9oouDSnlmF6kuzJtRypcsqju/bfoii1DY5qR0CL+EmM66EoqLjq RdpJR/+ba6KnUgVgoHq3XQ0d7+HRXZt+/pUMEg3CHtQhPL8FU2OVcvsJMsJLDH+mHgq1 bQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=rpWqdKX7FAN7lNEZ3/WcL1Fs+hjp3kaQvdLlSuyjE58=; b=RuWNFyBBAcAUnPDlRi5LcTEL+A9LA+owon9PUw9MIibUdBWrsF5q+wYuR0U1BQJaxmlx FMJfk44nE6VfsTEZMx0AYAljyDWabdfQhPEKLsVntVl0Theha6bAdnhSd+mCzAS4Ughv D5iZWCOoUuGgar6woRwADjQrM+KTtBg4T5u8uelGqBWmyLkNZfTK94hK2//k03j4NFRo GCsgKdbYOkbiZOfy4/Bmz200yyyi/1fDyBFuRplpl9v193KQwEfO3nsieyMczBm5akey eH2NxHNgMwjWaWDF0LukrFc8FTDk6qpibGUJP0ynIK2hZF3iQ15Ax0sEuMjTnC9dCQeT bg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a234w0v6b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:49 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6EiaB065026 for ; Tue, 27 Jul 2021 06:19:47 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by userp3020.oracle.com with ESMTP id 3a234uvnq3-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EmgwiHLu2OxBOznbDKsYU2edd6e7j1JZ1xMiiSAL9MCIbdGUKRwVjU7fDmdJQ1Fcy38kmwdRhqsK9D+v7Iqxi5wwOeRg5C7OqzcQ3ef98EdAzW2Y4Me4623M/FBkPf3wCkcrZDVtIhMoDlukk+7HCz7V7xb6Iaq38arZQpkMsopFeXcEz2zMEBf47JcQYYJLeDfK27FAtLnt26aLyF2tfPN24B+4m1w3G/PmlHPCio7iAtLpgFTMy//sI3jUNvs68cCeDJL6zQdPS1yw429X+sPoIdYFYXlymSsqmjEP+P9xeVTT9xveTQ969kpyqEkQFagawElONkUNu+CR1nXttQ== 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-SenderADCheck; bh=rpWqdKX7FAN7lNEZ3/WcL1Fs+hjp3kaQvdLlSuyjE58=; b=jN0pNqMICgBGee7/FTrLZovw5CKXtpSOvCkrKY4j70oq4GA8TJiSAQomlVzi2UfV+DT+OlhmDBsMAOuhpaWLE8e2pAIRQqAGA0C2aTBatdxcZjIsJUP5Uv50x6qU4QwW9wGuDuz/p0eyHEx4biOhFkgizVE/EG/2XML5JtW7mNNKlidFBrHaAASghtVQZmLi/F5YwlHbmBlV/OaaURl/SqKmvoUT2WUXBFLAU5HJzeIHyXy/ZXtEbX19hfxGmCRG+TONruQBDjC0Okp3Ik1ssRcPu6DQuH5v1NTLornU8lgPHZvQPMDphX2nCKxuJ4qvVanQ8ppDl61QRBAXrhNX1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rpWqdKX7FAN7lNEZ3/WcL1Fs+hjp3kaQvdLlSuyjE58=; b=BRcBR7hE++f5WOq2VFDCW+eJVHZPy40V9dd+HwTqlUDBmeU/FlzymW5l2JIdrZLhdLzf0Fl9icowwuIfcBZNsxaZ6koGXUk9SQHGOY5+YteTokfTjG07KG9ejg/stlcJa1psl95hyCuKZ4d6ZFWx3OD2NXwBPrWZTkdfFiF1fAc= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB3669.namprd10.prod.outlook.com (2603:10b6:a03:119::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17; Tue, 27 Jul 2021 06:19:41 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:41 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 06/27] xfsprogs: Hoist xfs_attr_node_addname Date: Mon, 26 Jul 2021 23:18:43 -0700 Message-Id: <20210727061904.11084-7-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ad2ca846-ebe7-43e3-4a01-08d950c684ec X-MS-TrafficTypeDiagnostic: BYAPR10MB3669: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2657; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LsyMZ8Kk3+O6fX/W5R4vchWUUKsHBUy7YVmL/UmVzodo+n80RoyuJmnhXDu+z4VXTZhF/Y2r0n15g6VevhCz2T4y8gvKTdNfi+MLD6dXFuPVIQmTLgY5h8gRQ+S97neKIRlw3q8LgoOdW9scg4jRiom2QItVihTmE/GP+c9B8GItJYS/8D60QEKSubIyafm3mu+0DqAMJsvpDizMTcirTAG5sMNdWAL4jc4qtHBbbrELW6Yi3Eke447622JJSoyxkzjYsPB7kEytbS164D7A5R1ZNAx7JV9IMXJYDczgadAnCy8k9o13I1CfkJrQce/wjBXOysG+rI+MHg/SHE/OUqgO5oZBBP/7L8jgMSqLCrpKIc7HHZ+Mc7BJjizlguOaTszELU6hNXmeKOpmMMoO9tgvOAu/JVZ3Tj7d0bcLttcjx92yrI1Hk786VvWUGqAkmI5DLrNOXwTWN0p+F5OzHMjFYAIwTpLvHQpDfTvTZt/qpFpK+TnbwiPKSLPYNAh6L5rK8UItN2jeM4b/l3S8D/nAsyt80RUq/r0G6NOsJ4ILhOVPEqJ3Xqvl+QzG5HCGq3BXvNUXoAMDzvk8XHl6ubdSX23woDjCC8QY/p44mAfKpOkvwaSbUGgZZC/XYdCPNqbIRjhtO/0YT68Ni732lgafY53dk4BASB1tEos1RhZhieKeRohwXjjk6lkD48h2kv/iVqgk43Tfhb+ztOeS2g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(346002)(396003)(136003)(39860400002)(366004)(44832011)(478600001)(38100700002)(38350700002)(52116002)(2906002)(6486002)(186003)(6512007)(26005)(1076003)(8936002)(8676002)(83380400001)(6506007)(5660300002)(36756003)(6916009)(86362001)(956004)(2616005)(316002)(66556008)(66946007)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sTJPo88cHy11dhsy3FC8jMvmBW5N8laxVu1zfvj7sBD/Y59rSICcyLSeS218d29pU3Ot24xYfk4Ov6JIIaIQ8wDx3pYwOmmA9bP0lmPinVVvbimnhW9oCDBU+qCX5lFLWjznuoJozVvMQvXm9xKympQSCu+viGEtd1J8Hd/dfZ3oVvF1usC7y7Bs2ND6f27qNt9wvzliKTAltQIMOWQnWR5poJEl7K/icqpmfDvnpAUiwKMaUbtyive9ANfwCVu/b1C48jbnm5kWBLcRWyH58cwGwe2A8ml5eoW27TbSCS4UwKD2I8ymQ0KUiVTsu0L4LajEYhma0Ls12hwu4IaqNIjqYzDVclx9t7uzcayx98yoLwAHSzGtm3CgJ7qixW8XeZX6p1WMAK8naZCcl+URcKGNJW5v3R7as/dotnLDVhyiXBm5Gaqb3zATjThhbyXLKCUWtRnpX9UPXSuSC1I4Q17aEY+jGfXNuy2cE8igzeiD1JXxPZhvHiQP/nYDUMEn0EZ/4aKn7b/IibkPyRMwxBC/HtUcERpHqRrpvxoq6FRFK4SuYM+b5zsIXwlS6T13nuyU0G6OGPbUyzus3gR2+8r8hfadlD24HYNXMjk/XRBSUCpQ7F0oRs974H2g/hiZmtYtIfQHIT2jeq430NqcyBiXoQ8NrXEhjglyp6XEtmrJa9bUY/UTcqI5aR7Lb6CQ7ReoH/li4T+bfayLSgmV/c8i3sPzNC9DwzROhVZWVOlVeOVNkEdKbL0Xc4gAigGs6djJc1LjLiASbYLRmE5Ke/wQZuBIHDk1slIrknQvCXtb2nl1+IrVxkkfycxV32DagLk6iSI6pi55rvTxuq18dCOnTPk2+SvMM2zBsvMbBkGzdl50Jzt0H4jVf00vrLN2koxH2835QwvS2HV4ZqrqrlgIwXGiPtuFVmrsrDvGzFwCLkU43ROup/qyyboS/UNXVs0DT/s5DHXPg2iUNSMoDyrhBavjEn4+ASWQrQpgdvkpoIdCrcE0kjv6+2ud5PL2LgIrI4Lf0foEuMfX+CN0gFvn5CxgkhAdFzXoLV5XmlEppIa/8bDAyN7GLmBSLI0kBaLqqsWD84frifZwJjgmSk/G0MvgXQTeVfa3NDP1MK/NVNSJhCka63WTCdDaKcrLpiOUoH+k6gZNcTqSSakNVywWp7tCckol3JEz9h9uacNHHkcRaiUl3JvIhiAfw8H++4Gvdz+S2XvcQoOyQPOnNQpTV2diF3NZS+pKSybm7UK5M6nua7MZjYVnThlHzF+6ct8ikdya3+CzWfj/HW7lZN6loSRFXMkS08rcW271JySHEbVfqff5VxGCwulPNVmr X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad2ca846-ebe7-43e3-4a01-08d950c684ec X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:41.5242 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Rkqfeg9sTo4MkXpjFv44qiVO+EjFTh2Vvg6rK/XPY1ZDIDEnDmBtxuOTKuKUQGfnaJHJqlXA+q+qpgUm127tFoOKd5Dftd62syhx8nIf3nU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3669 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-ORIG-GUID: JoPCiPkTgCYZXO37heU8wWZPaVVX7h_a X-Proofpoint-GUID: JoPCiPkTgCYZXO37heU8wWZPaVVX7h_a Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Source kernel commit: 8e7db2a154cf8889319a4d6e5f987998ed21fa1b This patch hoists the later half of xfs_attr_node_addname into the calling function. We do this because it is this area that will need the most state management, and we want to keep such code in the same scope as much as possible Signed-off-by: Allison Henderson Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R --- libxfs/xfs_attr.c | 159 ++++++++++++++++++++++++++---------------------------- 1 file changed, 75 insertions(+), 84 deletions(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 32a51d5..16e919d 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -52,6 +52,7 @@ STATIC int xfs_attr_leaf_hasname(struct xfs_da_args *args, struct xfs_buf **bp); * Internal routines when attribute list is more than one block. */ STATIC int xfs_attr_node_get(xfs_da_args_t *args); +STATIC void xfs_attr_restore_rmt_blk(struct xfs_da_args *args); STATIC int xfs_attr_node_addname(struct xfs_da_args *args, struct xfs_da_state *state); STATIC int xfs_attr_node_addname_find_attr(struct xfs_da_args *args, @@ -290,8 +291,8 @@ xfs_attr_set_args( struct xfs_da_args *args) { struct xfs_inode *dp = args->dp; - struct xfs_da_state *state; - int error; + struct xfs_da_state *state = NULL; + int error = 0; /* * If the attribute list is already in leaf format, jump straight to @@ -342,7 +343,75 @@ xfs_attr_set_args( return error; error = xfs_attr_node_addname(args, state); } while (error == -EAGAIN); + if (error) + return error; + /* + * Commit the leaf addition or btree split and start the next + * trans in the chain. + */ + error = xfs_trans_roll_inode(&args->trans, dp); + if (error) + goto out; + + /* + * If there was an out-of-line value, allocate the blocks we + * identified for its storage and copy the value. This is done + * after we create the attribute so that we don't overflow the + * maximum size of a transaction and/or hit a deadlock. + */ + if (args->rmtblkno > 0) { + error = xfs_attr_rmtval_set(args); + if (error) + return error; + } + + if (!(args->op_flags & XFS_DA_OP_RENAME)) { + /* + * Added a "remote" value, just clear the incomplete flag. + */ + if (args->rmtblkno > 0) + error = xfs_attr3_leaf_clearflag(args); + goto out; + } + + /* + * If this is an atomic rename operation, we must "flip" the incomplete + * flags on the "new" and "old" attribute/value pairs so that one + * disappears and one appears atomically. Then we must remove the "old" + * attribute/value pair. + * + * In a separate transaction, set the incomplete flag on the "old" attr + * and clear the incomplete flag on the "new" attr. + */ + error = xfs_attr3_leaf_flipflags(args); + if (error) + goto out; + /* + * Commit the flag value change and start the next trans in series + */ + error = xfs_trans_roll_inode(&args->trans, args->dp); + if (error) + goto out; + + /* + * Dismantle the "old" attribute/value pair by removing a "remote" value + * (if it exists). + */ + xfs_attr_restore_rmt_blk(args); + + if (args->rmtblkno) { + error = xfs_attr_rmtval_invalidate(args); + if (error) + return error; + + error = xfs_attr_rmtval_remove(args); + if (error) + return error; + } + + error = xfs_attr_node_addname_clear_incomplete(args); +out: return error; } @@ -968,7 +1037,7 @@ xfs_attr_node_addname( { struct xfs_da_state_blk *blk; struct xfs_inode *dp; - int retval, error; + int error; trace_xfs_attr_node_addname(args); @@ -976,8 +1045,8 @@ xfs_attr_node_addname( blk = &state->path.blk[state->path.active-1]; ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC); - retval = xfs_attr3_leaf_add(blk->bp, state->args); - if (retval == -ENOSPC) { + error = xfs_attr3_leaf_add(blk->bp, state->args); + if (error == -ENOSPC) { if (state->path.active == 1) { /* * Its really a single leaf node, but it had @@ -1023,88 +1092,10 @@ xfs_attr_node_addname( xfs_da3_fixhashpath(state, &state->path); } - /* - * Kill the state structure, we're done with it and need to - * allow the buffers to come back later. - */ - xfs_da_state_free(state); - state = NULL; - - /* - * Commit the leaf addition or btree split and start the next - * trans in the chain. - */ - error = xfs_trans_roll_inode(&args->trans, dp); - if (error) - goto out; - - /* - * If there was an out-of-line value, allocate the blocks we - * identified for its storage and copy the value. This is done - * after we create the attribute so that we don't overflow the - * maximum size of a transaction and/or hit a deadlock. - */ - if (args->rmtblkno > 0) { - error = xfs_attr_rmtval_set(args); - if (error) - return error; - } - - if (!(args->op_flags & XFS_DA_OP_RENAME)) { - /* - * Added a "remote" value, just clear the incomplete flag. - */ - if (args->rmtblkno > 0) - error = xfs_attr3_leaf_clearflag(args); - retval = error; - goto out; - } - - /* - * If this is an atomic rename operation, we must "flip" the incomplete - * flags on the "new" and "old" attribute/value pairs so that one - * disappears and one appears atomically. Then we must remove the "old" - * attribute/value pair. - * - * In a separate transaction, set the incomplete flag on the "old" attr - * and clear the incomplete flag on the "new" attr. - */ - error = xfs_attr3_leaf_flipflags(args); - if (error) - goto out; - /* - * Commit the flag value change and start the next trans in series - */ - error = xfs_trans_roll_inode(&args->trans, args->dp); - if (error) - goto out; - - /* - * Dismantle the "old" attribute/value pair by removing a "remote" value - * (if it exists). - */ - xfs_attr_restore_rmt_blk(args); - - if (args->rmtblkno) { - error = xfs_attr_rmtval_invalidate(args); - if (error) - return error; - - error = xfs_attr_rmtval_remove(args); - if (error) - return error; - } - - error = xfs_attr_node_addname_clear_incomplete(args); - if (error) - goto out; - retval = 0; out: if (state) xfs_da_state_free(state); - if (error) - return error; - return retval; + return error; } From patchwork Tue Jul 27 06:18:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401745 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A538C4338F for ; Tue, 27 Jul 2021 06:19:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 480B5610A0 for ; Tue, 27 Jul 2021 06:19:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234905AbhG0GT5 (ORCPT ); Tue, 27 Jul 2021 02:19:57 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:25072 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235612AbhG0GTt (ORCPT ); Tue, 27 Jul 2021 02:19:49 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6G3X0022411 for ; Tue, 27 Jul 2021 06:19:49 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 : content-type : mime-version; s=corp-2021-07-09; bh=clLrO3wURWOpYHZifA6fowdWRQQ3mgCpRSj9coAlpws=; b=ieJt49HRryWO1N6avHIxzW28brYRLSoQwwW/W056Ra+80lGuou1Hy0WNGzVXU7WET+j0 WnZtOD8lLTY0NH+Xh/zq1GpbW1zVFDUt6siZeK6pZT6lMliYU07g0Gk+N6iStDGM+T0U nlVWeYoOEFzWfzS+J9Z5dkl7+gWWHiLBqrG4EG+fMQK1kbf3d3cCHZ006xVjnHo3DY2N D77dZBLSDudjVxjeWCuAJIMFanyds0WjM5A/XSYR4swtuoCrFTAXc8CZFziveq27AT/q 8YpLRuQx0mIIItfYjZo2bY+PzvoISglEEhyez/jGdavcqq2QKMueMxOW6uXUF6dpwc6e NA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=clLrO3wURWOpYHZifA6fowdWRQQ3mgCpRSj9coAlpws=; b=AVBr23dAcSK9suY/3N9kNGd0AxDgvtYpcdt02gTRBnPa3hVbxiS3ML1a7eudh3/ZI350 CwhPYPw2G6JnPtK/8f9t1Hrwznvbg0+r3chPU0ho4nLHPAk02xkzEVJad2IRXY0KmsRe vgrjnXQsvpbpziiN0LhJXXjbvq0QvTy2mSgMnjCj9wmU6DBBV5unTfrl2FkYda/BZvnm wxQwICMJbswFHd2WJYyCSJYwjWRSd9RK0q94EfZQ9Ug4KSg8ctIcUeeMdK7EmGL9eL2S uReYib59BnVieiuABVpyBZwlpc5h/2VD1HushHAkdQ2baCOus2RIQBUDtOiCy+KyEA1M qA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a23588umv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:49 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6EiaC065026 for ; Tue, 27 Jul 2021 06:19:48 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by userp3020.oracle.com with ESMTP id 3a234uvntm-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mZ+aJ2tHigSlaSjth9nlrDC0l1/41aj0dRH+hP/tQCOZvw2IZjyAhLKW4EAgXDPOMyJJi9mfXtflTpR0ffBf/z4vWxvLZeeUKlYv+2AV7PafWZiq+ikdVz7OX6EgXN1wcocW2Q5rHCy8VxW34vY0RumtgcTNrWdGK7N17s1n3n9HvxlOkrdkkQQyjfPZTLunqFZPZfOLdJfQabRPXGOSl81SnPiX/V5B0PXt/l3l4yFOIXqcj7mPH2/a+nEPG0NQXJrCd+Mv/bYGXXgI77OBOOpRtj+y3AnCydtqWvaCGv7My29UAZZ2AscFTHNG/9pO4Rs62X0cEpsCEAC6ePsrVA== 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-SenderADCheck; bh=clLrO3wURWOpYHZifA6fowdWRQQ3mgCpRSj9coAlpws=; b=PPJJ+3WVIgGE/d6NjquIpkEPAMQKSKsYLSonAlSogddl5wejADt/iV58NdN4Fj1e096kmXA8Gv4InfcRnbilSOJDbjY7C8ERfbu7M6MbCTWBxYrpwMCJqs4cXGi207sQV4yZNQ+pMVr7INlpg9Gr89t+AdMuxmddvmJjhwIT19iQKZPZBmOkQ/6PIXWzhDbgVpMN3nCLZeCQaIO/m0aCsRrI1HPhdq0OdjHWS0rEtUtWX64wybzRyMJ8IZ/3p80Ib8QDlvvgfEzIA0c3DxZRb8dglMsRB2pTBaHTtq9qwu4l7hrtjQjrtLCN1FukGXPAvv6w8N1rzpx5+SF5bsbUHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=clLrO3wURWOpYHZifA6fowdWRQQ3mgCpRSj9coAlpws=; b=poSrP5yMA/AsqSPrfvO84qw37Es6DQaqcP2iyrb2WmotNFI+Ps0IZBxDAHhROgq+j9206loiKd5O8eYeujTvXMYCnuN54lUqTKop/jgfBObQbe+xdfQGohgu3Y3v8rNxMHm3wh5VKZIA+nJfHs0i9L0GDjtBL+IzgoCd2XF2oR4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB3669.namprd10.prod.outlook.com (2603:10b6:a03:119::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17; Tue, 27 Jul 2021 06:19:41 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:41 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 07/27] xfsprogs: Hoist xfs_attr_leaf_addname Date: Mon, 26 Jul 2021 23:18:44 -0700 Message-Id: <20210727061904.11084-8-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 34d21b5d-1162-482d-903a-08d950c68525 X-MS-TrafficTypeDiagnostic: BYAPR10MB3669: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wlFWZ9MJO8iC9PKlx7QyDd+G2HlfoacR6+XbW3RMaPC64uWxjuCU5CkZjAzS2lq+yGsa8I2ovfThqwxvV8mSIQfXovxkjR7JdTyAGyVOmngPHA9MZ515bFSxkRJ6eIRBDJWhdt3NZ9rhBGxoU1848eMJNlxJ4btvTLnvG6i6g+cSAoeI7ub2MlLEiQSmYfmmpz6InGkh3yq8cSQ9CHUaYO9tcOWZw3SF/78qEX9+o2O2x1QLiz6TIQ2ksS8Bc+YstEI7pSvA4yBKrgf7fU9tVfe3SRvoK09tcuRRJYkBRGljOkXDqVlnAW+Yp5LWwB/Uc6toz/0Io12gbd+cGO+qbpIBnjChLivo/vrfMozvz2AaB7G6PRpynbaT/cF4WWRag88IjP9lTGkCy+OvJ/jAwaaVRvhQQ8fw57S6lanQ8GZfHAhLVAKkqHlem+a3Vs2fvTgmywOBhG2YIIKahE36FWfj0vqSd1cI2VbYU4VyKrmiKmIYVll6AR7JkEFa6VSy5VlYPuHMC67IGFW+dq1Y+LgPcdjIthfQh9IKytPSribVMZ1Hxb7hKpFrN8YtPFXYJh1hs+Nag/RPzqfffR1mc/KysCQwazIrpDMsu+GcckmBl1OOxfWLc2LH2no97VFDY9ecjp4/mPagfGoK5IJxUA8dvpDi6qDwQyRk1i4Vr4ovGKB4Qu+w1uf5QXljvVTP X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(346002)(396003)(136003)(39860400002)(366004)(44832011)(478600001)(38100700002)(38350700002)(52116002)(2906002)(6486002)(186003)(6512007)(26005)(1076003)(8936002)(8676002)(83380400001)(6506007)(5660300002)(36756003)(6916009)(86362001)(956004)(2616005)(316002)(66556008)(66946007)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XE75LDZGEjNkEdNiVIbRlQ6oW8WugWWM7jm36Bfg98ArXGsgKK2CUcyMNbqTOsF82R9I/Eo1ZX5tuJ3rriZxukzD9p7Vyj47GnEnxKWyar1ryDJ2V/wbKQ9PUCXbNvWtZQuLtKRbVznj94TbfPRkGrSzjbJgtNCzDXdO2uOln8qlbCVJfrkndbqoRWDGDsy1a0/xkREBUQ1M6Pa7ry/nyFM/KJFLed1uj64OEF5MkRy49OLFgaUiz0HEqMkOHBD/A/oqsAd+6jZxobL578+mWg7UQlL+Lje4I7C8PD5rryOd2zgG34JDL9Uk9lhS9ZRmxFRFQVqCfo1nC25UfnyLA5sjAn1sNwpeYNK1zXvtzcPVpaOuwRZWyEs45s0q+eB23Odx8oRCmpvwNJNe52M59B/VCGh681oNGghO9VpMw/iorIhWBOYC6tbWwGqjhRdUnbFfnhl7zSkQZYjaKDASTvmeooUbKapPU8q1rxMJAzIZxbcG3i2S2jbJFBu25timOQOQVKOjehh6GCDX+qDQ5NBEWTZCHxhZm6lD5R65UHjq9lFmEBD1hSO8mOFwK5q41xc1GxmzW+0RrnBS/RUr6OaHotpH1TbV8N44cOkth8p/BtXm/CoIPHgZt4KmzcWLbYsRjtSASXAUh/9RsOuQtKYEhfKZH4A9QZAhfyVsZ/oMcG3TvajVGN9YFpKIiPOrVOiAR1OYCWvTaWkmNkVT0X0M2QRaLP7k3J06f4xy+lYmi4WrNGPrXBxVuftLW33+XiPX7LyT+7K5PRz0imC9LoXfTGzi3hJ72qUjdvzYlTrzskA7DahTE09ObEAfYp5Dmdwi7AxwvslVherF3snr8azNacMt60VBf48pOAo2MI+QnFCai0dQSMbSa2kocO9Doculikrvb/C9SaELaxtYrzWYED3qHfgM61RNVKP5LBM+NWIIrWSyn696/AkOorUIntkKxFqYEilqlXkgnDNtDlPrpYEXEX34IWRxX8Th3kjXff020jyF+xp46zhXwGdCh4yNZho96KxxpTcjCaiwqKKzvIwZvpUpkmnbTz3BJXaJf7JFuQb3HyiclmmTG7s99J9X5OzdnE3VEKHBTcsFn6iD4o4ADCEVUHxCbcdODctkZs5asPh4mmRnQIAtgnjPSLrP97ZdtFih/lKn2PtOn/OrZtiNnLnokuEm24aJPLkutgRt/wKZ0brPzRTyIl66QJAHYwtt2ehw9l3RgQRfwXODBudp0fLpzTHukeJlFeh15RFGIq4nvKz1XirLQ9b/8gYrcqPYI1ZAxMQCxsLcj6tuAO+H3rxzeEXgM85VKD9XXp1POiJ9bLUmffdoABP8 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 34d21b5d-1162-482d-903a-08d950c68525 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:41.8727 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1NweGSls3O/Jai9BxM9FRO63hMAZrLgyal5HC/aH6zeryGYTdTAvWiMzaOo+k6NR8l815ccatZpP0LHAJqaYar+XorSmOhoVONKiNCY/UbM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3669 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: YdaNm7zKUI4ngBAqbKBcUILR9kOe-5kD X-Proofpoint-ORIG-GUID: YdaNm7zKUI4ngBAqbKBcUILR9kOe-5kD Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Source kernel commit: 45adc55591f5d91b9b6c7752fa4253bf3de33886 This patch hoists xfs_attr_leaf_addname into the calling function. The goal being to get all the code that will require state management into the same scope. This isn't particularly aesthetic right away, but it is a preliminary step to merging in the state machine code. Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Brian Foster --- include/xfs_trace.h | 1 - libxfs/xfs_attr.c | 209 ++++++++++++++++++++++++---------------------------- 2 files changed, 96 insertions(+), 114 deletions(-) diff --git a/include/xfs_trace.h b/include/xfs_trace.h index a100263..fa4d38d 100644 --- a/include/xfs_trace.h +++ b/include/xfs_trace.h @@ -148,7 +148,6 @@ #define trace_xfs_attr_leaf_flipflags(a) ((void) 0) #define trace_xfs_attr_sf_addname(a) ((void) 0) -#define trace_xfs_attr_leaf_addname(a) ((void) 0) #define trace_xfs_attr_leaf_replace(a) ((void) 0) #define trace_xfs_attr_leaf_removename(a) ((void) 0) #define trace_xfs_attr_leaf_get(a) ((void) 0) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 16e919d..9dc518a 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -44,9 +44,9 @@ STATIC int xfs_attr_shortform_addname(xfs_da_args_t *args); * Internal routines when attribute list is one block. */ STATIC int xfs_attr_leaf_get(xfs_da_args_t *args); -STATIC int xfs_attr_leaf_addname(xfs_da_args_t *args); STATIC int xfs_attr_leaf_removename(xfs_da_args_t *args); STATIC int xfs_attr_leaf_hasname(struct xfs_da_args *args, struct xfs_buf **bp); +STATIC int xfs_attr_leaf_try_add(struct xfs_da_args *args, struct xfs_buf *bp); /* * Internal routines when attribute list is more than one block. @@ -291,8 +291,9 @@ xfs_attr_set_args( struct xfs_da_args *args) { struct xfs_inode *dp = args->dp; + struct xfs_buf *bp = NULL; struct xfs_da_state *state = NULL; - int error = 0; + int forkoff, error = 0; /* * If the attribute list is already in leaf format, jump straight to @@ -307,10 +308,101 @@ xfs_attr_set_args( } if (xfs_attr_is_leaf(dp)) { - error = xfs_attr_leaf_addname(args); - if (error != -ENOSPC) + error = xfs_attr_leaf_try_add(args, bp); + if (error == -ENOSPC) + goto node; + else if (error) + return error; + + /* + * Commit the transaction that added the attr name so that + * later routines can manage their own transactions. + */ + error = xfs_trans_roll_inode(&args->trans, dp); + if (error) + return error; + + /* + * If there was an out-of-line value, allocate the blocks we + * identified for its storage and copy the value. This is done + * after we create the attribute so that we don't overflow the + * maximum size of a transaction and/or hit a deadlock. + */ + if (args->rmtblkno > 0) { + error = xfs_attr_rmtval_set(args); + if (error) + return error; + } + + if (!(args->op_flags & XFS_DA_OP_RENAME)) { + /* + * Added a "remote" value, just clear the incomplete + *flag. + */ + if (args->rmtblkno > 0) + error = xfs_attr3_leaf_clearflag(args); + + return error; + } + + /* + * If this is an atomic rename operation, we must "flip" the + * incomplete flags on the "new" and "old" attribute/value pairs + * so that one disappears and one appears atomically. Then we + * must remove the "old" attribute/value pair. + * + * In a separate transaction, set the incomplete flag on the + * "old" attr and clear the incomplete flag on the "new" attr. + */ + + error = xfs_attr3_leaf_flipflags(args); + if (error) + return error; + /* + * Commit the flag value change and start the next trans in + * series. + */ + error = xfs_trans_roll_inode(&args->trans, args->dp); + if (error) + return error; + + /* + * Dismantle the "old" attribute/value pair by removing a + * "remote" value (if it exists). + */ + xfs_attr_restore_rmt_blk(args); + + if (args->rmtblkno) { + error = xfs_attr_rmtval_invalidate(args); + if (error) + return error; + + error = xfs_attr_rmtval_remove(args); + if (error) + return error; + } + + /* + * Read in the block containing the "old" attr, then remove the + * "old" attr from that block (neat, huh!) + */ + error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, + &bp); + if (error) return error; + xfs_attr3_leaf_remove(bp, args); + + /* + * If the result is small enough, shrink it all into the inode. + */ + forkoff = xfs_attr_shortform_allfit(bp, dp); + if (forkoff) + error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); + /* bp is gone due to xfs_da_shrink_inode */ + + return error; +node: /* * Promote the attribute list to the Btree format. */ @@ -737,115 +829,6 @@ out_brelse: return retval; } - -/* - * Add a name to the leaf attribute list structure - * - * This leaf block cannot have a "remote" value, we only call this routine - * if bmap_one_block() says there is only one block (ie: no remote blks). - */ -STATIC int -xfs_attr_leaf_addname( - struct xfs_da_args *args) -{ - int error, forkoff; - struct xfs_buf *bp = NULL; - struct xfs_inode *dp = args->dp; - - trace_xfs_attr_leaf_addname(args); - - error = xfs_attr_leaf_try_add(args, bp); - if (error) - return error; - - /* - * Commit the transaction that added the attr name so that - * later routines can manage their own transactions. - */ - error = xfs_trans_roll_inode(&args->trans, dp); - if (error) - return error; - - /* - * If there was an out-of-line value, allocate the blocks we - * identified for its storage and copy the value. This is done - * after we create the attribute so that we don't overflow the - * maximum size of a transaction and/or hit a deadlock. - */ - if (args->rmtblkno > 0) { - error = xfs_attr_rmtval_set(args); - if (error) - return error; - } - - if (!(args->op_flags & XFS_DA_OP_RENAME)) { - /* - * Added a "remote" value, just clear the incomplete flag. - */ - if (args->rmtblkno > 0) - error = xfs_attr3_leaf_clearflag(args); - - return error; - } - - /* - * If this is an atomic rename operation, we must "flip" the incomplete - * flags on the "new" and "old" attribute/value pairs so that one - * disappears and one appears atomically. Then we must remove the "old" - * attribute/value pair. - * - * In a separate transaction, set the incomplete flag on the "old" attr - * and clear the incomplete flag on the "new" attr. - */ - - error = xfs_attr3_leaf_flipflags(args); - if (error) - return error; - /* - * Commit the flag value change and start the next trans in series. - */ - error = xfs_trans_roll_inode(&args->trans, args->dp); - if (error) - return error; - - /* - * Dismantle the "old" attribute/value pair by removing a "remote" value - * (if it exists). - */ - xfs_attr_restore_rmt_blk(args); - - if (args->rmtblkno) { - error = xfs_attr_rmtval_invalidate(args); - if (error) - return error; - - error = xfs_attr_rmtval_remove(args); - if (error) - return error; - } - - /* - * Read in the block containing the "old" attr, then remove the "old" - * attr from that block (neat, huh!) - */ - error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, - &bp); - if (error) - return error; - - xfs_attr3_leaf_remove(bp, args); - - /* - * If the result is small enough, shrink it all into the inode. - */ - forkoff = xfs_attr_shortform_allfit(bp, dp); - if (forkoff) - error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); - /* bp is gone due to xfs_da_shrink_inode */ - - return error; -} - /* * Return EEXIST if attr is found, or ENOATTR if not */ From patchwork Tue Jul 27 06:18:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401743 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CADFBC4320E for ; Tue, 27 Jul 2021 06:19:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B318F6112D for ; Tue, 27 Jul 2021 06:19:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235612AbhG0GT5 (ORCPT ); Tue, 27 Jul 2021 02:19:57 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:25176 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235633AbhG0GTt (ORCPT ); Tue, 27 Jul 2021 02:19:49 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6I7sc006844 for ; Tue, 27 Jul 2021 06:19:50 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 : content-type : mime-version; s=corp-2021-07-09; bh=Q0j5pzsgrDkHleG5pEz3Q/LNmgqROB6NBUlhiNDmDpg=; b=gHkPhcel08rAA73N630kVFSRthEllFaz1Tg41DMFKtHzbIm9qondIIKwF/S1Q/nyynM5 Ut2gyfGW/2EgmmHrh4klCw6wf5uJ0/Y8gfuS/9L0hI+BwiN+NId8Kkv9L8mNUvgvtHo3 /5gyY1lQEKlk++PaW0Ve3Bm8h3MOyEx17C4cRZCs3kkQHe1TN36ReBO7tb98C7BwCocx +5OkYei4EIdyajhvZ+biCndXNgxNXCE3/Ed3je9pgOaGQXr+gTaG0J5RcfoQy/axxj03 OBvB3SsAFSahNbUVFQYuJSUv98RLCmo45OM3zysV7e7+sZTf+GAiuCACzBYFK7D7jp92 kQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=Q0j5pzsgrDkHleG5pEz3Q/LNmgqROB6NBUlhiNDmDpg=; b=CQfopK2b7+0jzaJb8hEjOw7RumdBvm9OeZXhAfJhGFP/A9sQEFffpg9+H5kozx+7mvQg bP2TGQPv+ojlQ1lB1LbwxcTeFA6kz2B6+Ka5vQwxKmZ1/yVCQhrzzbKbqW3tjOH+sgIX x/Vb75thdd+12J4LY3vT6VQjuODWfjOkc56A4Su1bZijDWuW8NLCTQis5sOTJfEOOAZ4 nOEn3p9wWtaFizHt0RGcI+aBxv827y9LgXOc3kqM9b5Plkw3lxYXEI2rmQD22b+3AImO jyzK2Oouu1Bl+XQvvkHoz4BmKUvvyMQcYR1L5d89zYwrW7l5y39kZol2y9m18yGD7WK0 Qg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a2356gua2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:49 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6EiaD065026 for ; Tue, 27 Jul 2021 06:19:48 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by userp3020.oracle.com with ESMTP id 3a234uvnq3-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BvcjvJAVsbKWDuknKdj7rCc8iUHzri3JZelshalHaMXaKMGpRVCsgGbnJJGmeeiVpPKHHnD2hU3+95R6isCp3QY/3FH6WN0puINUrXJkLU2lszNTvG8WLTRZE6PJfYVTDCdEtAmDMCL1clxu0o9TgJ3M94RF/S6ZKcvca1YV0loccD5HD9vreDzXNyL+hP5RM8Qg67cmr1V2tzSPAq1u8TdzC51q02Q0J4tDpYhajxaMLcVq0NQsc38qmT6g8JS/8jQI7cE5D8PfxVMWeSEntXslcTRjW9lnQBTcNODzeeYmdL3/iKXjoPgi2OAdb0+lkfTsSkdCfdtgh9W0HTlVdw== 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-SenderADCheck; bh=Q0j5pzsgrDkHleG5pEz3Q/LNmgqROB6NBUlhiNDmDpg=; b=ipvq++XtbeWNrjjqiLOgoahmgLUEh5rkPCD835j7Zpdo+ZQW8iIsrVmFqa6jwlqxc0h1dWa4MYE+Vy7CPc72NYFj8uCbR3UHgXHIHgFSyrETG3PFt58GuzxC2xQP7sSJcyKoBtu35HY+cAsUzCackwPYEMXaIbSuXib5MDDTyMamodIKUHmBRWtW0++GdEnVnaZkQsWJAY2Roy0T0troZSu6Huq5QIEE63mNTNNukuV7bIQ1rXrGs1DBHxtB4zo06HcsX8UMuj1DptwS2VQRFrbTfnzNE8h3su1QxPMYYimbTlrZCtT6e4enI0QuIXAthgcAl6jYdQLm+xbL+R0I3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q0j5pzsgrDkHleG5pEz3Q/LNmgqROB6NBUlhiNDmDpg=; b=SbqxxMeUxnaDX2KXpZpYx9pvSRtKyt+nA/G41K/lxjqO/QLPkzxAG6EYs5Mjft0VTL6nVIQRyIFR+HxeAb8jxH7oGcEGHRGpG5z+5MV4YVfy/IogbxQKVTMKKd7YvYijT23mfPYfxwRPpTtQa7BLGFowQyQk2eSKEj438FX0x4o= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB3669.namprd10.prod.outlook.com (2603:10b6:a03:119::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17; Tue, 27 Jul 2021 06:19:42 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:42 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 08/27] xfsprogs: Hoist node transaction handling Date: Mon, 26 Jul 2021 23:18:45 -0700 Message-Id: <20210727061904.11084-9-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 85c74f59-b0ce-42e0-c63a-08d950c6855d X-MS-TrafficTypeDiagnostic: BYAPR10MB3669: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1060; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9iTUwDaJtajnnEIbNePlZpvffwcoCmngqbImDmISFER58qxBdq0m1MXr3wOJHFpZANO3KYDgyr/eyvflqBQl2KuCCNBm5VUYqFq9UP9ezDJCwMfU4Id9qWT1MJjqcG2DfScu1IzDFLgcImzRAep/au436e/UjxsTKazEZMkl8BHrUt1zcjjdvOlpQLkx61WvwfPE9dFQ+SBA1Y2dcj5g1wPdal9Fxq8U174a2cI0RzpFSu6g0c4XNRWdVL0aXspsg3HOKqC4g0HsU4Ew+J4j0KL4N2IiYR5v1eW3ZBQ6Do0LHQcDagKFTQbOvyIf7i/CExlJacn72zqwB5mAjtHuBiDi9jSJT9XE4vOIegn5ZwoAZVwGpifnfmEzD4AcMwX0A+Kf3T69dwRwygmCe6C1MlpWafDYaYNPJUDhBuXU2ZTmqchkd6rEAg2N2HbfzlxyH0WV6uH8sBUqHTinh+sD1MVYwTJ+OO8lcpYUqOEzqD22pLDtcJ6UWCd8PlW9LnhDA28UHi9XhsDAp2/IyhIk8EctOjOQJVBHuZN4q6Kqqec/f3iQU++ao+1XB7Q5WgpyrVVi3JN73eMQ0qkrp3QG64M3NLPPKyGsoPiB5cRXV4QiJp0LhKIX8q6JLVQQaeO2xUxpbu8PxUsIrjFNOkAvLodS3/ZkgRNuy28VECb6vbjOFwnmRGAXZDzghD3lc2XNbAHTR/Vw9jjORes74nZnTQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(346002)(396003)(136003)(39860400002)(366004)(44832011)(478600001)(38100700002)(38350700002)(52116002)(2906002)(6486002)(186003)(6512007)(26005)(1076003)(8936002)(8676002)(83380400001)(6506007)(5660300002)(36756003)(6916009)(86362001)(956004)(2616005)(316002)(66556008)(66946007)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kWNEKEKt9Z2Dlu5F9v5hL8Sz0W7eQyjejrgZ7W9qMAEQEKuG8LwSCiZf9WzfIgjb2NJKt1kT7/XrKfZFopG6vEsroo2YvWkbITygfV49jcewQl09eaLeupW05tZ07mDMm9TPl5MOy8kb30qRvFhNd5+RQufttmvsLpmplgnZpoUSM4NUHJAwkuTfC7kqxMz5yiumrEO279osEv7RpKdP5qtGuFfbPwnxLwQGFOOCtyaLf6V+targ7ke9x7eDLMSyFIz277hqI/ZNuIJIae5YZCsF1Pc+hD7ZFPPGAzvFP6fKboJq/MAMXmH7gL/FpRGI0ZjH1juxziJIPANpbjYDPnKJmU2+S1dBNqh1ouSJAzBnEZyj+AMSY05tKpJ6SsoMiveFA0o54oUBWFhYDOwMGsinjbEpKEjex/EPzd0lTpfKWJPx5/4l1S2CqfYwjVAPLhZ3xE0tsYLoYAQVWj5P/RCn2zTVy0U7F/wKK9eoRwjc+ubtCKieOfy5kgttNsLgQUDytdKazV8Mj5XToNpsKgAF2KoP+Gx+UQWrXW30vfnc7LQ5oY98I7edi6rS2Tptwn1kRI2gLiorg3rruR4UgAX3qMhkzDq2+/ZMDqvUA/bZKFjz8Jiw+n+rMCi5w49ud+DxsSyKfS7/8M7+NzLpuwS3Nw56VrpLpc0v1w4WjAflBC0nfQGNCU/NsUBARLuXhcQ2Cc3NEAe+9iBe4H8QNTQkzT+BDlASTsV9H0BxkipMl24QLq8ObJwfTHSpSonEfPR+JnKSgLWgB4w3U8dAJcVnAoDAOhBYS92a0z9mfRlyF2Fc9PCLblFDvx3Jnuet529ekD3e4ZjcIzgz9p6hDSkLM9A98J3jCs1F6l+m+q3arUEHXr9t2FdsFFVhM/VJ7NeOqbge7dxNLPpnbtOds5+aPwlVimsULGvFp7VVtQ9aITfvjGZ6tKZGkR9u9TxvErCskkU0xvgwkLM4eZgTyCEH5RRVr3CwpfmIYfvFPlgr1VbhnTarrPGL6Ef9UDHS2z3WhJqrxGYszlH8VsydlmU49fIkzF3Od2NSMHlkrp2Xiz1458WWgsHjf+az1x5A9dul1nbp1dwm469cDmns7RoDSTOHlZDw0ZSB8tG6CFp+KBqdg8AQqg8tqUXkj1XfZRDj1KZuco5XzKBAUs+0xP+KA8sVHoFlr3YBlJmbSNUoLHZSD3jaRm32UQ97H7hkaZcojkYP7mr6RJUADA4zVfxVRAZ+M2uh66u/qjIm0F38RXQg2wjiAK7l/ypTNn34e5rv9ubiBY0rcMtTyg0OuX+hMVkv/LslZ1Ci4ujGnC7bJj6LnJamuwD9Mmx0+MG1 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85c74f59-b0ce-42e0-c63a-08d950c6855d X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:42.2670 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fd6YGNMVhCYsKznIe06DbHhaY59o3Pp7VPq56qy4r2dehvKMAEwg6q+6tTGqQmDUcNwFLstL3iEZ+hNCLWL+cRe4aAkPTDzmlhusRDPuLuY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3669 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-ORIG-GUID: b4smrpzJfNvO2M2S0b_tbhuYH9lMgSfl X-Proofpoint-GUID: b4smrpzJfNvO2M2S0b_tbhuYH9lMgSfl Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Source kernel commit: cb9e8e1fb89d84c77c8035b2391359f9cbf209e6 This patch basically hoists the node transaction handling around the leaf code we just hoisted. This will helps setup this area for the state machine since the goto is easily replaced with a state since it ends with a transaction roll. Signed-off-by: Allison Henderson Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R --- libxfs/xfs_attr.c | 55 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 9dc518a..118ec0b4 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -309,10 +309,36 @@ xfs_attr_set_args( if (xfs_attr_is_leaf(dp)) { error = xfs_attr_leaf_try_add(args, bp); - if (error == -ENOSPC) + if (error == -ENOSPC) { + /* + * Promote the attribute list to the Btree format. + */ + error = xfs_attr3_leaf_to_node(args); + if (error) + return error; + + /* + * Finish any deferred work items and roll the transaction once + * more. The goal here is to call node_addname with the inode + * and transaction in the same state (inode locked and joined, + * transaction clean) no matter how we got to this step. + */ + error = xfs_defer_finish(&args->trans); + if (error) + return error; + + /* + * Commit the current trans (including the inode) and + * start a new one. + */ + error = xfs_trans_roll_inode(&args->trans, dp); + if (error) + return error; + goto node; - else if (error) + } else if (error) { return error; + } /* * Commit the transaction that added the attr name so that @@ -402,32 +428,9 @@ xfs_attr_set_args( /* bp is gone due to xfs_da_shrink_inode */ return error; + } node: - /* - * Promote the attribute list to the Btree format. - */ - error = xfs_attr3_leaf_to_node(args); - if (error) - return error; - - /* - * Finish any deferred work items and roll the transaction once - * more. The goal here is to call node_addname with the inode - * and transaction in the same state (inode locked and joined, - * transaction clean) no matter how we got to this step. - */ - error = xfs_defer_finish(&args->trans); - if (error) - return error; - /* - * Commit the current trans (including the inode) and - * start a new one. - */ - error = xfs_trans_roll_inode(&args->trans, dp); - if (error) - return error; - } do { error = xfs_attr_node_addname_find_attr(args, &state); From patchwork Tue Jul 27 06:18:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401761 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EBEDC4338F for ; Tue, 27 Jul 2021 06:20:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE5B761107 for ; Tue, 27 Jul 2021 06:20:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235103AbhG0GUC (ORCPT ); Tue, 27 Jul 2021 02:20:02 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:50406 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235668AbhG0GTu (ORCPT ); Tue, 27 Jul 2021 02:19:50 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6Gotl007292 for ; Tue, 27 Jul 2021 06:19:50 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 : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=jVAlxL6WsQ+fanM8OIXRjTGo/OUGOsUQWmk/Aq0NKwU=; b=mtnaj1kjYyuQ79BpNMKcefxJD8GBya5dquAT2zUmHoCxLyDOkfCbUgH7MhRZ036aeAgY AeVebbBh6hZvhxwKbEwHfnmX/oI2yHW2Zr8fQGsl1dQjdjqOBkBm8gqj4dM4gN7TfiN6 JH+AXp3+i1BZX3Eo3GSkFk93AtKNnrEPhkx5C2RfGQFKeA+WcDBJUtHqPuuu1JIBFy5U WNtTfE8uISHZ1eaQ7Lfb6ibXos3cUbQ/qwpf8CzKVW3+hr6TbwwFIgW6M1Ha7HzF8UTl E+kvo5pzYc20qpfG7WoRfa8BznaKSk9NWeuJsC1WGI9edNFs7TIZtfTESiE2kjrHK7Eo eA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=jVAlxL6WsQ+fanM8OIXRjTGo/OUGOsUQWmk/Aq0NKwU=; b=IV4SflIPmjda5/yBZWzhH8zsayajUk4VQGJ+FDJhL7LxA6AXydxP09M6wOhHrfVPxTcg 1+DoKY1oRge3JjMEVtJqN++lre+KJlQA0msh018MjbX99jgfM1dDlPc84q/hKPjlEDOL xna1xd8xBfgPkgz03BQ+xWbqRsB32b1RZ63sJCqRpZ9CK4rmjYdfzHkanu/J483RtPBg 9ePXPsO0FaHtOLMVJLuiAEsityr8ipCuSyWUAdtyebsqzV6139bZxRohFnZl682zNep4 uLwQ6QvniqZXEl8U//vNYsYxEmoIrws76pnr7H1C15H0dI5p684Rg6PRw2fySW3T3QZn Zw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a234n0udx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:49 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6EiaE065026 for ; Tue, 27 Jul 2021 06:19:48 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by userp3020.oracle.com with ESMTP id 3a234uvntm-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LvIlsREL8I1jAzcVZNWyBRuAuc9m3SAQol/RV4ydjLkpBRebAMIALY645JecyKKdllW/ukPwvkR0Z0OZAahSRfE/EPf/IBNLqsPIDKL7PZqHn6Xthz0QsQnAzSp5HAfuVPPEEy5MUaOEF2fvH+pBXWHAlQU7ruDSlyhosB61DMZRPxjENbCTbh7pcpfqIicLh3ojGKf+W14dFWmxtEHsE07LYP9CUCEIQs4Esaad8xCJfLS2WYf1ENl+dervOjTSIXGkonZ968BpGSQ48/wb42wncLvDl8PXmb0+sbBslrw3mFbzjqpdLRxNCA6T1Aigen5fBBbcpndXuF+djhCetA== 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-SenderADCheck; bh=jVAlxL6WsQ+fanM8OIXRjTGo/OUGOsUQWmk/Aq0NKwU=; b=e6sXWw4jkOFB6Ane4i+4OkNOX1E7sHUFpNReXwkryiw+Js5tHu7VHbNgSkvCBd24x1/AdjhkwnfpRKBGMHwDkNiQEwQ+XltRSP0PPDY3hnirC+JVnuG269g8C9bEzvm39PhjsStoaIrT/4pcMWs90mBu4YPeYmDU8av6QwcSY83XHHbYOuBmO1kIv8KX6BIVswWPqnyOgMXVp5qb2WhIQbQMgSoXbn5bhL+q1cg01mAqK4sllc8vsXQdgDqhbjZTnRsaby60R4GxLBq1QBjksUSUzHOTmzp7QqSUtt1m1CXDHKUmlB1MXm0/GyK4gkJwfiPHb2uItOJ5OdoomQXsPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jVAlxL6WsQ+fanM8OIXRjTGo/OUGOsUQWmk/Aq0NKwU=; b=Wh3rlg+4bWus9IjlV+9zN8w88srVkQQUcH88SZTg/qrit1V6kDft6xhOEUYCoF5C+xA7lyR/TaRXJIEU6BxAU84BLOQOPJklPk3DOVro5CUKmA5X9Jwjny6IVOadjpq9e0+9wl7Rsxc2y4pVOySLyFn5QuQDcfy48EhWhc+a+pU= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB3669.namprd10.prod.outlook.com (2603:10b6:a03:119::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17; Tue, 27 Jul 2021 06:19:42 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:42 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 09/27] xfsprogs: Add delay ready attr remove routines Date: Mon, 26 Jul 2021 23:18:46 -0700 Message-Id: <20210727061904.11084-10-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 65832d28-cc03-4406-0c7e-08d950c68597 X-MS-TrafficTypeDiagnostic: BYAPR10MB3669: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D2a/99dc3IFi+dRsBUunh3m6O3O2w7u25z0EDoCGC3LiKQhWEM2sHftGvSlBKXA/3Yg3HaYBR3y2ISHAo01Kiz3sJqL9DG+Lv8jmNmLv3/PKTnsfXq4jzD1wI+zWGnU6XgMJmZQbPxn1NG2wVXxr6AHB41aPs3VE1YTXTW2tKDTwu1ZAeJ4AXlWYF73mrTXAfkt0E7qmeQgZJj/5b7n/RMATksSO9O4kBtIlUuQF3UQpfsoOgp6rFGcrYxdN1q13W5e2gNPmZqv0Dv2BGYYXoDzzKkpoA6Y0cwD9+1qQ4hVPNl46LKwBaZU/2EkVNXgAYLwBufpEZ/GmxspsqQSg4V3iD1fUEMmysvrDTkkZZb/fDsGT7dUaqHSb5Qvork31qCx11NU4oEwTznFKYZyLdu/xLujFAwjkxXGHRvi92nenbufnbRP9hw7ibVMs93VTg0R6qYJALASW93eiupHZLrYaQvym/D22v2PQUwlcmCZZvLfRIyVt6coy5LF0kFSjwZ9Wu/anmPvtsDN2yayqWcH18QQiZoHivBNjMEctLB4SBSKT7jc2yu3xuJA0klEib+SUcMi94TgULDyjQccXou9o/mkxVGtSMOLrq1DHqa5WP2Vq9WpZj2Cw23AKrbDMkna1p06xcwo1+uq1a4RwUXlz0HPG3GhD/Dj+rwonpUuA9kfByL2JskQbPLaB1pLZ+NUfOaeFeS8zdZ8oVx57EA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(346002)(396003)(136003)(39860400002)(366004)(44832011)(478600001)(38100700002)(38350700002)(52116002)(2906002)(6486002)(30864003)(186003)(6512007)(26005)(1076003)(8936002)(8676002)(83380400001)(6506007)(5660300002)(36756003)(6916009)(86362001)(956004)(2616005)(316002)(66556008)(66946007)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8Dv3T8oYyz0C+gzCMZ2jbNyveLJBsIH43g5rJNyWu5CHXZ2n/mjHB8AG9sDXTmaQcpX0S1uhjcxfMakTRG3yOLM78ojVpCXHcUNl/EhhK1ywryMODeeX83qKPfqNx2j0VRnELuczQw3QFFH37oWedEKf2APq48Y5oTxfZZFhachvzYJ1i9cA81dYE3QdvU/V7UekA5W+1D/qgoVjAV8A7wCGEacQGBvAI+LNmKaB+TyCpe+7UkD70rkWvcVAYf4HQWww6cT6/ficL08go/FtylP06YyPmZl7TyxJgxUbGcO9v9wN4oh73wxqd41KYOEvB74EgOM2nrReKUfoB4vdp7jOK6ZJoW2PRXctDaOh4d90G7sOYJbrOqkOzGfA6d/aib8MBY5q4e3EGrAujk+2qG/7uCwZTTkdDdNKNF0JNxHYid7jNXHxdmD/jRZt/eKU34ekIdkzNszCI/8RhjsNJVMXyQrFnFOxHi2eHd/nEa43mjRGap7uvk1Pb0BdCycF5BWdR+4G62ohqn9qXQPJcH2okpCMCFIhWNSNMcZf6RITYnA8ZOZXSJAGcKMdVLe+vxtRUZ++IhpWEc+GD3UYBB5A9zFCSzCQy3GuVKgQlOBn1PpsPhv5XG3bhe00vnYdSVCz2v3kTdnHMxiFzrWnef8enCZi4BdHpvCUrBgskO7XglG+nMtFtok6biy1JuLNQB+Sen2rtYhQhFnIMiaS6Smp0M4DsK9dBbgIQxv54pHz9gE8OxTG4jtgfuwa+n8IVDZHbNDBEGPHjSQNVlmcrE31X3s/PuMKPz5iJkFXE8JbWSLTU+YR0rf/fI1Z2+ZIbBpFWkuUP1tUAUNMLje2e9MRPHzneKHDtGtutWsAM2b0ReNtivLPFsasXFdE1v26sl4i5t2U1UkDm7Myj1lIRt1l6bbbQTey3S23mI4mn6FEHuDofpo7PG+Q2J5MioY4J6zFzA0OfYy2Q2JOQ9Y9HkjjvLZmri00hMcP/lVjjzk6HmMVRZ0bwqXS7DdTI+09ZanrnOgQ4PBPVI+4d+suQ/CVw1u49u7dxOjl8TwqXruMcuqGG2c/dyvF+5g6rMghus2DpyRMoIiDOgVtZzj6mlc0yuXSemXGTy/wfqKYIRrUCQmRyYXmL8sBYBl4fK6FVJ+/kzAUWQmDM8NpNJ5urlicM8+v31iFpsyVoNMscXTp/PkatiKRkRc364QJ13VDjXcGq4Qk3cpTLGvs5SE2Gumej5d9dicDSgTVkSlK0MtpCn/ZrxmvHqda0oY9a6cDbDD/tkR2azKA3QcyUzFH9yBRYppjEpppjUuqzMcEzFRkxMdy+DSZ+ehQnp+IT6HH X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65832d28-cc03-4406-0c7e-08d950c68597 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:42.6393 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Bvei/QWFFGYnz72/jn1XBolDjOpRnmvStR43/8wQgiMVxUPT1bfHb7/OLRbHxFXjhEhIaOOlNA55qe1Y+5Lh9VV7JbxdBVvLY8i95tLnZwQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3669 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-ORIG-GUID: 8tforv4Vs_mAwxCTTfBmxCbd9aVbcA62 X-Proofpoint-GUID: 8tforv4Vs_mAwxCTTfBmxCbd9aVbcA62 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This patch modifies the attr remove routines to be delay ready. This means they no longer roll or commit transactions, but instead return -EAGAIN to have the calling routine roll and refresh the transaction. In this series, xfs_attr_remove_args is merged with xfs_attr_node_removename become a new function, xfs_attr_remove_iter. This new version uses a sort of state machine like switch to keep track of where it was when EAGAIN was returned. A new version of xfs_attr_remove_args consists of a simple loop to refresh the transaction until the operation is completed. A new XFS_DAC_DEFER_FINISH flag is used to finish the transaction where ever the existing code used to. Calls to xfs_attr_rmtval_remove are replaced with the delay ready version __xfs_attr_rmtval_remove. We will rename __xfs_attr_rmtval_remove back to xfs_attr_rmtval_remove when we are done. xfs_attr_rmtval_remove itself is still in use by the set routines (used during a rename). For reasons of preserving existing function, we modify xfs_attr_rmtval_remove to call xfs_defer_finish when the flag is set. Similar to how xfs_attr_remove_args does here. Once we transition the set routines to be delay ready, xfs_attr_rmtval_remove is no longer used and will be removed. This patch also adds a new struct xfs_delattr_context, which we will use to keep track of the current state of an attribute operation. The new xfs_delattr_state enum is used to track various operations that are in progress so that we know not to repeat them, and resume where we left off before EAGAIN was returned to cycle out the transaction. Other members take the place of local variables that need to retain their values across multiple function calls. See xfs_attr.h for a more detailed diagram of the states. Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong --- include/libxfs.h | 1 + libxfs/xfs_attr.c | 223 ++++++++++++++++++++++++++++++++++------------- libxfs/xfs_attr.h | 131 ++++++++++++++++++++++++++++ libxfs/xfs_attr_leaf.c | 2 +- libxfs/xfs_attr_remote.c | 53 ++++++----- libxfs/xfs_attr_remote.h | 2 +- 6 files changed, 327 insertions(+), 85 deletions(-) diff --git a/include/libxfs.h b/include/libxfs.h index bc07655..02d97c1 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -168,6 +168,7 @@ enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC }; #include "xfs_ialloc.h" #include "xfs_attr_leaf.h" +#include "xfs_attr.h" #include "xfs_attr_remote.h" #include "xfs_trans_space.h" diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 118ec0b4..94da860 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -57,7 +57,6 @@ STATIC int xfs_attr_node_addname(struct xfs_da_args *args, struct xfs_da_state *state); STATIC int xfs_attr_node_addname_find_attr(struct xfs_da_args *args, struct xfs_da_state **state); -STATIC int xfs_attr_node_removename(xfs_da_args_t *args); STATIC int xfs_attr_node_addname_clear_incomplete(struct xfs_da_args *args); STATIC int xfs_attr_node_hasname(xfs_da_args_t *args, struct xfs_da_state **state); @@ -241,6 +240,31 @@ xfs_attr_is_shortform( ip->i_afp->if_nextents == 0); } +/* + * Checks to see if a delayed attribute transaction should be rolled. If so, + * transaction is finished or rolled as needed. + */ +int +xfs_attr_trans_roll( + struct xfs_delattr_context *dac) +{ + struct xfs_da_args *args = dac->da_args; + int error; + + if (dac->flags & XFS_DAC_DEFER_FINISH) { + /* + * The caller wants us to finish all the deferred ops so that we + * avoid pinning the log tail with a large number of deferred + * ops. + */ + dac->flags &= ~XFS_DAC_DEFER_FINISH; + error = xfs_defer_finish(&args->trans); + } else + error = xfs_trans_roll_inode(&args->trans, args->dp); + + return error; +} + STATIC int xfs_attr_set_fmt( struct xfs_da_args *args) @@ -544,16 +568,25 @@ xfs_has_attr( */ int xfs_attr_remove_args( - struct xfs_da_args *args) + struct xfs_da_args *args) { - if (!xfs_inode_hasattr(args->dp)) - return -ENOATTR; + int error; + struct xfs_delattr_context dac = { + .da_args = args, + }; - if (args->dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL) - return xfs_attr_shortform_remove(args); - if (xfs_attr_is_leaf(args->dp)) - return xfs_attr_leaf_removename(args); - return xfs_attr_node_removename(args); + do { + error = xfs_attr_remove_iter(&dac); + if (error != -EAGAIN) + break; + + error = xfs_attr_trans_roll(&dac); + if (error) + return error; + + } while (true); + + return error; } /* @@ -1197,14 +1230,16 @@ xfs_attr_leaf_mark_incomplete( */ STATIC int xfs_attr_node_removename_setup( - struct xfs_da_args *args, - struct xfs_da_state **state) + struct xfs_delattr_context *dac) { - int error; + struct xfs_da_args *args = dac->da_args; + struct xfs_da_state **state = &dac->da_state; + int error; error = xfs_attr_node_hasname(args, state); if (error != -EEXIST) return error; + error = 0; ASSERT((*state)->path.blk[(*state)->path.active - 1].bp != NULL); ASSERT((*state)->path.blk[(*state)->path.active - 1].magic == @@ -1213,12 +1248,15 @@ int xfs_attr_node_removename_setup( if (args->rmtblkno > 0) { error = xfs_attr_leaf_mark_incomplete(args, *state); if (error) - return error; + goto out; - return xfs_attr_rmtval_invalidate(args); + error = xfs_attr_rmtval_invalidate(args); } +out: + if (error) + xfs_da_state_free(*state); - return 0; + return error; } STATIC int @@ -1241,70 +1279,133 @@ xfs_attr_node_remove_name( } /* - * Remove a name from a B-tree attribute list. + * Remove the attribute specified in @args. * * This will involve walking down the Btree, and may involve joining * leaf nodes and even joining intermediate nodes up to and including * the root node (a special case of an intermediate node). + * + * This routine is meant to function as either an in-line or delayed operation, + * and may return -EAGAIN when the transaction needs to be rolled. Calling + * functions will need to handle this, and call the function until a + * successful error code is returned. */ -STATIC int -xfs_attr_node_removename( - struct xfs_da_args *args) +int +xfs_attr_remove_iter( + struct xfs_delattr_context *dac) { - struct xfs_da_state *state; - int retval, error; - struct xfs_inode *dp = args->dp; + struct xfs_da_args *args = dac->da_args; + struct xfs_da_state *state = dac->da_state; + int retval, error; + struct xfs_inode *dp = args->dp; trace_xfs_attr_node_removename(args); - error = xfs_attr_node_removename_setup(args, &state); - if (error) - goto out; + switch (dac->dela_state) { + case XFS_DAS_UNINIT: + if (!xfs_inode_hasattr(dp)) + return -ENOATTR; - /* - * If there is an out-of-line value, de-allocate the blocks. - * This is done before we remove the attribute so that we don't - * overflow the maximum size of a transaction and/or hit a deadlock. - */ - if (args->rmtblkno > 0) { - error = xfs_attr_rmtval_remove(args); - if (error) - goto out; + /* + * Shortform or leaf formats don't require transaction rolls and + * thus state transitions. Call the right helper and return. + */ + if (dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL) + return xfs_attr_shortform_remove(args); + + if (xfs_attr_is_leaf(dp)) + return xfs_attr_leaf_removename(args); /* - * Refill the state structure with buffers, the prior calls - * released our buffers. + * Node format may require transaction rolls. Set up the + * state context and fall into the state machine. */ - error = xfs_attr_refillstate(state); - if (error) - goto out; - } - retval = xfs_attr_node_remove_name(args, state); + if (!dac->da_state) { + error = xfs_attr_node_removename_setup(dac); + if (error) + return error; + state = dac->da_state; + } + + /* fallthrough */ + case XFS_DAS_RMTBLK: + dac->dela_state = XFS_DAS_RMTBLK; - /* - * Check to see if the tree needs to be collapsed. - */ - if (retval && (state->path.active > 1)) { - error = xfs_da3_join(state); - if (error) - goto out; - error = xfs_defer_finish(&args->trans); - if (error) - goto out; /* - * Commit the Btree join operation and start a new trans. + * If there is an out-of-line value, de-allocate the blocks. + * This is done before we remove the attribute so that we don't + * overflow the maximum size of a transaction and/or hit a + * deadlock. */ - error = xfs_trans_roll_inode(&args->trans, dp); - if (error) - goto out; - } + if (args->rmtblkno > 0) { + /* + * May return -EAGAIN. Roll and repeat until all remote + * blocks are removed. + */ + error = __xfs_attr_rmtval_remove(dac); + if (error == -EAGAIN) + return error; + else if (error) + goto out; - /* - * If the result is small enough, push it all into the inode. - */ - if (xfs_attr_is_leaf(dp)) - error = xfs_attr_node_shrink(args, state); + /* + * Refill the state structure with buffers (the prior + * calls released our buffers) and close out this + * transaction before proceeding. + */ + ASSERT(args->rmtblkno == 0); + error = xfs_attr_refillstate(state); + if (error) + goto out; + dac->dela_state = XFS_DAS_RM_NAME; + dac->flags |= XFS_DAC_DEFER_FINISH; + return -EAGAIN; + } + + /* fallthrough */ + case XFS_DAS_RM_NAME: + /* + * If we came here fresh from a transaction roll, reattach all + * the buffers to the current transaction. + */ + if (dac->dela_state == XFS_DAS_RM_NAME) { + error = xfs_attr_refillstate(state); + if (error) + goto out; + } + retval = xfs_attr_node_remove_name(args, state); + + /* + * Check to see if the tree needs to be collapsed. If so, roll + * the transacton and fall into the shrink state. + */ + if (retval && (state->path.active > 1)) { + error = xfs_da3_join(state); + if (error) + goto out; + + dac->flags |= XFS_DAC_DEFER_FINISH; + dac->dela_state = XFS_DAS_RM_SHRINK; + return -EAGAIN; + } + + /* fallthrough */ + case XFS_DAS_RM_SHRINK: + /* + * If the result is small enough, push it all into the inode. + * This is our final state so it's safe to return a dirty + * transaction. + */ + if (xfs_attr_is_leaf(dp)) + error = xfs_attr_node_shrink(args, state); + ASSERT(error != -EAGAIN); + break; + default: + ASSERT(0); + error = -EINVAL; + goto out; + } out: if (state) xfs_da_state_free(state); diff --git a/libxfs/xfs_attr.h b/libxfs/xfs_attr.h index 2b1f619..1267ea8 100644 --- a/libxfs/xfs_attr.h +++ b/libxfs/xfs_attr.h @@ -74,6 +74,133 @@ struct xfs_attr_list_context { }; +/* + * ======================================================================== + * Structure used to pass context around among the delayed routines. + * ======================================================================== + */ + +/* + * Below is a state machine diagram for attr remove operations. The XFS_DAS_* + * states indicate places where the function would return -EAGAIN, and then + * immediately resume from after being called by the calling function. States + * marked as a "subroutine state" indicate that they belong to a subroutine, and + * so the calling function needs to pass them back to that subroutine to allow + * it to finish where it left off. But they otherwise do not have a role in the + * calling function other than just passing through. + * + * xfs_attr_remove_iter() + * │ + * v + * have attr to remove? ──n──> done + * │ + * y + * │ + * v + * are we short form? ──y──> xfs_attr_shortform_remove ──> done + * │ + * n + * │ + * V + * are we leaf form? ──y──> xfs_attr_leaf_removename ──> done + * │ + * n + * │ + * V + * ┌── need to setup state? + * │ │ + * n y + * │ │ + * │ v + * │ find attr and get state + * │ attr has remote blks? ──n─┐ + * │ │ v + * │ │ find and invalidate + * │ y the remote blocks. + * │ │ mark attr incomplete + * │ ├────────────────┘ + * └──────────┤ + * │ + * v + * Have remote blks to remove? ───y─────┐ + * │ ^ remove the blks + * │ │ │ + * │ │ v + * │ XFS_DAS_RMTBLK <─n── done? + * │ re-enter with │ + * │ one less blk to y + * │ remove │ + * │ V + * │ refill the state + * n │ + * │ v + * │ XFS_DAS_RM_NAME + * │ │ + * ├─────────────────────────┘ + * │ + * v + * remove leaf and + * update hash with + * xfs_attr_node_remove_cleanup + * │ + * v + * need to + * shrink tree? ─n─┐ + * │ │ + * y │ + * │ │ + * v │ + * join leaf │ + * │ │ + * v │ + * XFS_DAS_RM_SHRINK │ + * │ │ + * v │ + * do the shrink │ + * │ │ + * v │ + * free state <──┘ + * │ + * v + * done + * + */ + +/* + * Enum values for xfs_delattr_context.da_state + * + * These values are used by delayed attribute operations to keep track of where + * they were before they returned -EAGAIN. A return code of -EAGAIN signals the + * calling function to roll the transaction, and then call the subroutine to + * finish the operation. The enum is then used by the subroutine to jump back + * to where it was and resume executing where it left off. + */ +enum xfs_delattr_state { + XFS_DAS_UNINIT = 0, /* No state has been set yet */ + XFS_DAS_RMTBLK, /* Removing remote blks */ + XFS_DAS_RM_NAME, /* Remove attr name */ + XFS_DAS_RM_SHRINK, /* We are shrinking the tree */ +}; + +/* + * Defines for xfs_delattr_context.flags + */ +#define XFS_DAC_DEFER_FINISH 0x01 /* finish the transaction */ + +/* + * Context used for keeping track of delayed attribute operations + */ +struct xfs_delattr_context { + struct xfs_da_args *da_args; + + /* Used in xfs_attr_node_removename to roll through removing blocks */ + struct xfs_da_state *da_state; + + /* Used to keep track of current state of delayed operation */ + unsigned int flags; + enum xfs_delattr_state dela_state; +}; + /*======================================================================== * Function prototypes for the kernel. *========================================================================*/ @@ -92,6 +219,10 @@ int xfs_attr_set(struct xfs_da_args *args); int xfs_attr_set_args(struct xfs_da_args *args); int xfs_has_attr(struct xfs_da_args *args); int xfs_attr_remove_args(struct xfs_da_args *args); +int xfs_attr_remove_iter(struct xfs_delattr_context *dac); +int xfs_attr_trans_roll(struct xfs_delattr_context *dac); bool xfs_attr_namecheck(const void *name, size_t length); +void xfs_delattr_context_init(struct xfs_delattr_context *dac, + struct xfs_da_args *args); #endif /* __XFS_ATTR_H__ */ diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c index e13e83e..08600ea 100644 --- a/libxfs/xfs_attr_leaf.c +++ b/libxfs/xfs_attr_leaf.c @@ -19,8 +19,8 @@ #include "xfs_bmap_btree.h" #include "xfs_bmap.h" #include "xfs_attr_sf.h" -#include "xfs_attr_remote.h" #include "xfs_attr.h" +#include "xfs_attr_remote.h" #include "xfs_attr_leaf.h" #include "xfs_trace.h" #include "xfs_dir2.h" diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c index 3807cd3..e41bbb2 100644 --- a/libxfs/xfs_attr_remote.c +++ b/libxfs/xfs_attr_remote.c @@ -673,10 +673,12 @@ xfs_attr_rmtval_invalidate( */ int xfs_attr_rmtval_remove( - struct xfs_da_args *args) + struct xfs_da_args *args) { - int error; - int retval; + int error; + struct xfs_delattr_context dac = { + .da_args = args, + }; trace_xfs_attr_rmtval_remove(args); @@ -684,31 +686,30 @@ xfs_attr_rmtval_remove( * Keep de-allocating extents until the remote-value region is gone. */ do { - retval = __xfs_attr_rmtval_remove(args); - if (retval && retval != -EAGAIN) - return retval; + error = __xfs_attr_rmtval_remove(&dac); + if (error && error != -EAGAIN) + break; - /* - * Close out trans and start the next one in the chain. - */ - error = xfs_trans_roll_inode(&args->trans, args->dp); + error = xfs_attr_trans_roll(&dac); if (error) return error; - } while (retval == -EAGAIN); + } while (true); - return 0; + return error; } /* * Remove the value associated with an attribute by deleting the out-of-line - * buffer that it is stored on. Returns EAGAIN for the caller to refresh the - * transaction and re-call the function + * buffer that it is stored on. Returns -EAGAIN for the caller to refresh the + * transaction and re-call the function. Callers should keep calling this + * routine until it returns something other than -EAGAIN. */ int __xfs_attr_rmtval_remove( - struct xfs_da_args *args) + struct xfs_delattr_context *dac) { - int error, done; + struct xfs_da_args *args = dac->da_args; + int error, done; /* * Unmap value blocks for this attr. @@ -718,12 +719,20 @@ __xfs_attr_rmtval_remove( if (error) return error; - error = xfs_defer_finish(&args->trans); - if (error) - return error; - - if (!done) + /* + * We don't need an explicit state here to pick up where we left off. We + * can figure it out using the !done return code. The actual value of + * attr->xattri_dela_state may be some value reminiscent of the calling + * function, but it's value is irrelevant with in the context of this + * function. Once we are done here, the next state is set as needed by + * the parent + */ + if (!done) { + dac->flags |= XFS_DAC_DEFER_FINISH; return -EAGAIN; + } - return error; + args->rmtblkno = 0; + args->rmtblkcnt = 0; + return 0; } diff --git a/libxfs/xfs_attr_remote.h b/libxfs/xfs_attr_remote.h index 9eee615..002fd30 100644 --- a/libxfs/xfs_attr_remote.h +++ b/libxfs/xfs_attr_remote.h @@ -14,5 +14,5 @@ int xfs_attr_rmtval_remove(struct xfs_da_args *args); int xfs_attr_rmtval_stale(struct xfs_inode *ip, struct xfs_bmbt_irec *map, xfs_buf_flags_t incore_flags); int xfs_attr_rmtval_invalidate(struct xfs_da_args *args); -int __xfs_attr_rmtval_remove(struct xfs_da_args *args); +int __xfs_attr_rmtval_remove(struct xfs_delattr_context *dac); #endif /* __XFS_ATTR_REMOTE_H__ */ From patchwork Tue Jul 27 06:18:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401771 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33176C4320A for ; Tue, 27 Jul 2021 06:20:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 162F661107 for ; Tue, 27 Jul 2021 06:20:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235735AbhG0GUG (ORCPT ); Tue, 27 Jul 2021 02:20:06 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:51480 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235659AbhG0GTw (ORCPT ); Tue, 27 Jul 2021 02:19:52 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6Hlhm023082 for ; Tue, 27 Jul 2021 06:19:51 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 : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=FaDLzMnGgDnou1a9/VQ+ThIgM4GJaoXo8GVv21t7lIA=; b=FJzfI4n5bZXB3+Ow/kCcf1vyC3ZZoQfg3HDIgyx/48ALuzhdttApjUPhnHo6abQtMdOq zp8/JltM8hQj2NkFULNimi5NrQFNsiWuQ6qXvHs4I0pw0U2CXsJCL0V4aYtXI9kxI6go iezBKMWcu+HYcMqi+sTZofXM1sFFIAQxkPMhkCrM7SSxe/AaaJL8q8ut/Voqv4xP3yyI FnHfoQLIQGiSRgmkhTdYOGcILbhOYvgiVcVzrjfjLCOh/jW+pnaex28vdGW850nSbuUY sLcuXD9QhUP4HpVpZpCGX8ZJAnRnFs+kOUhYV0qQzOTb0+N3x3KV0y/wb+xqAH3gA1Uw Tw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=FaDLzMnGgDnou1a9/VQ+ThIgM4GJaoXo8GVv21t7lIA=; b=Myjs33NuF6ckFKoBAfJYQD6X9iVdvxbEhUtoZ6Zr2nPCmxR6LXcxJEJdFv6zJDMOioN3 bMnyuucOTggKS7qGSz1fG1PWLBFkbwWbEzvJi/P8IgouqgZ5D/OX7OjovidSuMJpo8Gn VvM8kkw0rRnD8AQwPtwsn5mZVOPCSOE0FNCHnJ2ugJjEgym6cHo0nq4ue6p/D/dwISo2 x2EYYyB9c8kxlOBN2KAFDyYWwTBDY/f1b+zvMeLkk7B1UChxTwTWYk0u5W7Fafp/7T1B ekUhXJoHHEFV3In+B7XBUuzDSiiMmRDsZMv1fKvRPr29PcuYpv9JnxpLdwPaA/c7qxlO wQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a23538uwf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:51 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6EiaG065026 for ; Tue, 27 Jul 2021 06:19:50 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by userp3020.oracle.com with ESMTP id 3a234uvntm-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nc6cNADZHY2ZGHnc1wCVl3EnZknSkzma39iNGbYzWen2PNbJrPJMZj7tzJYkINyvO5E+Vz2401pDX6VEO4+eBejmPq0pNu5HtIotqmIt/prbI7HtzgiAOgAFsKCljxkWvOsmY1b382dLhYaskYIFx/7Ngi0b6yqL4YIzTcg8cOfmbHSomilSat6/0Pf1OS94ir08l51q5Hh/FDcLShzYrgT+vmifC9WvNnzhvwQOqNMcLKzpfinNLJOFYmublVzdr/kJYWJNT6OAANhAXM20vSHW/35Kq+azYkSV4P8nxsN4L9Djx6dqURpzyI5aoom3Ia7mnFXBMUj+BTQaXhpV/Q== 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-SenderADCheck; bh=FaDLzMnGgDnou1a9/VQ+ThIgM4GJaoXo8GVv21t7lIA=; b=ToOmf4fxBRYvBccU6Hxf7tIL1AV4sqqkhJaruXVg/pQZ1ZIOGvHDTz5TzXPDlLPn54R8smmdyhLeSPWMXwiYCA6GWujmGsLGKQQs1NVukXU4B5Whn0V/9vBSqDMmKNT56ACdWq2XUoX3l5UxC+ftK52FYog6oOMXDz691EZ2BTw+FlAisorZE4E5vg+a81GeDa5Y5YgDsjvMThBoniQSHXsPJaY3X2ZW1yPKWY+KunV665oNGjko+ULOnJycuNtJVyWjy83gkPz+obqajg/QOQaXMsjgxMHqpVs3HjNgD2+Uw5FVoEoI5nu83q6l12AgpMLD7fINNPeMZesFyESz3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FaDLzMnGgDnou1a9/VQ+ThIgM4GJaoXo8GVv21t7lIA=; b=LBH2iUg90WHK7RiV7SStXydezSDIjgYVcLtAfVfmYT8HXVB/OzLVDAWHqzxvsa/eCfSg+1jOePChr8baksuy4XjjbrDoOAmT9SHQ6KAkmaSDhtCYulw8JJTaQe+HrezTp9GDPPrbBIWkVgywavzMiLpjnRfVANHM6MGvutaG6+s= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB3669.namprd10.prod.outlook.com (2603:10b6:a03:119::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17; Tue, 27 Jul 2021 06:19:43 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:43 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 10/27] xfsprogs: Add delay ready attr set routines Date: Mon, 26 Jul 2021 23:18:47 -0700 Message-Id: <20210727061904.11084-11-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a70c62d9-5198-4033-b0c7-08d950c685d1 X-MS-TrafficTypeDiagnostic: BYAPR10MB3669: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8kpT4LWIZEP+7w1pwt6eV/h/jnhl7AyyIvhiI5aUQV/28CrUU9hpWGicpZsGV+zEIjkKXBj83PhXkWyBXTHXjhIrzw/0oZbilcCfnFlgfk6xHeL97wb2uWKqk/xJOY84AQVlSn4A+6Dv26qrQgiqhSpD6od9wVzs8JWyWhfvushi8AKzUcunPt/L7lL/OW//BWeVISV5UzbZWJ227vkV+5PMLh4kzOylinwjjOPHy/wSOOkpmkIChnxmA5+QL/WeHeLtjr7F2CEsdLMtXxY5+OmgqOZLHcQ+cLZgCrxoQJTzX80hvrulcnl6B/bzCtniRtWiZBaainHJBhkOJ4b9Z1JPgiKJxWaxKMJ+vnIJO7bhvn/tR1+cnunFsp6xKF4fSSsp/jPgecuVHX/mxx2oTZdrhAWVcgn+yiNeElBkU1dq+leq+wKGkYLrrRaLTx7/RdB2V8OkD0XVZlAzF00oJuBlj0kKMEC8zNkb1J6MtFYYCPBUAABSG3uZeGZxL/BrxaJQtKysy02Eh0Hs1RLwqonfYTChN25habmI58U6ChI/JnZVa9zWhhpwuOCbruYOQPgKP/Db39NogIve+LHdIgQjXLHC/T6ikLeq5ul0Lx/oCwLY4HTHIZ5UL7H+1jvAiUv2l7ZJTQCSPzjtINMddXym/3cSHtH/LOgMTs5rY30Z5rU3oTVPLoAlnNuF2hsLGZyCLowZ0ATL8ELjsNzJOQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(346002)(396003)(136003)(39860400002)(366004)(44832011)(478600001)(38100700002)(38350700002)(52116002)(2906002)(6486002)(30864003)(186003)(6512007)(26005)(1076003)(8936002)(8676002)(83380400001)(6506007)(5660300002)(36756003)(6916009)(86362001)(956004)(2616005)(316002)(66556008)(66946007)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SY2f3SFxBjimv0XFGnOSuusauygcQtkeJ6rX6mdBvNxREO9Mljn9Sriz1eKYLu0PG/F25mi/Vhtc4M0or/+kmbsQRvju8YXGvkDKucRGmPhPq9Cdnu7IZL2FHGVJnib3E0/+1fkGuXp+G0l0TL1qznSMhvKVwSHHb+Tw21CcDcGAcqqqt83VggDAAUhRGutUV1k8YYH1eHrrTJzrhdSp6Vrea6syw/7xqPiXP/hqA5CtIU9NyXj6XamqAD79Sz15RPlFCWpDJIfVTtachiOJdgv+SgJk3ahU0rr1g1U5m1sf0E190QzG9oOsCJMu/HVstqb+jiLAbIpLAYnj0EZsyekI2yPSWZpzSjq9Mz6y/tNTb14D1l1Ykueq8Ubob6ObUoT/j0VGNAdeYIN43RcDDVo1K9Pi2KCYwLBHjrcVuYf4oI3TCjO/XrkFcEj3RW4CeLHFJHKJLRZUzSdwdofbWayYxzmAf6ncVFrozmINlWBiwTTi2oi0qKzq/rdO67BlXxIBdM8Q59M7/LKaTCjjHHCV/WdMJy+k0g3qGKwhNyv7FW2Ob7QraVn3LqrGjiO2ixFMYj15xxGGM+RcYrQ/1fgThnW9jsmT7N9qLdxdXswhqSoEptD6dPKlRto8VZzP204ZWnOiclXt5d8u9t3erLcA2RNrwluGvqWFg2cf32ATbkgpoX5v5W80tW+mBbRT3aje3U/ssH/jaOV2an8YvF6vt/iJ/+m+SWu59mvlUTvyr5GO3V4kkzndxXDX7KOck43AsBA6Hc31trbWj4Ha/YdAF8e1M//tSeBD4FA1ACl3Be6TvpAxRsmHsFs6eY5Oxndx/F+jw/dCsiZtdIDQzvvt1utoXONpoGf9iiN5NUvAlZEwLFRcwOxLkpuZOlw39e+fFKAi4WGFEMkk6Ig5uXW4Unv7n6iiR0LMjYJxDuBEB+4ouY8n1XFXadnhb3pIGL8BJZpZJp3LD3hjQVF2QOGMkb73ILVjuJtkYw2ML2eFclScsUuleT0YqEhy3dSe+sqoP4wR+mASsa5kPUGeFxznJEPxr1H0txHJh7q3T3CMAcNCdE901H0AVc5z8tAWbzhY4iPNrk6c6kDA9L/M8GDUziGuBh0ESjOWdxa6CSPvQtnWGmxKrQHW+tdZK7XocRt0hueWjNn2T3+4etE9eJQq2f2BOwgDymF3Y4BI2dEcti5/xjV8XKd86xtf/sgJJuH0/X9x9xRYxsidhsn1EKhuF8RJrfSwdsanYc/TDsHu+yrfn1lBrsL6eUQ2Bn6DZfvu7vQcPkEyBwDqRbBUmp1UupocilgyJjUIj+k93XPXbOfcwA7Yy0BlkPqkvQDO X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a70c62d9-5198-4033-b0c7-08d950c685d1 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:43.0495 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bJsxNVOM4cV353o40G+Upvdsv5DqCrW/jRo10ISR4tddIIQu+XthlJ0O7NCVBMloJMilqY8SH3CwkMM2mWGjSiFAMc54Z2y03rT8TIL46FQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3669 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: gfrXGUbpEJLBws3w0lQagQnq5zVfZKVj X-Proofpoint-ORIG-GUID: gfrXGUbpEJLBws3w0lQagQnq5zVfZKVj Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Source kernel commit: 45e46c998cd75749f6975ffdeeb9a59768e4fcd3 This patch modifies the attr set routines to be delay ready. This means they no longer roll or commit transactions, but instead return -EAGAIN to have the calling routine roll and refresh the transaction. In this series, xfs_attr_set_args has become xfs_attr_set_iter, which uses a state machine like switch to keep track of where it was when EAGAIN was returned. See xfs_attr.h for a more detailed diagram of the states. Two new helper functions have been added: xfs_attr_rmtval_find_space and xfs_attr_rmtval_set_blk. They provide a subset of logic similar to xfs_attr_rmtval_set, but they store the current block in the delay attr context to allow the caller to roll the transaction between allocations. This helps to simplify and consolidate code used by xfs_attr_leaf_addname and xfs_attr_node_addname. xfs_attr_set_args has now become a simple loop to refresh the transaction until the operation is completed. Lastly, xfs_attr_rmtval_remove is no longer used, and is removed. Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Reviewed-by: Brian Foster --- include/xfs_trace.h | 1 - libxfs/xfs_attr.c | 450 ++++++++++++++++++++++++++++------------------- libxfs/xfs_attr.h | 274 ++++++++++++++++++++++++++++- libxfs/xfs_attr_remote.c | 100 +++++++---- libxfs/xfs_attr_remote.h | 5 +- 5 files changed, 610 insertions(+), 220 deletions(-) diff --git a/include/xfs_trace.h b/include/xfs_trace.h index fa4d38d..a847b50 100644 --- a/include/xfs_trace.h +++ b/include/xfs_trace.h @@ -159,7 +159,6 @@ #define trace_xfs_attr_node_get(a) ((void) 0) #define trace_xfs_attr_rmtval_get(a) ((void) 0) #define trace_xfs_attr_rmtval_set(a) ((void) 0) -#define trace_xfs_attr_rmtval_remove(a) ((void) 0) #define trace_xfs_bmap_pre_update(a,b,c,d) ((void) 0) #define trace_xfs_bmap_post_update(a,b,c,d) ((void) 0) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 94da860..347f854 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -53,15 +53,16 @@ STATIC int xfs_attr_leaf_try_add(struct xfs_da_args *args, struct xfs_buf *bp); */ STATIC int xfs_attr_node_get(xfs_da_args_t *args); STATIC void xfs_attr_restore_rmt_blk(struct xfs_da_args *args); -STATIC int xfs_attr_node_addname(struct xfs_da_args *args, - struct xfs_da_state *state); -STATIC int xfs_attr_node_addname_find_attr(struct xfs_da_args *args, - struct xfs_da_state **state); -STATIC int xfs_attr_node_addname_clear_incomplete(struct xfs_da_args *args); +STATIC int xfs_attr_node_addname(struct xfs_delattr_context *dac); +STATIC int xfs_attr_node_addname_find_attr(struct xfs_delattr_context *dac); +STATIC int xfs_attr_node_addname_clear_incomplete( + struct xfs_delattr_context *dac); STATIC int xfs_attr_node_hasname(xfs_da_args_t *args, struct xfs_da_state **state); STATIC int xfs_attr_fillstate(xfs_da_state_t *state); STATIC int xfs_attr_refillstate(xfs_da_state_t *state); +STATIC int xfs_attr_set_iter(struct xfs_delattr_context *dac, + struct xfs_buf **leaf_bp); int xfs_inode_hasattr( @@ -244,7 +245,7 @@ xfs_attr_is_shortform( * Checks to see if a delayed attribute transaction should be rolled. If so, * transaction is finished or rolled as needed. */ -int +STATIC int xfs_attr_trans_roll( struct xfs_delattr_context *dac) { @@ -265,29 +266,58 @@ xfs_attr_trans_roll( return error; } +/* + * Set the attribute specified in @args. + */ +int +xfs_attr_set_args( + struct xfs_da_args *args) +{ + struct xfs_buf *leaf_bp = NULL; + int error = 0; + struct xfs_delattr_context dac = { + .da_args = args, + }; + + do { + error = xfs_attr_set_iter(&dac, &leaf_bp); + if (error != -EAGAIN) + break; + + error = xfs_attr_trans_roll(&dac); + if (error) { + if (leaf_bp) + xfs_trans_brelse(args->trans, leaf_bp); + return error; + } + } while (true); + + return error; +} + STATIC int xfs_attr_set_fmt( - struct xfs_da_args *args) + struct xfs_delattr_context *dac, + struct xfs_buf **leaf_bp) { - struct xfs_buf *leaf_bp = NULL; - struct xfs_inode *dp = args->dp; - int error, error2 = 0; + struct xfs_da_args *args = dac->da_args; + struct xfs_inode *dp = args->dp; + int error = 0; /* * Try to add the attr to the attribute list in the inode. */ error = xfs_attr_try_sf_addname(dp, args); - if (error != -ENOSPC) { - error2 = xfs_trans_commit(args->trans); - args->trans = NULL; - return error ? error : error2; - } + + /* Should only be 0, -EEXIST or -ENOSPC */ + if (error != -ENOSPC) + return error; /* * It won't fit in the shortform, transform to a leaf block. GROT: * another possible req'mt for a double-split btree op. */ - error = xfs_attr_shortform_to_leaf(args, &leaf_bp); + error = xfs_attr_shortform_to_leaf(args, leaf_bp); if (error) return error; @@ -296,102 +326,130 @@ xfs_attr_set_fmt( * push cannot grab the half-baked leaf buffer and run into problems * with the write verifier. */ - xfs_trans_bhold(args->trans, leaf_bp); - error = xfs_defer_finish(&args->trans); - xfs_trans_bhold_release(args->trans, leaf_bp); - if (error) { - xfs_trans_brelse(args->trans, leaf_bp); - return error; - } + xfs_trans_bhold(args->trans, *leaf_bp); + /* + * We're still in XFS_DAS_UNINIT state here. We've converted + * the attr fork to leaf format and will restart with the leaf + * add. + */ + dac->flags |= XFS_DAC_DEFER_FINISH; return -EAGAIN; } /* * Set the attribute specified in @args. + * This routine is meant to function as a delayed operation, and may return + * -EAGAIN when the transaction needs to be rolled. Calling functions will need + * to handle this, and recall the function until a successful error code is + * returned. */ int -xfs_attr_set_args( - struct xfs_da_args *args) +xfs_attr_set_iter( + struct xfs_delattr_context *dac, + struct xfs_buf **leaf_bp) { - struct xfs_inode *dp = args->dp; - struct xfs_buf *bp = NULL; - struct xfs_da_state *state = NULL; - int forkoff, error = 0; + struct xfs_da_args *args = dac->da_args; + struct xfs_inode *dp = args->dp; + struct xfs_buf *bp = NULL; + int forkoff, error = 0; - /* - * If the attribute list is already in leaf format, jump straight to - * leaf handling. Otherwise, try to add the attribute to the shortform - * list; if there's no room then convert the list to leaf format and try - * again. - */ - if (xfs_attr_is_shortform(dp)) { - error = xfs_attr_set_fmt(args); - if (error != -EAGAIN) - return error; - } + /* State machine switch */ + switch (dac->dela_state) { + case XFS_DAS_UNINIT: + /* + * If the fork is shortform, attempt to add the attr. If there + * is no space, this converts to leaf format and returns + * -EAGAIN with the leaf buffer held across the roll. The caller + * will deal with a transaction roll error, but otherwise + * release the hold once we return with a clean transaction. + */ + if (xfs_attr_is_shortform(dp)) + return xfs_attr_set_fmt(dac, leaf_bp); + if (*leaf_bp != NULL) { + xfs_trans_bhold_release(args->trans, *leaf_bp); + *leaf_bp = NULL; + } - if (xfs_attr_is_leaf(dp)) { - error = xfs_attr_leaf_try_add(args, bp); - if (error == -ENOSPC) { - /* - * Promote the attribute list to the Btree format. - */ - error = xfs_attr3_leaf_to_node(args); - if (error) + if (xfs_attr_is_leaf(dp)) { + error = xfs_attr_leaf_try_add(args, *leaf_bp); + if (error == -ENOSPC) { + error = xfs_attr3_leaf_to_node(args); + if (error) + return error; + + /* + * Finish any deferred work items and roll the + * transaction once more. The goal here is to + * call node_addname with the inode and + * transaction in the same state (inode locked + * and joined, transaction clean) no matter how + * we got to this step. + * + * At this point, we are still in + * XFS_DAS_UNINIT, but when we come back, we'll + * be a node, so we'll fall down into the node + * handling code below + */ + dac->flags |= XFS_DAC_DEFER_FINISH; + return -EAGAIN; + } else if (error) { return error; + } - /* - * Finish any deferred work items and roll the transaction once - * more. The goal here is to call node_addname with the inode - * and transaction in the same state (inode locked and joined, - * transaction clean) no matter how we got to this step. - */ - error = xfs_defer_finish(&args->trans); + dac->dela_state = XFS_DAS_FOUND_LBLK; + } else { + error = xfs_attr_node_addname_find_attr(dac); if (error) return error; - /* - * Commit the current trans (including the inode) and - * start a new one. - */ - error = xfs_trans_roll_inode(&args->trans, dp); + error = xfs_attr_node_addname(dac); if (error) return error; - goto node; - } else if (error) { - return error; + dac->dela_state = XFS_DAS_FOUND_NBLK; } - - /* - * Commit the transaction that added the attr name so that - * later routines can manage their own transactions. - */ - error = xfs_trans_roll_inode(&args->trans, dp); - if (error) - return error; - + return -EAGAIN; + case XFS_DAS_FOUND_LBLK: /* * If there was an out-of-line value, allocate the blocks we * identified for its storage and copy the value. This is done * after we create the attribute so that we don't overflow the * maximum size of a transaction and/or hit a deadlock. */ - if (args->rmtblkno > 0) { - error = xfs_attr_rmtval_set(args); + + /* Open coded xfs_attr_rmtval_set without trans handling */ + if ((dac->flags & XFS_DAC_LEAF_ADDNAME_INIT) == 0) { + dac->flags |= XFS_DAC_LEAF_ADDNAME_INIT; + if (args->rmtblkno > 0) { + error = xfs_attr_rmtval_find_space(dac); + if (error) + return error; + } + } + + /* + * Repeat allocating remote blocks for the attr value until + * blkcnt drops to zero. + */ + if (dac->blkcnt > 0) { + error = xfs_attr_rmtval_set_blk(dac); if (error) return error; + return -EAGAIN; } + error = xfs_attr_rmtval_set_value(args); + if (error) + return error; + + /* + * If this is not a rename, clear the incomplete flag and we're + * done. + */ if (!(args->op_flags & XFS_DA_OP_RENAME)) { - /* - * Added a "remote" value, just clear the incomplete - *flag. - */ if (args->rmtblkno > 0) error = xfs_attr3_leaf_clearflag(args); - return error; } @@ -404,7 +462,6 @@ xfs_attr_set_args( * In a separate transaction, set the incomplete flag on the * "old" attr and clear the incomplete flag on the "new" attr. */ - error = xfs_attr3_leaf_flipflags(args); if (error) return error; @@ -412,29 +469,37 @@ xfs_attr_set_args( * Commit the flag value change and start the next trans in * series. */ - error = xfs_trans_roll_inode(&args->trans, args->dp); - if (error) - return error; - + dac->dela_state = XFS_DAS_FLIP_LFLAG; + return -EAGAIN; + case XFS_DAS_FLIP_LFLAG: /* * Dismantle the "old" attribute/value pair by removing a * "remote" value (if it exists). */ xfs_attr_restore_rmt_blk(args); + error = xfs_attr_rmtval_invalidate(args); + if (error) + return error; + /* fallthrough */ + case XFS_DAS_RM_LBLK: + /* Set state in case xfs_attr_rmtval_remove returns -EAGAIN */ + dac->dela_state = XFS_DAS_RM_LBLK; if (args->rmtblkno) { - error = xfs_attr_rmtval_invalidate(args); + error = __xfs_attr_rmtval_remove(dac); if (error) return error; - error = xfs_attr_rmtval_remove(args); - if (error) - return error; + dac->dela_state = XFS_DAS_RD_LEAF; + return -EAGAIN; } + /* fallthrough */ + case XFS_DAS_RD_LEAF: /* - * Read in the block containing the "old" attr, then remove the - * "old" attr from that block (neat, huh!) + * This is the last step for leaf format. Read the block with + * the old attr, remove the old attr, check for shortform + * conversion and return. */ error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, &bp); @@ -443,97 +508,116 @@ xfs_attr_set_args( xfs_attr3_leaf_remove(bp, args); - /* - * If the result is small enough, shrink it all into the inode. - */ forkoff = xfs_attr_shortform_allfit(bp, dp); if (forkoff) error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); /* bp is gone due to xfs_da_shrink_inode */ return error; - } -node: + case XFS_DAS_FOUND_NBLK: + /* + * Find space for remote blocks and fall into the allocation + * state. + */ + if (args->rmtblkno > 0) { + error = xfs_attr_rmtval_find_space(dac); + if (error) + return error; + } - do { - error = xfs_attr_node_addname_find_attr(args, &state); - if (error) - return error; - error = xfs_attr_node_addname(args, state); - } while (error == -EAGAIN); - if (error) - return error; + /* fallthrough */ + case XFS_DAS_ALLOC_NODE: + /* + * If there was an out-of-line value, allocate the blocks we + * identified for its storage and copy the value. This is done + * after we create the attribute so that we don't overflow the + * maximum size of a transaction and/or hit a deadlock. + */ + dac->dela_state = XFS_DAS_ALLOC_NODE; + if (args->rmtblkno > 0) { + if (dac->blkcnt > 0) { + error = xfs_attr_rmtval_set_blk(dac); + if (error) + return error; + return -EAGAIN; + } + + error = xfs_attr_rmtval_set_value(args); + if (error) + return error; + } - /* - * Commit the leaf addition or btree split and start the next - * trans in the chain. - */ - error = xfs_trans_roll_inode(&args->trans, dp); - if (error) - goto out; + /* + * If this was not a rename, clear the incomplete flag and we're + * done. + */ + if (!(args->op_flags & XFS_DA_OP_RENAME)) { + if (args->rmtblkno > 0) + error = xfs_attr3_leaf_clearflag(args); + goto out; + } - /* - * If there was an out-of-line value, allocate the blocks we - * identified for its storage and copy the value. This is done - * after we create the attribute so that we don't overflow the - * maximum size of a transaction and/or hit a deadlock. - */ - if (args->rmtblkno > 0) { - error = xfs_attr_rmtval_set(args); + /* + * If this is an atomic rename operation, we must "flip" the + * incomplete flags on the "new" and "old" attribute/value pairs + * so that one disappears and one appears atomically. Then we + * must remove the "old" attribute/value pair. + * + * In a separate transaction, set the incomplete flag on the + * "old" attr and clear the incomplete flag on the "new" attr. + */ + error = xfs_attr3_leaf_flipflags(args); if (error) - return error; - } - - if (!(args->op_flags & XFS_DA_OP_RENAME)) { + goto out; /* - * Added a "remote" value, just clear the incomplete flag. + * Commit the flag value change and start the next trans in + * series */ - if (args->rmtblkno > 0) - error = xfs_attr3_leaf_clearflag(args); - goto out; - } - - /* - * If this is an atomic rename operation, we must "flip" the incomplete - * flags on the "new" and "old" attribute/value pairs so that one - * disappears and one appears atomically. Then we must remove the "old" - * attribute/value pair. - * - * In a separate transaction, set the incomplete flag on the "old" attr - * and clear the incomplete flag on the "new" attr. - */ - error = xfs_attr3_leaf_flipflags(args); - if (error) - goto out; - /* - * Commit the flag value change and start the next trans in series - */ - error = xfs_trans_roll_inode(&args->trans, args->dp); - if (error) - goto out; + dac->dela_state = XFS_DAS_FLIP_NFLAG; + return -EAGAIN; - /* - * Dismantle the "old" attribute/value pair by removing a "remote" value - * (if it exists). - */ - xfs_attr_restore_rmt_blk(args); + case XFS_DAS_FLIP_NFLAG: + /* + * Dismantle the "old" attribute/value pair by removing a + * "remote" value (if it exists). + */ + xfs_attr_restore_rmt_blk(args); - if (args->rmtblkno) { error = xfs_attr_rmtval_invalidate(args); if (error) return error; - error = xfs_attr_rmtval_remove(args); - if (error) - return error; - } + /* fallthrough */ + case XFS_DAS_RM_NBLK: + /* Set state in case xfs_attr_rmtval_remove returns -EAGAIN */ + dac->dela_state = XFS_DAS_RM_NBLK; + if (args->rmtblkno) { + error = __xfs_attr_rmtval_remove(dac); + if (error) + return error; + + dac->dela_state = XFS_DAS_CLR_FLAG; + return -EAGAIN; + } - error = xfs_attr_node_addname_clear_incomplete(args); + /* fallthrough */ + case XFS_DAS_CLR_FLAG: + /* + * The last state for node format. Look up the old attr and + * remove it. + */ + error = xfs_attr_node_addname_clear_incomplete(dac); + break; + default: + ASSERT(dac->dela_state != XFS_DAS_RM_SHRINK); + break; + } out: return error; } + /* * Return EEXIST if attr is found, or ENOATTR if not */ @@ -997,18 +1081,18 @@ xfs_attr_node_hasname( STATIC int xfs_attr_node_addname_find_attr( - struct xfs_da_args *args, - struct xfs_da_state **state) + struct xfs_delattr_context *dac) { - int retval; + struct xfs_da_args *args = dac->da_args; + int retval; /* * Search to see if name already exists, and get back a pointer * to where it should go. */ - retval = xfs_attr_node_hasname(args, state); + retval = xfs_attr_node_hasname(args, &dac->da_state); if (retval != -ENOATTR && retval != -EEXIST) - goto error; + return retval; if (retval == -ENOATTR && (args->attr_flags & XATTR_REPLACE)) goto error; @@ -1034,8 +1118,8 @@ xfs_attr_node_addname_find_attr( return 0; error: - if (*state) - xfs_da_state_free(*state); + if (dac->da_state) + xfs_da_state_free(dac->da_state); return retval; } @@ -1048,19 +1132,23 @@ error: * * "Remote" attribute values confuse the issue and atomic rename operations * add a whole extra layer of confusion on top of that. + * + * This routine is meant to function as a delayed operation, and may return + * -EAGAIN when the transaction needs to be rolled. Calling functions will need + * to handle this, and recall the function until a successful error code is + *returned. */ STATIC int xfs_attr_node_addname( - struct xfs_da_args *args, - struct xfs_da_state *state) + struct xfs_delattr_context *dac) { - struct xfs_da_state_blk *blk; - struct xfs_inode *dp; - int error; + struct xfs_da_args *args = dac->da_args; + struct xfs_da_state *state = dac->da_state; + struct xfs_da_state_blk *blk; + int error; trace_xfs_attr_node_addname(args); - dp = args->dp; blk = &state->path.blk[state->path.active-1]; ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC); @@ -1077,18 +1165,15 @@ xfs_attr_node_addname( error = xfs_attr3_leaf_to_node(args); if (error) goto out; - error = xfs_defer_finish(&args->trans); - if (error) - goto out; /* - * Commit the node conversion and start the next - * trans in the chain. + * Now that we have converted the leaf to a node, we can + * roll the transaction, and try xfs_attr3_leaf_add + * again on re-entry. No need to set dela_state to do + * this. dela_state is still unset by this function at + * this point. */ - error = xfs_trans_roll_inode(&args->trans, dp); - if (error) - goto out; - + dac->flags |= XFS_DAC_DEFER_FINISH; return -EAGAIN; } @@ -1101,9 +1186,7 @@ xfs_attr_node_addname( error = xfs_da3_split(state); if (error) goto out; - error = xfs_defer_finish(&args->trans); - if (error) - goto out; + dac->flags |= XFS_DAC_DEFER_FINISH; } else { /* * Addition succeeded, update Btree hashvals. @@ -1120,8 +1203,9 @@ out: STATIC int xfs_attr_node_addname_clear_incomplete( - struct xfs_da_args *args) + struct xfs_delattr_context *dac) { + struct xfs_da_args *args = dac->da_args; struct xfs_da_state *state = NULL; struct xfs_da_state_blk *blk; int retval = 0; diff --git a/libxfs/xfs_attr.h b/libxfs/xfs_attr.h index 1267ea8..8de5d1d 100644 --- a/libxfs/xfs_attr.h +++ b/libxfs/xfs_attr.h @@ -164,6 +164,264 @@ struct xfs_attr_list_context { * v * done * + * + * Below is a state machine diagram for attr set operations. + * + * It seems the challenge with understanding this system comes from trying to + * absorb the state machine all at once, when really one should only be looking + * at it with in the context of a single function. Once a state sensitive + * function is called, the idea is that it "takes ownership" of the + * state machine. It isn't concerned with the states that may have belonged to + * it's calling parent. Only the states relevant to itself or any other + * subroutines there in. Once a calling function hands off the state machine to + * a subroutine, it needs to respect the simple rule that it doesn't "own" the + * state machine anymore, and it's the responsibility of that calling function + * to propagate the -EAGAIN back up the call stack. Upon reentry, it is + * committed to re-calling that subroutine until it returns something other than + * -EAGAIN. Once that subroutine signals completion (by returning anything other + * than -EAGAIN), the calling function can resume using the state machine. + * + * xfs_attr_set_iter() + * │ + * v + * ┌─y─ has an attr fork? + * │ | + * │ n + * │ | + * │ V + * │ add a fork + * │ │ + * └──────────┤ + * │ + * V + * ┌─── is shortform? + * │ │ + * │ y + * │ │ + * │ V + * │ xfs_attr_set_fmt + * │ | + * │ V + * │ xfs_attr_try_sf_addname + * │ │ + * │ V + * │ had enough ──y──> done + * │ space? + * n │ + * │ n + * │ │ + * │ V + * │ transform to leaf + * │ │ + * │ V + * │ hold the leaf buffer + * │ │ + * │ V + * │ return -EAGAIN + * │ Re-enter in + * │ leaf form + * │ + * └─> release leaf buffer + * if needed + * │ + * V + * ┌───n── fork has + * │ only 1 blk? + * │ │ + * │ y + * │ │ + * │ v + * │ xfs_attr_leaf_try_add() + * │ │ + * │ v + * │ had enough ──────────────y─────────────┐ + * │ space? │ + * │ │ │ + * │ n │ + * │ │ │ + * │ v │ + * │ return -EAGAIN │ + * │ re-enter in │ + * │ node form │ + * │ │ │ + * └──────────┤ │ + * │ │ + * V │ + * xfs_attr_node_addname_find_attr │ + * determines if this │ + * is create or rename │ + * find space to store attr │ + * │ │ + * v │ + * xfs_attr_node_addname │ + * │ │ + * v │ + * fits in a node leaf? ────n─────┐ │ + * │ ^ v │ + * │ │ single leaf node? │ + * │ │ │ │ │ + * y │ y n │ + * │ │ │ │ │ + * v │ v v │ + * update │ grow the leaf split if │ + * hashvals └── return -EAGAIN needed │ + * │ retry leaf add │ │ + * │ on reentry │ │ + * ├────────────────────────────┘ │ + * │ │ + * v │ + * need to alloc │ + * ┌─y── or flip flag? │ + * │ │ │ + * │ n │ + * │ │ │ + * │ v │ + * │ done │ + * │ │ + * │ │ + * │ XFS_DAS_FOUND_LBLK <────────────────┘ + * │ │ + * │ V + * │ xfs_attr_leaf_addname() + * │ │ + * │ v + * │ ┌──first time through? + * │ │ │ + * │ │ y + * │ │ │ + * │ n v + * │ │ if we have rmt blks + * │ │ find space for them + * │ │ │ + * │ └──────────┤ + * │ │ + * │ v + * │ still have + * │ ┌─n─ blks to alloc? <──┐ + * │ │ │ │ + * │ │ y │ + * │ │ │ │ + * │ │ v │ + * │ │ alloc one blk │ + * │ │ return -EAGAIN ──┘ + * │ │ re-enter with one + * │ │ less blk to alloc + * │ │ + * │ │ + * │ └───> set the rmt + * │ value + * │ │ + * │ v + * │ was this + * │ a rename? ──n─┐ + * │ │ │ + * │ y │ + * │ │ │ + * │ v │ + * │ flip incomplete │ + * │ flag │ + * │ │ │ + * │ v │ + * │ XFS_DAS_FLIP_LFLAG │ + * │ │ │ + * │ v │ + * │ need to remove │ + * │ old bks? ──n──┤ + * │ │ │ + * │ y │ + * │ │ │ + * │ V │ + * │ remove │ + * │ ┌───> old blks │ + * │ │ │ │ + * │ XFS_DAS_RM_LBLK │ │ + * │ ^ │ │ + * │ │ v │ + * │ └──y── more to │ + * │ remove? │ + * │ │ │ + * │ n │ + * │ │ │ + * │ v │ + * │ XFS_DAS_RD_LEAF │ + * │ │ │ + * │ v │ + * │ remove leaf │ + * │ │ │ + * │ v │ + * │ shrink to sf │ + * │ if needed │ + * │ │ │ + * │ v │ + * │ done <──────┘ + * │ + * └──────> XFS_DAS_FOUND_NBLK + * │ + * v + * ┌─────n── need to + * │ alloc blks? + * │ │ + * │ y + * │ │ + * │ v + * │ find space + * │ │ + * │ v + * │ ┌─>XFS_DAS_ALLOC_NODE + * │ │ │ + * │ │ v + * │ │ alloc blk + * │ │ │ + * │ │ v + * │ └──y── need to alloc + * │ more blocks? + * │ │ + * │ n + * │ │ + * │ v + * │ set the rmt value + * │ │ + * │ v + * │ was this + * └────────> a rename? ──n─┐ + * │ │ + * y │ + * │ │ + * v │ + * flip incomplete │ + * flag │ + * │ │ + * v │ + * XFS_DAS_FLIP_NFLAG │ + * │ │ + * v │ + * need to │ + * remove blks? ─n──┤ + * │ │ + * y │ + * │ │ + * v │ + * remove │ + * ┌────────> old blks │ + * │ │ │ + * XFS_DAS_RM_NBLK │ │ + * ^ │ │ + * │ v │ + * └──────y── more to │ + * remove │ + * │ │ + * n │ + * │ │ + * v │ + * XFS_DAS_CLR_FLAG │ + * │ │ + * v │ + * clear flags │ + * │ │ + * ├──────────┘ + * │ + * v + * done */ /* @@ -180,12 +438,22 @@ enum xfs_delattr_state { XFS_DAS_RMTBLK, /* Removing remote blks */ XFS_DAS_RM_NAME, /* Remove attr name */ XFS_DAS_RM_SHRINK, /* We are shrinking the tree */ + XFS_DAS_FOUND_LBLK, /* We found leaf blk for attr */ + XFS_DAS_FOUND_NBLK, /* We found node blk for attr */ + XFS_DAS_FLIP_LFLAG, /* Flipped leaf INCOMPLETE attr flag */ + XFS_DAS_RM_LBLK, /* A rename is removing leaf blocks */ + XFS_DAS_RD_LEAF, /* Read in the new leaf */ + XFS_DAS_ALLOC_NODE, /* We are allocating node blocks */ + XFS_DAS_FLIP_NFLAG, /* Flipped node INCOMPLETE attr flag */ + XFS_DAS_RM_NBLK, /* A rename is removing node blocks */ + XFS_DAS_CLR_FLAG, /* Clear incomplete flag */ }; /* * Defines for xfs_delattr_context.flags */ #define XFS_DAC_DEFER_FINISH 0x01 /* finish the transaction */ +#define XFS_DAC_LEAF_ADDNAME_INIT 0x02 /* xfs_attr_leaf_addname init*/ /* * Context used for keeping track of delayed attribute operations @@ -193,6 +461,11 @@ enum xfs_delattr_state { struct xfs_delattr_context { struct xfs_da_args *da_args; + /* Used in xfs_attr_rmtval_set_blk to roll through allocating blocks */ + struct xfs_bmbt_irec map; + xfs_dablk_t lblkno; + int blkcnt; + /* Used in xfs_attr_node_removename to roll through removing blocks */ struct xfs_da_state *da_state; @@ -220,7 +493,6 @@ int xfs_attr_set_args(struct xfs_da_args *args); int xfs_has_attr(struct xfs_da_args *args); int xfs_attr_remove_args(struct xfs_da_args *args); int xfs_attr_remove_iter(struct xfs_delattr_context *dac); -int xfs_attr_trans_roll(struct xfs_delattr_context *dac); bool xfs_attr_namecheck(const void *name, size_t length); void xfs_delattr_context_init(struct xfs_delattr_context *dac, struct xfs_da_args *args); diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c index e41bbb2..5a0699e 100644 --- a/libxfs/xfs_attr_remote.c +++ b/libxfs/xfs_attr_remote.c @@ -438,9 +438,9 @@ xfs_attr_rmtval_get( /* * Find a "hole" in the attribute address space large enough for us to drop the - * new attribute's value into + * new attributes value into */ -STATIC int +int xfs_attr_rmt_find_hole( struct xfs_da_args *args) { @@ -467,7 +467,7 @@ xfs_attr_rmt_find_hole( return 0; } -STATIC int +int xfs_attr_rmtval_set_value( struct xfs_da_args *args) { @@ -627,6 +627,69 @@ xfs_attr_rmtval_set( } /* + * Find a hole for the attr and store it in the delayed attr context. This + * initializes the context to roll through allocating an attr extent for a + * delayed attr operation + */ +int +xfs_attr_rmtval_find_space( + struct xfs_delattr_context *dac) +{ + struct xfs_da_args *args = dac->da_args; + struct xfs_bmbt_irec *map = &dac->map; + int error; + + dac->lblkno = 0; + dac->blkcnt = 0; + args->rmtblkcnt = 0; + args->rmtblkno = 0; + memset(map, 0, sizeof(struct xfs_bmbt_irec)); + + error = xfs_attr_rmt_find_hole(args); + if (error) + return error; + + dac->blkcnt = args->rmtblkcnt; + dac->lblkno = args->rmtblkno; + + return 0; +} + +/* + * Write one block of the value associated with an attribute into the + * out-of-line buffer that we have defined for it. This is similar to a subset + * of xfs_attr_rmtval_set, but records the current block to the delayed attr + * context, and leaves transaction handling to the caller. + */ +int +xfs_attr_rmtval_set_blk( + struct xfs_delattr_context *dac) +{ + struct xfs_da_args *args = dac->da_args; + struct xfs_inode *dp = args->dp; + struct xfs_bmbt_irec *map = &dac->map; + int nmap; + int error; + + nmap = 1; + error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)dac->lblkno, + dac->blkcnt, XFS_BMAPI_ATTRFORK, args->total, + map, &nmap); + if (error) + return error; + + ASSERT(nmap == 1); + ASSERT((map->br_startblock != DELAYSTARTBLOCK) && + (map->br_startblock != HOLESTARTBLOCK)); + + /* roll attribute extent map forwards */ + dac->lblkno += map->br_blockcount; + dac->blkcnt -= map->br_blockcount; + + return 0; +} + +/* * Remove the value associated with an attribute by deleting the * out-of-line buffer that it is stored on. */ @@ -668,37 +731,6 @@ xfs_attr_rmtval_invalidate( } /* - * Remove the value associated with an attribute by deleting the - * out-of-line buffer that it is stored on. - */ -int -xfs_attr_rmtval_remove( - struct xfs_da_args *args) -{ - int error; - struct xfs_delattr_context dac = { - .da_args = args, - }; - - trace_xfs_attr_rmtval_remove(args); - - /* - * Keep de-allocating extents until the remote-value region is gone. - */ - do { - error = __xfs_attr_rmtval_remove(&dac); - if (error && error != -EAGAIN) - break; - - error = xfs_attr_trans_roll(&dac); - if (error) - return error; - } while (true); - - return error; -} - -/* * Remove the value associated with an attribute by deleting the out-of-line * buffer that it is stored on. Returns -EAGAIN for the caller to refresh the * transaction and re-call the function. Callers should keep calling this diff --git a/libxfs/xfs_attr_remote.h b/libxfs/xfs_attr_remote.h index 002fd30..8ad68d5 100644 --- a/libxfs/xfs_attr_remote.h +++ b/libxfs/xfs_attr_remote.h @@ -10,9 +10,12 @@ int xfs_attr3_rmt_blocks(struct xfs_mount *mp, int attrlen); int xfs_attr_rmtval_get(struct xfs_da_args *args); int xfs_attr_rmtval_set(struct xfs_da_args *args); -int xfs_attr_rmtval_remove(struct xfs_da_args *args); int xfs_attr_rmtval_stale(struct xfs_inode *ip, struct xfs_bmbt_irec *map, xfs_buf_flags_t incore_flags); int xfs_attr_rmtval_invalidate(struct xfs_da_args *args); int __xfs_attr_rmtval_remove(struct xfs_delattr_context *dac); +int xfs_attr_rmt_find_hole(struct xfs_da_args *args); +int xfs_attr_rmtval_set_value(struct xfs_da_args *args); +int xfs_attr_rmtval_set_blk(struct xfs_delattr_context *dac); +int xfs_attr_rmtval_find_space(struct xfs_delattr_context *dac); #endif /* __XFS_ATTR_REMOTE_H__ */ From patchwork Tue Jul 27 06:18:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401753 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E13BFC4338F for ; Tue, 27 Jul 2021 06:20:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB19061108 for ; Tue, 27 Jul 2021 06:20:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235656AbhG0GT7 (ORCPT ); Tue, 27 Jul 2021 02:19:59 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:25844 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235502AbhG0GTu (ORCPT ); Tue, 27 Jul 2021 02:19:50 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6G22C022403 for ; Tue, 27 Jul 2021 06:19:50 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 : content-type : mime-version; s=corp-2021-07-09; bh=OGa6uxGlhJRDPVN+aqgMjwlAk1ecAPHTmxHJLss/soE=; b=AF6GRoRcp+QMJYiqvIVzqXEmH+XP9GEQH3H6cBmEPo4kyp+H1S0f9r+j6SXxy0ifDlj2 yvL8IF+jxrnlHaCt11OUP8D7//m+TuyP5vPeEEIb90tY2VckEaXxptix4djnntF8TbBQ 8LPdnxwfqnh2fOyzjhIpji6xvq53Kudhl4jkWv8Nac5VTRejcMN92q7UskGPbMKbUPHO /rzKon6DBimuYsKKpYsFFHN3Utp0O3G3SR0PHB64Yo0xllvNm0txvb3pspDZzYq/h3mp 5bfHvUUyn6JQmEGn44KSBHNsBQSj4w/ixJg+LMbHtQC88mzZGzLcv+qNUUrG+x4VjEKJ jQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=OGa6uxGlhJRDPVN+aqgMjwlAk1ecAPHTmxHJLss/soE=; b=p3oMMjow6qFTw6NCPj/ieDfaGwWZ//fDTDsDx3uH/qhZ8bAuzZB5CrEuiihcF8/Eer95 EyKcDCUEzyhed4oRzGN2kuQDJDHB1ASjTa+dfAAIKuhgvrxnuSSNbRfyEDMch3rYxkky Ed+dHX1zYFD1WY4PNKhGXDCgLngYe7vzzanXYS9kOEXm6eEg9xteF6zSSzL9a1aoXR09 VWiMyBdYgNK+jR3NEQjjlDxGXN3+vRByYWdCY9G4MhlPdQW8F2NWPiZDS/vqnuAhVjZE WSfkzCBAxDqzsWS6borOwWzrJz5us5S86SS5zK7mC04Cqi7i/2sWEGj6vVMTGnbhepvR fg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a23588umw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:50 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6EiaF065026 for ; Tue, 27 Jul 2021 06:19:49 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by userp3020.oracle.com with ESMTP id 3a234uvnq3-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aVkt+njBNMVGCW5KycbXP5huHFVwN14iaZq7ZUqlqxsu5qXxpsezqsozW/Q3bn50TNAz6eCfDsoIPnGJHTiwuTNA/4NHOk90cio0YIx3/vFf6bs7a5HGujwALlFfJeilQTemP/ATU5y1mrUhEt1Dcy4lCGdCxDDN9B3GfYSgXAIxLfQHOGU7p40ApRGcOLjMrI9e0smHKJCpgPYH7ylHXjI2xvOvvsbBvuHex+Uzl1DFSe8poa32JrKMzl8wYGaVsSFtdE/8ABxZjKzGWD4QxYZUkF+X40m9HSeF3hjY640dQhLo57Xv9AWWzOZ71NX43uQOaLgBmA0Swg0AYsOxug== 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-SenderADCheck; bh=OGa6uxGlhJRDPVN+aqgMjwlAk1ecAPHTmxHJLss/soE=; b=LrHDuZ+dtJ8EaAfw+ZuT2KCwDY+fCwzfeJ9E0WoEry6zkyirk3kf18aD9Vghd6e849ssDU4RuvkyhEt1sUKxQ1+JD6MfFB4RHngDTZBXpCPaVB9w3aLfSLGN2nu/4Wcy75foFZqVJi7/Dth9kFN2mE4reKIfbHoK7TFiqOnbZPwRosynlbK9Pd4wR7sv02YD0hDylHE2bz6CUorvvfaVUFik54qCjOH6S2IS3rn8Y1CLtuL/Oyxh2Cy3m0s6tnKLL+JFVcrR7C+cFmjGUkFiHkVbiNLylSjoGNK3zZB9c3A4eY582u/+jAW0GLBl9TubtUOWQzKT8u842wdudeKODA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OGa6uxGlhJRDPVN+aqgMjwlAk1ecAPHTmxHJLss/soE=; b=QVzXDl9069+PcE7OwWG3LgXFjutn2Z6Cvf8oj+GDrGD/G8O4iCzZlyxKRogYADHCvDu1ojiTNUB8HwwsAKN/Xh/mpicGympKp667n9hLYCouokva57b42mrqenqeExa4QRZKcuv+gMTkEDyDK2ikODAVdJpybOTt6FGh26vy4jY= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB3669.namprd10.prod.outlook.com (2603:10b6:a03:119::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17; Tue, 27 Jul 2021 06:19:43 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:43 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 11/27] xfsprogs: Remove xfs_attr_rmtval_set Date: Mon, 26 Jul 2021 23:18:48 -0700 Message-Id: <20210727061904.11084-12-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 897e72e8-65a4-4c32-e3cc-08d950c68610 X-MS-TrafficTypeDiagnostic: BYAPR10MB3669: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5G8R5uMovoE+hVwg7xegOv0nGBfTqaev6Pr1HJotuZrMewbr+Hh6DD6Uh/XFx5tmf2eYOBKX8bWthX20Rcwd8YL5W9YYQYlXIhbQeBwuiqInCza6YDXNPhnbmXRdkPZfxkSoyBKRBLX4J53LIpu/8ybnOT02yWWvSBL9YEyBkNZnYvGJe2y2sl4mSTBsUtlH1cm0T9QEqq8wY2XA1fWC8qBubs5QUAxPCxw0mFV5thITIO3ib2IuMO3PlHJUYg/inwNZDArRPxsxw1tcWCF0YPMW7HXwDGVf1E+uIaW++L/9xL39odxmpPIU4HQhl/lZg4gyZaVHtPu7UWuD5bwEWugDeSbdkjeXTxJDWDlZsWAs4f5iSQbItKtZj3SKHVq6Qqktv1KCvg7zqecyp11Ak+8kmQ8y6at2k1P4FeZfFEZovP7rD5CF/itbDu82s0jDQE4jnMnqgiqTksuT0WLJA49H+szdHoYzjNsJbthhJggyAD8hB32gU973iSoYSCt/Jhhhn0zWda9Ff3AUdogXtQHEz9U6/Kg5AEH+vQz3Ew8WKqkK0ZPuxEUYhu1uQlOJw1Zg/fILPv5ZOmNlLMfAdLO365uGY/bfMVmXsHlVHf9P9rKoCwRsu7aNehA4gusqhY86cU4SiauV2ugLj7nwxbFVYZNzBPyTtsMiwAYVlnNfZJHFRrrnIMZTRTJLs7CtlNxtx+aaHacZsV+ZzgwLGA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(346002)(396003)(136003)(39860400002)(366004)(44832011)(478600001)(38100700002)(38350700002)(52116002)(2906002)(6486002)(186003)(6512007)(26005)(1076003)(8936002)(8676002)(83380400001)(6506007)(5660300002)(36756003)(6916009)(86362001)(956004)(2616005)(316002)(66556008)(66946007)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Hkob5EgNrtqfUb1c6jRjSebyOSI42391qHncv3+4+EcuaeIbJiJt1safgBN4Soa37/it0FBwTrCD80JNhGQphVK7uWHK7/r67+VijIeEuJFf94PPhjqsMS+nF6mHx7oV7DVDL0h/AgKyRCVOz9N1uDYo6OPWs9QS1yQFP/jeTNmkUGqTiA1tpWBb+qjhBc+aymMfMhfFh5jdq3eNjbKrVluEZUawkDRHoLvPxASAD0Cvx81YPnyzsYfXUZJ/1oai49swSsvDzI+zNi1hPwErmfvH5BnalHHNOOZYsnuIN0NLprsxux14mhqCgawxtzHNLjJM8AXXtpkQCmOuXKQJJokaHtPW0SQc0x/79MTb1NarBNwgSPr8qDYCEMxRpuNr/1PytitWbZZkM7RhCA637+Y6+EzCZ13X+W86dYUDJhPsMpLWc00dZb6KxezACGAPUL1mTfVtjd8lMc2oChD5pYgKGCbDC5q3PkTMD4RImO0rg68ikQ+3uN6awAqxahPaALiCWY2ZICItG6XNy+TkoyVNvnQOnXoHLssp7jgxhLhCVrAIylEGI7jvHQtI/8dre17bTTGmFH7+mzCWhPgzkLFtP5fPpGiGa+ufxeW0xZPxVIdSLdX1DIkJ+ZfMtjU33N4PWcGvxHBP0RNSE3ec1E3x8ViwXpubEOU4lbGRrjABz6JUWTLamkK/jIayKH4czrh0xF91TH0eCDEJS/GqV0ngs+OSHjAcC807dcCAViMq0EZ4e9CMPehRwdz1gVdLswL1i+wgurlfS+gQWx8cHuNkdIprmUal2sC2xJoUTukXZQ6/MLONRHjHT7fnLJ3he3FyrS+hW2e7zqA3Vmy3iFQyI9mWQk2PaV9u9NN00aSu3m43F9CrqmCzanJnBxvdaEwrGod3xNS9i6ezlNte92gST90Ob7SoO5NoQnUH/TJkuxcLrHsis31HHnhnx+Ko1s55Z1X6wAwIjJ5oqGtQJ+RvtA11dL3U/lAGejWH1Es8psefthXRP/zqNJml+wOa16FwDTgxlviJPU91c5z1n0uyHEwco0D/wGoMT95brIJwz++g+Ax1mK7DhUJ5Iqz18rDSDQ/9nOVh6cd1AwM6dLVD7qdSFEv62TukWTVs6B4IfVOibrDkKpPQJFsYjtK5QqPd8SbRKPZHyH3tvWfdjMB0rBc2a0wTAWpPa8YKQS8DE/U/++cdmYUuSGp/Tceaj+pL6ZAtDh4bIxueBxkxXuUTrKznwKZYMmWEpOGLe3VMuWXzIvLVqGvO7Ig5onql5W+RJkttTkvYC1CdcuD8KmHUw0ASYVb+V0gI/rho5VcOLvJqpud8nhvfXtNQlND9 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 897e72e8-65a4-4c32-e3cc-08d950c68610 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:43.4239 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: scJSKO46rN2wPw+zLR2CgGCJczSawfRy52cBW9GMDkb7umboV55dONSZk0I+0J4WQHogF9sBnJ4nJMBoUzpsZfn2RhpICUaXe6gbXz4GJhg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3669 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: 6wOPJWSO1w7VunoTfR_LQss5zdwRQ7MR X-Proofpoint-ORIG-GUID: 6wOPJWSO1w7VunoTfR_LQss5zdwRQ7MR Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This function is no longer used, so it is safe to remove Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R --- libxfs/xfs_attr_remote.c | 66 ------------------------------------------------ libxfs/xfs_attr_remote.h | 1 - 2 files changed, 67 deletions(-) diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c index 5a0699e..d474ad7 100644 --- a/libxfs/xfs_attr_remote.c +++ b/libxfs/xfs_attr_remote.c @@ -561,72 +561,6 @@ xfs_attr_rmtval_stale( } /* - * Write the value associated with an attribute into the out-of-line buffer - * that we have defined for it. - */ -int -xfs_attr_rmtval_set( - struct xfs_da_args *args) -{ - struct xfs_inode *dp = args->dp; - struct xfs_bmbt_irec map; - xfs_dablk_t lblkno; - int blkcnt; - int nmap; - int error; - - trace_xfs_attr_rmtval_set(args); - - error = xfs_attr_rmt_find_hole(args); - if (error) - return error; - - blkcnt = args->rmtblkcnt; - lblkno = (xfs_dablk_t)args->rmtblkno; - /* - * Roll through the "value", allocating blocks on disk as required. - */ - while (blkcnt > 0) { - /* - * Allocate a single extent, up to the size of the value. - * - * Note that we have to consider this a data allocation as we - * write the remote attribute without logging the contents. - * Hence we must ensure that we aren't using blocks that are on - * the busy list so that we don't overwrite blocks which have - * recently been freed but their transactions are not yet - * committed to disk. If we overwrite the contents of a busy - * extent and then crash then the block may not contain the - * correct metadata after log recovery occurs. - */ - nmap = 1; - error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)lblkno, - blkcnt, XFS_BMAPI_ATTRFORK, args->total, &map, - &nmap); - if (error) - return error; - error = xfs_defer_finish(&args->trans); - if (error) - return error; - - ASSERT(nmap == 1); - ASSERT((map.br_startblock != DELAYSTARTBLOCK) && - (map.br_startblock != HOLESTARTBLOCK)); - lblkno += map.br_blockcount; - blkcnt -= map.br_blockcount; - - /* - * Start the next trans in the chain. - */ - error = xfs_trans_roll_inode(&args->trans, dp); - if (error) - return error; - } - - return xfs_attr_rmtval_set_value(args); -} - -/* * Find a hole for the attr and store it in the delayed attr context. This * initializes the context to roll through allocating an attr extent for a * delayed attr operation diff --git a/libxfs/xfs_attr_remote.h b/libxfs/xfs_attr_remote.h index 8ad68d5..61b85b9 100644 --- a/libxfs/xfs_attr_remote.h +++ b/libxfs/xfs_attr_remote.h @@ -9,7 +9,6 @@ int xfs_attr3_rmt_blocks(struct xfs_mount *mp, int attrlen); int xfs_attr_rmtval_get(struct xfs_da_args *args); -int xfs_attr_rmtval_set(struct xfs_da_args *args); int xfs_attr_rmtval_stale(struct xfs_inode *ip, struct xfs_bmbt_irec *map, xfs_buf_flags_t incore_flags); int xfs_attr_rmtval_invalidate(struct xfs_da_args *args); From patchwork Tue Jul 27 06:18:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABE5FC432BE for ; Tue, 27 Jul 2021 06:20:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93BEC61107 for ; Tue, 27 Jul 2021 06:20:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235366AbhG0GUF (ORCPT ); Tue, 27 Jul 2021 02:20:05 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:51588 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235713AbhG0GTw (ORCPT ); Tue, 27 Jul 2021 02:19:52 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6G8Pr024355 for ; Tue, 27 Jul 2021 06:19:51 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 : content-type : mime-version; s=corp-2021-07-09; bh=lQ7yHCXNduofmZkZBZEo3bUHHiE9icaOB+GfVpap6t8=; b=qKlnY/Ffh5e+13KzwydVBX4ZpY/vUD7z9RGh47ITm2VC5FIb0IS5q9QzUteRHRZntDXx Y8qsFi97i4N92OARtsS4pCxczTDLV51WCXIa3jhCVv5e7kieVf1hdAXWefRTH7sdslWY zE7RGQyDLkSs7i/WANmdhnQ0EmJxNrOeD8w3CRYoboXhMtn51a3FeJQKvjUeWrtnB28N jqxSsPr+tjgymonIa05k/Hg+lUR0ivdzD/Pocks+qn/9/mlu8ta8TlEUOv31LDtj4ml9 Q7MY+uZ6M10kmKL0fY43NkNGy/APJyfvT052hWoroH7PgZYKXaTc6f53nSys0nc3FtAs 7Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=lQ7yHCXNduofmZkZBZEo3bUHHiE9icaOB+GfVpap6t8=; b=aBu8ctC1nFyw5PVQI/nsnYirl5OZuIOua7A6fCZjbZsW/mVN+0FprkuhpHBJ6+6HODSD KzhjzcjUgKisYUjxqpzIDAZKerw8Klgf+V1FvQKcNM2tYKYsxzidNqq0PJSx8AcTjomd VTbUzjijQuKJPtvYBG54FIuf0h0UYA3X5ufoEWK9A1XtaOt/yuU/mexg0PqzNT6yD0Jx Fx1nXsEK3INQAgrwHc99xhi8FAaqTBkzJOc53VLY2fdj6Nje545692/zXYSArA1arr8N 4vr8VvUsqaOkGHSggVSamz6txx4cPdz6aPPdfUTsrTamYoxIxFg1KFefEx0s0cuw98af OQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a235drunc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:51 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6EiaH065026 for ; Tue, 27 Jul 2021 06:19:50 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by userp3020.oracle.com with ESMTP id 3a234uvnq3-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eqUWS4EpVETsnJzbNSqmGmclh/rzfln2X1f87taWXEAw4DTnXmvQS2CsKAP4gAAMBEKlGM2fFQj814ja23JmDqaXyG3vxRUEGJ/5EnkNoGAAN95M5LL3FpybXsiSo5R2B+/YPp9gzG9zre16NaFM8vGlJL9E0u9x06BdBqTnYu0RodgeEPTJEvVe5GqQJ91PEtiVE3QA8+qZ5nZZObW0mx8qYickY8yMt1zZjUVJJDIvl1gsbV8TdyqOstx12h23NRD4OaDuaqHpDGQh4xvoBe+0ssIyr18T3iWcQDPbjCgZle2W3kan95WLgn2o+hj84jDehQzpIxyKhNzXD0Sv0g== 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-SenderADCheck; bh=lQ7yHCXNduofmZkZBZEo3bUHHiE9icaOB+GfVpap6t8=; b=l1PX9bUBCTTDEgR/sFBpuxaVZDkj6OgAXuWYcgjF/513CmVgwMVrGB8T9l7dNMs5jGzxumnw6WWiTuM4aAJLa9ig4ZPCc5e45M79JqjPm0zvxzG8un3ox5mhFvt4OOhy4j/iS1SEJQYbH6e0JQeANKvi9MzJ+hlhudTAMZ4/vfQjYEeKZ/9d7T4UYWv3QtgWwcV23tsp2P5nLgFb4FBD3eP+e4KpXr9OSdUVptsgEdU5VB83+oJJx381A1HDOIeWxv3YW/zLZ1Rc4oO9Py3mCppaPNJYLkkV9ROxTnl//ORENR1qCqDhV+e1hV6TltOY6i4ANnK51qE1V6Qr7R6D4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lQ7yHCXNduofmZkZBZEo3bUHHiE9icaOB+GfVpap6t8=; b=nUx0qm28oaqzRXP7rYyJyG6r3EE8GDMTrn/Xn37pMnPumrfP0FypK/CBLFpYbEA+Dn3AZlQlkdpK79tZYiwFsX/k1GbxUgpnyMglE8o+jIaWaQ5DmmzXRUGhg6nsh2OLxGgvyUzdWy6POAhoc/bzraN5jIPsF9MoiUu8RgTARC8= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB3669.namprd10.prod.outlook.com (2603:10b6:a03:119::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17; Tue, 27 Jul 2021 06:19:43 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:43 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 12/27] xfsprogs: Clean up xfs_attr_node_addname_clear_incomplete Date: Mon, 26 Jul 2021 23:18:49 -0700 Message-Id: <20210727061904.11084-13-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e67d1cb7-6788-4df4-94e5-08d950c68647 X-MS-TrafficTypeDiagnostic: BYAPR10MB3669: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:854; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uS6ReqtMSeIlo8C6G5yddzmX+ShuU3Uaf4bJaT1xKH8K5/61RcIYA1lC9+4aQtC29fcHjG1bRxv6+ZM4uixPgwM9vN5xLMuKSr9yT6SMLQx8dVtbgbVlRupn9vW4pgmdCEgrKUxk/3fN75hydgtJb79sujJ9N/uxU9ksqSR1dN09LuCYDIzuWpNuDnGkFwtrlapHmgLQOyjOA6PrV2SKfuCjBjdridVbPMNj4oopYNO6ad+i7U4IMCSe+ADJXHRoZa2/tLwwHXmLGRhh4EHayXARgk+Q5YS6DmJETZanguIR3snEFlnU6PqSbnV9ddZYmt/VfHcRCUZBELAtH0iMzv4iFmYc8RrgGKGArd0CfvUA8dxq0U61HYvyjDIIoctNWIw7zcqhYml82BV0RjwEoKey0kEkGs1si6PSXskocerLq6v8zeKWYbXHXIWvrwIjJRWsgj0J2zUXhUpnkooU4mnRBuIBo49izMM0r8AgBhsd3BTcrxL/ZPDdjeiO/+M33UPDeE3ukyX6NF/1piWdInA8CkRtHM9uuYvkpzMHvAMbS8iF+Ij0NkFmGpp1VgfuIz+S6BD+8TzIQ8rAWV1QENEotSIRhvyyBxLvw5JZio5JfyJc7AJWxpryD38QGRM2zlcEykYodIAsSc5IGnmUD6psH3zi7tMEgP6XHWa4ja7Zdro+kcYnc2SBjZuChWoeygySpNnK9uKmDYXTx1wF7w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(346002)(396003)(136003)(39860400002)(366004)(44832011)(478600001)(38100700002)(38350700002)(52116002)(2906002)(6486002)(186003)(6512007)(26005)(1076003)(8936002)(8676002)(83380400001)(6506007)(5660300002)(36756003)(6916009)(86362001)(956004)(2616005)(316002)(66556008)(66946007)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9541wzzX+OZ8wrmMFFqwWb9jpFdVoxSKA2UXYXU7wG91c7ysKDwTdX6aaDBaGWvE1O7Spu/CPGsZWk4fGphgYItdSJZKr55mjZ93JInVz3t7unz/t6NNJ3xIcBjaT4lJp44RJCjkcvPJm0jixfQ6mDyQZ2C/4pClDtHnrIqTg1W6/h0V7Z7ZMrfjoMFgf8orLIZCpv4gL1btlpQZgyqkGYoAvEtV7qV691FhqeR+KOOWIAoizLqsde8elEvejf3rXV9cN24xZhNeVgK5QXWxrL3Yu6weo/ANjebtN0l9r7j+y7XUq+HupPNSwpdQbHdi0qCmCtD86XII9QfoCB7fuDnYJW4z82vWOHq1c/VAiKCcQX+FjOIp0lv2s7RfzZY3Ee6Wz/Wkx70Bo+Re9BD0AynpVYsVlIRXKqaD9Y03hQ3c9+D7AnkjPYHexYcqScZB5yQ42SB14JvlLcLOXDQ2u+yJSDAfgNHig+P9yp6HhkqN7sYtyDo2d0FK3IaU3TV04kYA4VsyTL6cqA/QpyOV615xl+IZ9LIZICMptq/C5g3eaGiydP8kB7BVtk68IjaqbpJ+73bl5TWXvsWIRaGzhuFO5YndIatGzyVdgj1/JQx5N+/Nr6AmCyQKhLteff5ljyNtwIQHB5f63LZ9RSb6tjqmfW0A6ue0C1nxypbpELqZ8vahpaV/0F9IfXQYVC4e7xykJUjrGuLrJjLxS1tYDTe93o5+QDMETHxH863QXdMFOY2pYIZiFJBw+qwTR7HtJLm+yTBBpD7CaG6VxmPEb+VOIJWoTc/5ue9FsNh548NiHfeWpLKUmqxlYcFQ5Nqs54FsGbUirg9XnIs7eQWt7Jkc3fqt4Ug5gXkzbSUcYoH1/QvhBVb0zJjowqFqBxaphejJCOu0yGB/J84SjmSNExhpTibwfsvt3rltaj52CiLrY9gVJG067i8jgDDKSvz+xsqx13D/OzvNRFdQTCRZRKU9/cqsChz0fMqPui8RZGl8O/A3DL5Txe+IFsWORyaCrnz8JumMQdHPPfguBKWZYis+sEhouvSLg1sLkN1swBDrCdqHTb4alOZiwL2gUfbADYoks6+ysKxdjpYsayfiKg+/SiuFLhOxd6iSuNqrzyok74hIAIQVqdysqLt6SBTYrFQoNb5+l8bZUqwUAKU5e8Q51WRiqyURk5XciDCjusa94YhRA5iOZmTt+mEcUCYo+9WBYw4eB/RDSLZF/8+h2vEd4KemFaUt97MNFkWYH1VMYA8AHk9KzIKMi4dZjEyMiQ1aEcDICFyZoqNQIAIDNIL07bo9FukN+WpP/0UoUVq1dPhqxTEhjah1DXCOUzLj X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e67d1cb7-6788-4df4-94e5-08d950c68647 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:43.7823 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ldWM70QG8WYMj+/JWCVfJgVMJi1V9PD8rqnYIUzV0b0U+d8G3lQUN36dNUtm5jEeo5Dbc5zMxFHuEIGZ+QuivkPnAzbhz292+ImZWheFaAQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3669 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: QqUVRrD5KJjB7nqgkLgjJ7qTVAL7Fu6b X-Proofpoint-ORIG-GUID: QqUVRrD5KJjB7nqgkLgjJ7qTVAL7Fu6b Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Source kernel commit: 0c0dea93623d000994ee29f86abd836b258b5c80 We can use the helper function xfs_attr_node_remove_name to reduce duplicate code in this function Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- libxfs/xfs_attr.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 347f854..edc19de 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -63,6 +63,8 @@ STATIC int xfs_attr_fillstate(xfs_da_state_t *state); STATIC int xfs_attr_refillstate(xfs_da_state_t *state); STATIC int xfs_attr_set_iter(struct xfs_delattr_context *dac, struct xfs_buf **leaf_bp); +STATIC int xfs_attr_node_remove_name(struct xfs_da_args *args, + struct xfs_da_state *state); int xfs_inode_hasattr( @@ -1207,7 +1209,6 @@ xfs_attr_node_addname_clear_incomplete( { struct xfs_da_args *args = dac->da_args; struct xfs_da_state *state = NULL; - struct xfs_da_state_blk *blk; int retval = 0; int error = 0; @@ -1222,13 +1223,7 @@ xfs_attr_node_addname_clear_incomplete( if (error) goto out; - /* - * Remove the name and update the hashvals in the tree. - */ - blk = &state->path.blk[state->path.active-1]; - ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC); - error = xfs_attr3_leaf_remove(blk->bp, args); - xfs_da3_fixhashpath(state, &state->path); + error = xfs_attr_node_remove_name(args, state); /* * Check to see if the tree needs to be collapsed. From patchwork Tue Jul 27 06:18:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401727 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73E3BC43216 for ; Tue, 27 Jul 2021 06:19:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5935D6112D for ; Tue, 27 Jul 2021 06:19:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235657AbhG0GTt (ORCPT ); Tue, 27 Jul 2021 02:19:49 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:47236 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235103AbhG0GTr (ORCPT ); Tue, 27 Jul 2021 02:19:47 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6GEfd024383 for ; Tue, 27 Jul 2021 06:19:47 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 : content-type : mime-version; s=corp-2021-07-09; bh=kiDyIO2fQL1a+p6wS4Mq4fwmpcxMFkzeeIfEbOhnLsA=; b=pE+Yydjd2FPXDqTSOKIC9aC9UzSEKOY6ydYdEEIlqR7ZIBtwU+0FynFGgVVxDJeSIdPp 6A15J5OaRhYwROpZw/GIDlH86ioD/cTJFgk51LQIzmOPX3p3dJL2b9HlTqUBCZbQWsCS nZGO9so/VuLsswC7nI7o+SiR8mNbpayE9vBIPoqOuU9N94Kd0fSqmfQ21S4siQEO/rAz YEerXVGmfGH2uEMPoc2FSpAFsH2Qelrvif5RZAn+cQ4kucgDqreIGivJNzWtQXqTdGVK 7gQDyABgZlucWBY3BG3/A62h4nlGRynL1ZiT8Mph3mwr23jWGEqVDrto1NcsjRNbVFbk BQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=kiDyIO2fQL1a+p6wS4Mq4fwmpcxMFkzeeIfEbOhnLsA=; b=pKLjnX7EytuTTlpJoPFyMfbQu4aNidmzlM0VQiWVKaZ01y9C4ODufMKv2Hjzdy7LsQrp co4SZ3PA3maomH3pLmfEYraRlfyvZ4Kg6xp43xCyfeqhZrwsKgysqIQkiIIw+c5g7WgJ 99NkpgbzlnYXk+L8uC32+SrwTRwgPdZ9ljxw4uZHK9xSD7E808B9M7/b0wuftFgPR4A6 tR/OMXBCQ9uqzA0g8wQNcZzEF8dx6MJVbtGWtdnFA5fdrdRZ5RDaI6Ev2a26EuGhhKV7 iejF70hR/T2rALCWwxtRDk+13mEvt5CppnhuDoDScLoMiDOJoKhBo1X4aFrlonXpz5h7 pw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3a235drun2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:46 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6FUJ4019917 for ; Tue, 27 Jul 2021 06:19:46 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by aserp3020.oracle.com with ESMTP id 3a2347jxeb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H3wzUY06RY8ngjBuXQpG9zXC83p0gvJstv1mL4zS8245dUeY0a/Ab8u0FAVgOE9fT4zkolMG7RdjJhqgdHeKhzl5xmREr76yz4KtAI3IK0asSITVRW2+hMyY1uGb2Y56ZH1dJw3gVIUXaOnmoLjEVkmS1cMUoWmhBvabkjIMOTf6jpplH0V1PwnR0DF5N0UwNQ1Td+53gcrH+vwiPUI5Pqk5kKf4nEQ7iScCJg6oHzDGBzpAL01hKudgRYW2eBaYDtzuNPN+Ta0oAypl8ByoYNd9lmU/tedXizH48ZSpJE6bYgBTEoO1Ms+O+pDrauJ3WMMafYX4QwVQiDaPPBQBSQ== 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-SenderADCheck; bh=kiDyIO2fQL1a+p6wS4Mq4fwmpcxMFkzeeIfEbOhnLsA=; b=X40BCQ/gs9Y6TYHw7R0uCjLrM/R23R5EEu25Xdf14MvwKoGmQKMB4VxoM44H1/6Xb3s08oVuLjz2QYROhPdv4TDXgLnzNTIf2IjtcAMOGh15XKH3W3iOWnlxsZESxnQ2m4xRQaqmv/5mcwgaP3PzNmQ23AtdygqlcqA7tt4mMVlfobbXd45pE0PjeSBjcwnMZqGyrD7+qUgfxDSPjCd6MS7SxEUhN+O6LY04+IswtlqN1te7glTXtkLlfO0hfJOlxYOAeAtb3jc2/2e+Bx3hhLvhiNRHZe4vJxmGbZV7GgTKb7j6R0S9JfgLQFEtk79X0RNaxAVcIjyIs67rNelVEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kiDyIO2fQL1a+p6wS4Mq4fwmpcxMFkzeeIfEbOhnLsA=; b=gZUYL0VZguwy4F1/LkXMfut+oefd3zOBjCcuBxkAwkIX+NMocGgtpzkKBmuvwgqhpPcJCHjTr+p5mW4Jq+vE4ncEumMijwQDKfvdQ8+mQ/IcXwAz/2zrBkYsCucSEqz1AYZ0tDMlxCE7TksXiB6pOENq5r/dzulBkj0OZHr39Tk= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2791.namprd10.prod.outlook.com (2603:10b6:a03:83::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:44 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:44 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 13/27] xfsprogs: Fix default ASSERT in xfs_attr_set_iter Date: Mon, 26 Jul 2021 23:18:50 -0700 Message-Id: <20210727061904.11084-14-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 35c0a500-c384-46af-fb9b-08d950c68682 X-MS-TrafficTypeDiagnostic: BYAPR10MB2791: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lQogbXCzJ6NFs6y9WeI3gs2TLABtdAUFXzKflIMR3ovejTZyw3zNGTkFe+UZqnCoObDBd19G4QzNBOY684zL8Cmw97wPXxg7kbPCP9rcBjVnDcMdGL1WY4VhNy3W27CvYM6k1melgWiizJFXBpUsTw9YP/2nBSk7q3TwRz6+jWzSjF/O65LcgvkcdP0ZySgcbH6zD26VJ3vYZQP0WZCG9wNjsIqfg13yckUjvYhGD4Q+DNdLh2h5BlhCKXrMniwCstZlV205GC+ZzdmBWDfw8v9KXQG+zwZjWf68ihkzjTmXGpb05mRqUcQAbmi7TaN2zaa78Hi9DZYdIq/RlQKUK5Tnr8GdWMJ2GTmKDezFdKqLY3RdmMOS05uXaWHrg4kxTmq5JpivdbEOIjl4Jtf5Y8IkleT04x8B3CG6eCXW3x8EOCDR9S2b+zJD2McYc5vzPFTTw9RBb6ehfap3mEG81Ca53HziYLE2CCcmmBNFTiqHZs3SjQ75E8xXc/s55CwtSyuebzQai7FDu0aRqAVPZglcn1IvzXywwpyWK11xgBdU+kacCrWRbx0C4hZwqmvYbJVB+uUUdZXGRcr9aXJ7RRXYepIspj55PoC7xkO5KnWT6WI9RiCQAbddbzsnq4uVj3NwQQwLkWslAp86h55vkIUyl8YxLCjSQF3CG9wKgneoh7O77iEDvBG6PaHW5M9zCKYQO9F170b6TrRCddAUWA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(376002)(396003)(366004)(346002)(44832011)(2906002)(36756003)(52116002)(4744005)(86362001)(6916009)(83380400001)(8936002)(478600001)(956004)(1076003)(38350700002)(66476007)(6512007)(66946007)(38100700002)(66556008)(316002)(6506007)(6666004)(6486002)(26005)(5660300002)(8676002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Af+xzd85iXK3hcLe4Psugdy60qMOfIEvItgy1MrJSk6udNVZvXp9ZmjXbnaO9sI/0BNjlroSORvAc04qEv03qzE1d90cu3QjH+VzBdl52OwWXJ2ujEQqbuuTWSMMKaxZcugdaPD0H5DWgaJhT6xAuYcfxFxzE2ibI/bRsiraXO6R0hWPyplz6sbWY3fNioiaZnlsNlmXzdJuyifaz4g3FUGAT1WjyTaVy9bHNaIYgKscW0Okt3yjVyQNPqsJAPrzRCcW9mQ/t4JwmEOjIq99uZBzvENQU1ZOsfsEv48IubHjOnioiKnJXHq6TMsvQ61od11Ge8SLeGKzeyBXF1TCu54nI7wyX/DH0GW1EtZK4+36lya1+4iwsEeM31Nm/MTzgpUub4fFkay5jqFOoaNpfcYsZz1ParvijOVubvUcw3J7bLRTqDtwiWc8ae9n+0Q1YN3Bv0gD1Xp+sx0KGMt9Stsn5c1w0oTPTbDf6bIyAGjo8XgejPswr7RHDXZsGw81qf0yDw5p3Nn9j/SZ+aHJ3drS0Et7cRVvhzM/Ab15sMKDK43y//5GkPDl8BSiNqPQJB5zKAvS1vrZcXk0ylUtBPmoCrTTA+QUEBZFq5kBDYJjeJ0o2g+TA5xRbsnCtPXD+Uh4JrOc7y6D5mUr4PLdbwInthcCRJKRdLlt9jY/vIVOveAQQ0M9RKNNCbdSGaCpTe8Jyz3LxXbP0iFZnP6jbJJkV27eKeIntd5qTwRod1TJtC81k6t5mEUNowYUTeLbfXRI+Vhd90SGptddRSoC4MfQnAmXSwQIXwE3INcky6xlFnyU8qgn6YB4FkDvdHF6ZRSn6D072vlMNoeJC36L/A8FPik7qEQA64UIIAaZVknp3FUMSZBXjcciBM377FfnK6EhW9BYSE93YPK0KRtJpzp1U/T50nQSR2qxjPWSPcQ4yx97GG1ZxF/rfrcJUOsG1J5okRv2WyMomxWEb9xJGtlR7qI0116VSdbSPeWclC+uzPaqzQsGyl5vSlDo7cCISl8QiuPDCqqfcReITb+kSne6fFQi2dMlz83He9o2LJ8jChsjPBHuCLDO6ncU4l7AicEEqw3lNvIT0ki5mB6SGeV23CVwEFZsdh3uofR/rKK9sZYrRQ+Jj8915jv2BsMZ+NrDOfLcsuoq9BKfF0Tx73YWYucTEBYxirhRQn1lcsXrGVEGJhz4DNmg8cWLK7ivh4TUa7I7ACnK3jKGZPkQNCkaqL5SvUCx+B9VqgfRP8MRDU7jhW3AHFKwnffbFkGsuJ+My3Fk76WBE1/ntgSIdFoL2hSIqyl2hG3/eXHX5UHpX8s6WrWnbNeMG9tM/b49 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35c0a500-c384-46af-fb9b-08d950c68682 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:44.1895 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /ao73fJ3P6VAbU4/mX3nq8giDXs47CDMqNN4ZuoL1yynL0L4SmdZ//SNGtpuklft0IfhQdZrpECNAjaSgyxbhsdL0eUXMaymLlZZSFNz6vs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2791 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 suspectscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: D-2QWT0rdtVaC2v74FclUNjkSkWbWwaA X-Proofpoint-ORIG-GUID: D-2QWT0rdtVaC2v74FclUNjkSkWbWwaA Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This ASSERT checks for the state value of RM_SHRINK in the set path which should never happen. Change to ASSERT(0); Suggested-by: Darrick J. Wong Signed-off-by: Allison Henderson --- libxfs/xfs_attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index edc19de..cbac761 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -612,7 +612,7 @@ xfs_attr_set_iter( error = xfs_attr_node_addname_clear_incomplete(dac); break; default: - ASSERT(dac->dela_state != XFS_DAS_RM_SHRINK); + ASSERT(0); break; } out: From patchwork Tue Jul 27 06:18:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF659C4338F for ; Tue, 27 Jul 2021 06:19:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A243761108 for ; Tue, 27 Jul 2021 06:19:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235700AbhG0GTu (ORCPT ); Tue, 27 Jul 2021 02:19:50 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:47556 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235366AbhG0GTr (ORCPT ); Tue, 27 Jul 2021 02:19:47 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6HgR0023064 for ; Tue, 27 Jul 2021 06:19:47 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 : content-type : mime-version; s=corp-2021-07-09; bh=YCEbQMAALeA7FiKvFLmh9Cv2Eqg/ZsMf0JPpzI+bWEo=; b=j5k5Z4mfG3XMqa6im6N+bHI6xbeQJFfO1rcDXrAfO0qB9aGPPeC7FedUvB/bhZsBpYz7 AClIS4jZ7L6nCLgJuceV6Qy7miYjbXHv50hdeAsDJxu21URm01WjA88wbLStyV6sQNI9 Q3jEBYNezn5FswE+q0TuGH2D4mToCkR2gH0uotZ2UtUZaKpiH6likycO+cvswmkeRc4n anOPvI4w7CUHIMM9yVfjPOSuy9X4vXACHGuzOVjy+dWOcYrohtethlzxdWXLxFyDEkms TgWB7qVQnFtdVqk0KJfL6DRPJmUo6JSp7xA9nml+WxN/EhnpyofwSiGoLKt2ZSDA3U3w zg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=YCEbQMAALeA7FiKvFLmh9Cv2Eqg/ZsMf0JPpzI+bWEo=; b=pTPgOrzleLCUO2aY7pYdTrHhIAf7UokIikzZ0SYNmfzy6oOEM3VomZWlyf2svDL+azvo GuH7cXAfpZQCrX/h56njfHPMwRpVyBHUjalrSsl+xmNuYLHM/bcPnBFG4zHGVQB4G0tz 5zNQ6R2Nzf5wbL2eaNCkR5r4bHo1wSUsMQu+y6oYZrygIIdALiiBgy1vmqLR33pI/THT iMGecyIFp+X55+uo3kFqjt7EBmwXD4xCfzLm7IhI7773U7QbguNSbtWQmFRa6QmM0lth ct8cHXI8IObfMQSRnI+H/2weU0fmx1TFmUfYWRAOZZ9OZGt9WwMpTwHoDsavvi2hoxgf WA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3a23538uw6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:47 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6FUJ5019917 for ; Tue, 27 Jul 2021 06:19:46 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by aserp3020.oracle.com with ESMTP id 3a2347jxeb-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bTssMS9kYwWiuilnhHCi+2wRVs6wHEYA9tYi9rKSOucwGosLw8ex8jVQnTvvLGnIFVm3vouNikVTgMngSpGNNoxi9FhYQp2onzlzA3LG4u6gKf7DZlqBEf1CMeNUlPcGauJvnc7p5apyqKNkL0cYCASEJNx790X521NBPivp0iyRRE6+pw9fLl0uevyAaXIqecX/lp5XUF39hV3NfD9/mIhlc8MLdNEWTR6jRRxGGbcEh472vShDxNhhYGtirZSGD2890b97dTwu8J/Yo/WgU9R84NxqCRDjsu/whybhxh3/wEaeea3xf1Dvz1AvTvpfOLIcXJj8ykdRuyLVgB6A1A== 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-SenderADCheck; bh=YCEbQMAALeA7FiKvFLmh9Cv2Eqg/ZsMf0JPpzI+bWEo=; b=I8gKYAyA2ascJo/joAXtv+LyiZx401PPU6iBpih504cnFkqyYfbHnbFAQxuKRazYppe4iOeiQYwu9taQ+KRuKYl4qD/G89L+iG59Dyg5uv3bpHhW8y8PYxxRrMhAqfBHkwAN0wH73VJBd/wTYOaJyP/1pOOlCnczJcUUQsquF+aaXZy4qHKaAwLYywvr2NEGGsCLqkDMk1G3cx878LT18pbQowztq2PpOA3rnIMVPhFeBlsg+aC0B/EqcS3+Ns7mhjAL7fa7ffXpWsdLRPvOWtITt7DiwZteyQLHHMM+VmUi/nt6iBW4t46PMwipLFlUMc9UE1jp1AN/Dp6LBOyTtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YCEbQMAALeA7FiKvFLmh9Cv2Eqg/ZsMf0JPpzI+bWEo=; b=qvzh5SNLl2675nUZkL/WsN5PqauszlssXWUiylYpFQ6pWMGzjKVYvheot4tUfjY7efVr5haRVHoXE70KOEv8/9zIVdWx6SRwgwu/4n4sA53/d4fSXdrEKySWRKAyP0dpir4XpBv5oYJi1LmAAp1/GU/nj/ExWhw+ZgX7Acrixh4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2791.namprd10.prod.outlook.com (2603:10b6:a03:83::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:44 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:44 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 14/27] xfsprogs: Make attr name schemes consistent Date: Mon, 26 Jul 2021 23:18:51 -0700 Message-Id: <20210727061904.11084-15-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b521b784-e8fb-4e2b-5220-08d950c686bd X-MS-TrafficTypeDiagnostic: BYAPR10MB2791: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:421; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FIOTjGkNLQP+36uuNRxwjQXrnn6k7yHAQxJkmGejPpUvagj2t5sHQUz3AyeRIVzCr/ZV36SuheosQOk8fcqYdUTXL+7gIkF0qLlACKkKWx7UBxBYo1H7+tCXtP7JZ/BM09FjSWVf7HufLRhi6dlLkUh1jZlzN/gac8WzuyQQssknC2ORghkmuS7spGl6DFValW5jOWjprmr+Ilx522Om7LxsmeLkvbZYxoPUjiWC977j0oIMNRT5/mTp3aTlebO0z9XPSyT3EyHZ4dIrdl47NKEigZUr7wDfkKGKBnoI0k1hAaeW1NK3noKZDnVcQDdDbttqYE5OLdPQOKQKdPmLe8LhlTVxoNRoULTMwkGlWI6p1aBOk+QUYPJDQ+whpxvOSy2nEYw9QNZvh2PW3+e2g65w28xMEnjnC73Fm+Dek7JzR/LxXtdEGoUDSWs5AIxlCODv8f7+y+MMxIo4M6E9S8/3te4N4/X91Kr1aoN+661vYbLdXwBxjdMTxy/ywmGBdg+iARRVi4tCLJ1InhXcNM0vHpMHV06hdpSomV6bbhNa/GG6zq2VOIBpuEUR3LyRi7kBbirLgY2I69BziSDwZICTfTOzW+CY3UrsxRtkv09hnB81IyT19xc7dqEGOCxO9qQx+Raog6bjwIuRafqlVV+XQ/1OozrIgjsmozXxU70o/pZS0dUsPITqPB2kx/5iOqwCFJ/O52GQXpL4plJu2w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(376002)(396003)(366004)(346002)(44832011)(2906002)(36756003)(52116002)(86362001)(6916009)(83380400001)(8936002)(478600001)(956004)(1076003)(38350700002)(66476007)(6512007)(66946007)(38100700002)(66556008)(316002)(6506007)(6666004)(6486002)(26005)(5660300002)(8676002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TRLquxHLwufOfzT0j5NBJngt1l4xFwkyk8HFwyGoVKy7qQ3/DyDHTYqjJ/Q0ABOC6PGiYfyhK+vXKgessYBV1IasjITQeV0M39fcWC1PpqW1W32m1HRxm5lUzRg6frQ52FtqjZ42u8exHTwfITOv95NpJHOestHb4TPdBHC4V6s1kujszSq0ux9pN9nEOVxXxeD5Yb0EBhEn3FcbBs/UjZX4AmPa7GYV6xNmvsXo5eNmP8NsQAs97j+bNBv77mpOghYToNREsJgdGlNC6NB7d4/WCS+PV/K4jWE7JK9PiIwdPFERz/MD8RkpXChELfDQYv4peYY8cg47M54DI8INfJEgy63BV3KMJyBXrmNT22xN+ADmNmlKqD5NJV8f3yieE0Fi0cR9dmW0aqaa/km20YoF9QTCHvzjYOCONeIXGaCdFcEEaKBDMVchOB5lhpsLbIwQJPUhYw8erZFvPgYH11i360GVj03s57OqSseGf5Iox0/ITcW+LM+WtTsgm0aUOt9vyklzuNEMdTGOzqwQoXG6dZ22CLq/bv0b+w74kc9ndJkGj6KJGz7NAA8kaEyzCDWd7xuAzAn1Coo0LgwMk5EV7x8NljZEw8B2l4udIqJTZ883lmIsvFr9jRhEO1x55vnEoFmRuL+uBoDHtXKGxpvT15TG5qgKSzMBwmTI7GYNEh7Lc2UI2Xo1Rg1pCO3rAy9ZrVZ++whUOOeSB8PEUDgP9r0WCC8paOkf4HINzhJapWxBqf4JJzdCIiwbWlJNCABNCau3iZuk/J4/LPJPChjI7SwRnp9DM7pYh/bw7tKCP5A/kJHvSUWm83rOObSk11/PHAJmMfXBVmAQiPpIlg4fyrqAxhxekw1P5PmJCh4b3Ps/kUSK28vL0pjaxr+9gQx2V6n9Lq2O3hvKOfEGWlPCoirHEIumfCvKYJFGoW+x6XAA1DRYmWPwolenyttmZ/PPRO0SA6voBuNRnmM0AfbreJxdIcDWHojsPyWGUIHTVrNc2RuhjVtd7dDbaFQGQ5+Hh1amDNRm4dpk4YsD5pjszDA+yFmRPMMHb2DxYu1aufVjBe0WU/dHP1dI2cwM0WRdC+zEmMh+7pWflHbVh8N1RDGZubYq2Jjc8Pn0rd5FF9Sya5ltdJQm8Pqqr2d7UUq1MBRzyAjaln6lTegxUs7bwUexihxBiEqUfMv0p1Jttjy+YRiPa3DZlOgWMTd4YllOUQgjpTi21l512XiL5OY55SvF9xF7FgAIozrdnZo4Hcg2Bu+WRA7TKAXCielW/Hc+oYmqdVNQ2lUVwuqoB8GZHkVWhZEimtkVI90cz8NcZLqw6o6kL6SBkh/xdkh2 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b521b784-e8fb-4e2b-5220-08d950c686bd X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:44.5480 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PikqLLJY1ziZpJTkuVwJMfd/IllMkf3w24/o9HyTXAqwLC9DmP1AznkQcmmPYB2rWorl7N5L0fYMFQxWyd/iXV3kPDJix66ZGdeTTadjf3k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2791 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 suspectscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: btNJB8zv4_ENaOsZVhV2d7e8kdHj-siP X-Proofpoint-ORIG-GUID: btNJB8zv4_ENaOsZVhV2d7e8kdHj-siP Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Source kernel commit: c910d5b5ad8de13953197637b74f3e5c25960410 This patch renames the following functions to make the nameing scheme more consistent: xfs_attr_shortform_remove -> xfs_attr_sf_removename xfs_attr_node_remove_name -> xfs_attr_node_removename xfs_attr_set_fmt -> xfs_attr_sf_addname Suggested-by: Darrick J. Wong Signed-off-by: Allison Henderson --- libxfs/xfs_attr.c | 18 +++++++++--------- libxfs/xfs_attr_leaf.c | 2 +- libxfs/xfs_attr_leaf.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index cbac761..8f6f175 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -63,8 +63,8 @@ STATIC int xfs_attr_fillstate(xfs_da_state_t *state); STATIC int xfs_attr_refillstate(xfs_da_state_t *state); STATIC int xfs_attr_set_iter(struct xfs_delattr_context *dac, struct xfs_buf **leaf_bp); -STATIC int xfs_attr_node_remove_name(struct xfs_da_args *args, - struct xfs_da_state *state); +STATIC int xfs_attr_node_removename(struct xfs_da_args *args, + struct xfs_da_state *state); int xfs_inode_hasattr( @@ -298,7 +298,7 @@ xfs_attr_set_args( } STATIC int -xfs_attr_set_fmt( +xfs_attr_sf_addname( struct xfs_delattr_context *dac, struct xfs_buf **leaf_bp) { @@ -367,7 +367,7 @@ xfs_attr_set_iter( * release the hold once we return with a clean transaction. */ if (xfs_attr_is_shortform(dp)) - return xfs_attr_set_fmt(dac, leaf_bp); + return xfs_attr_sf_addname(dac, leaf_bp); if (*leaf_bp != NULL) { xfs_trans_bhold_release(args->trans, *leaf_bp); *leaf_bp = NULL; @@ -840,7 +840,7 @@ xfs_attr_shortform_addname(xfs_da_args_t *args) if (retval == -EEXIST) { if (args->attr_flags & XATTR_CREATE) return retval; - retval = xfs_attr_shortform_remove(args); + retval = xfs_attr_sf_removename(args); if (retval) return retval; /* @@ -1223,7 +1223,7 @@ xfs_attr_node_addname_clear_incomplete( if (error) goto out; - error = xfs_attr_node_remove_name(args, state); + error = xfs_attr_node_removename(args, state); /* * Check to see if the tree needs to be collapsed. @@ -1339,7 +1339,7 @@ out: } STATIC int -xfs_attr_node_remove_name( +xfs_attr_node_removename( struct xfs_da_args *args, struct xfs_da_state *state) { @@ -1390,7 +1390,7 @@ xfs_attr_remove_iter( * thus state transitions. Call the right helper and return. */ if (dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL) - return xfs_attr_shortform_remove(args); + return xfs_attr_sf_removename(args); if (xfs_attr_is_leaf(dp)) return xfs_attr_leaf_removename(args); @@ -1453,7 +1453,7 @@ xfs_attr_remove_iter( goto out; } - retval = xfs_attr_node_remove_name(args, state); + retval = xfs_attr_node_removename(args, state); /* * Check to see if the tree needs to be collapsed. If so, roll diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c index 08600ea..e23fc3d 100644 --- a/libxfs/xfs_attr_leaf.c +++ b/libxfs/xfs_attr_leaf.c @@ -770,7 +770,7 @@ xfs_attr_fork_remove( * Remove an attribute from the shortform attribute list structure. */ int -xfs_attr_shortform_remove( +xfs_attr_sf_removename( struct xfs_da_args *args) { struct xfs_attr_shortform *sf; diff --git a/libxfs/xfs_attr_leaf.h b/libxfs/xfs_attr_leaf.h index 9b1c59f..efa757f 100644 --- a/libxfs/xfs_attr_leaf.h +++ b/libxfs/xfs_attr_leaf.h @@ -51,7 +51,7 @@ int xfs_attr_shortform_lookup(struct xfs_da_args *args); int xfs_attr_shortform_getvalue(struct xfs_da_args *args); int xfs_attr_shortform_to_leaf(struct xfs_da_args *args, struct xfs_buf **leaf_bp); -int xfs_attr_shortform_remove(struct xfs_da_args *args); +int xfs_attr_sf_removename(struct xfs_da_args *args); int xfs_attr_sf_findname(struct xfs_da_args *args, struct xfs_attr_sf_entry **sfep, unsigned int *basep); From patchwork Tue Jul 27 06:18:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401731 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72480C4320A for ; Tue, 27 Jul 2021 06:19:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5241F61108 for ; Tue, 27 Jul 2021 06:19:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235711AbhG0GTv (ORCPT ); Tue, 27 Jul 2021 02:19:51 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:47930 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235474AbhG0GTs (ORCPT ); Tue, 27 Jul 2021 02:19:48 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6G8Po024355 for ; Tue, 27 Jul 2021 06:19:47 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 : content-type : mime-version; s=corp-2021-07-09; bh=YxfjybZ23+zIY62NOnafDEhCL+2jKFKsa15z3nkqoUA=; b=THACtVBW7AIw8jAlu80PmoxTICyQBMm+oIaBGD2HIWIdmUilyEjrQgA9Nis6Qxc/cM0W UD8yF6AgSn5Vc/sLyU9rgQkjTt0/lHSmpYSRjXSfob90gy0d0KzOR8CPr1JFWanWhCQd n1uvMNzCX5oycHo2YWCPEKHF+Ic3WTK6bDRgX3T3vzHs1UieKbY7evmOxGgHmaPDJO+k Z3r0EZgdYu79L+dqotzxEldaKEBuqg60xU0fuRfOb68t83lb/u++mFMA6E59qcyyYBD+ 07si3rfO/clYXZ52HCwdUo7fgXKar88+LnDzQ8XEebidTTe1WVLrydwlJvs/UNXenG7B ig== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=YxfjybZ23+zIY62NOnafDEhCL+2jKFKsa15z3nkqoUA=; b=FR28ZZE3HTTNxinY5cKjkRxHuKq6ftcaJJcBlZRjSGfACbTU/UNtKA8Iv58Z+EdQCpUy qOg3kYlxGa3I1lbtd5MtDlyXXUowSPG1ctE93ReO3msTDQuXqljPYB+bmxszk5VAMcVy vxeRW4V7hmAIy1jb7C6WzWszhnHI7uoZ1qjXyFq/lSXyQCTSBzb1cG4E5JjXJopUgQ99 nsof4MyLPV/g1O7B+o8e6r43kb6oVyenXektzhF121HqBYzBujq8FiuRGtol/8/YmRlZ 7C2YTlGwzQAGECGKBcQRGLeQfIj8sGB8CYCCk4Iv7Km0U2hmV8YMzVMPzBstvsBtipja wA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3a235drun3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:47 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6FUJ6019917 for ; Tue, 27 Jul 2021 06:19:46 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by aserp3020.oracle.com with ESMTP id 3a2347jxeb-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k/8dnkFRkDom8Gf15uxzXw9xRCmOsVRKeHpvL2H0NuoCH3sreadBDGvOiDqkmSTBnLUFJJrwn8KveD1UC73FN+2O2q6miYDPbheB9eF00Ilha5vmaLQROQyw5645Br6u238bJRksGji1G9040oq+JzhOfFoeIV6VZ7sGD8qTYePRqgEZQCEoj6Q5sFb5ON6CyRhZx5ZguhTMv+NCZLH8WxjUIOhq9cPZMFFJpT83lMlPzhsYu5aZoiRMogTlgaTblHFh6vMJFdQm+URCd6/mlM3EpyJgBTg8szy0KvMkdu8wU8MvvkOgwG+zBy3qh/CkFzIiS2jG/VRGl7zryU57KQ== 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-SenderADCheck; bh=YxfjybZ23+zIY62NOnafDEhCL+2jKFKsa15z3nkqoUA=; b=jzZEIitSLPyzqlB7c0hy8iW57ijNYbgudMPqjcgaCNHfcOMtMXmDAXe3JkEShFicFmifK2Jq+YFdqhjsJDNfic+xqjkg4ciJIs6h8SNQTjBiqR+nAD76+u0awpDgOxOVj9r4EsZgvy2I5d0zucbyp8ify8uKrtFJ5ippQkYcL5UTlMRiMfYEgF+E8Hz4MqciPcqbYlhfBD1ObIgWMLZolCG/pCNFkB9Lo6HS0A5P9Sgr/Kq9fgYBL6Tr1t6eSwI+Tg2w+Ydqua/QKHssDLm07+o+GGI1CTIAez96JdqZtmqZ+FE03gkYMGzfR7YrW4bE1OPAEuk2jjRXFBsY4A8UXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YxfjybZ23+zIY62NOnafDEhCL+2jKFKsa15z3nkqoUA=; b=MRS3s3EEDAldvXUNdHV3D0oKvDxi2TRzKhlOW6JHzvEOMLgksOAibbXAvVQli+Bl6me6xl/7VlD3pvgQiIlRAnlEsLgQDw56Dc/DKte5vFeceNbjb0/WpdKBA+UH8bits4YDT0f1cTZ7PmD3SvRlwf2oRkAqjoMaRPHZkqXvepo= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2791.namprd10.prod.outlook.com (2603:10b6:a03:83::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:44 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:44 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 15/27] xfs: allow setting and clearing of log incompat feature flags Date: Mon, 26 Jul 2021 23:18:52 -0700 Message-Id: <20210727061904.11084-16-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 51edfd59-b248-4cdb-dc4c-08d950c686f3 X-MS-TrafficTypeDiagnostic: BYAPR10MB2791: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:935; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fkNeU7pHRZ7epNnWkqaScLFOQSEZxDTzVrK7sDPmLEwk9+f10pEU32WrBSIrTA74ch1dHCqfLHuXFYK0PwKjK4JU+f8kGefbvMoF5Dmoq8f2wJtXZbO8QdpEKM2cPde3Oum9ix8ak7NCA5GTIQZlT/exRAu5MMekiG/dbbfsTR30yA21abE8oO/4TY+g1M7ZL4enGIesjPItbKq5f1MCw6o5P/IWgHH54xrPv7ZJVFlmEXO1TVYrMhX3mqezZ85a2iJyGCStKzqoQGMq2GghUVkABmojz6mmwEKEcBjTb+fV5oQ3g6urYYBfo2qiBZUGDp+lDS1ECZDuWb1y8zqGSYqlklA74M+l0hcRWzmDuv+1P/M1HNVjomKGjx+atU/+IitmKIQTRAd/vn9I3BS/LFQdoutiBbPkSCtz8QIJeQt1HNBzRXWUKn7xrFuEncLDQwrzpglFkfKe/t6CC3oirmnOgQkgH2KwfPG+5hXz2T0Ca6iMMwODUSefcAGJb2jcrQdZ6/WUco0kD5w3HOJD9EKU22MpurcVTRw2N60pQGXtN2I/A23psiiKC84D18EZesqtHykS+W7B4k2p9fKxcAmZ5pSaBBVcahtb+r+WHK9nuAUN4A7SV7U3J2WJc6U793DXAWQtg5HGZSsI9Hg00Ta31W5l/TK2aNzHoeffKrUe8zTzspaFKQ0zdp+FM+/6MJI6o7sANYVnStM50eoqWw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(376002)(396003)(366004)(346002)(44832011)(2906002)(36756003)(52116002)(86362001)(6916009)(83380400001)(8936002)(478600001)(956004)(1076003)(38350700002)(66476007)(6512007)(66946007)(38100700002)(66556008)(316002)(6506007)(6666004)(6486002)(26005)(5660300002)(8676002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bwGnCl4mA5UlarQ1G6vatAIki2RjpadUDMj4Y072OYzuXWcizRE1X5UZq1pRY2taRJNv1dFKEPmqcKK9DtS9d0GDBM3GPoQT8pkauSM36FKuO/wqbavPZ5S7mTwTxhp1WyymVNlH04Ce31wIPdgodlwzY5SE82EXdxaiH7ph00Qg4ydp+xKsxP9aZhO7tIPSqBJ21+6k2LUg93AGLtuWhJS9lqqJPyojP0nSXdJygEiZolBFW+fKIKbm52ZFx0js6BiE28qWd+WZyTenHjVsz1XAdL83QnHGcV6Io+l1Z6c3lEHzNlHI/7E5IaPqhExmBFc4MmbvpYIFZ3qlXPM+rjsk5n8NrJCs56+AaeFR3N5eiMZaRUqnO1Jb9+x0SCg6BynlKaVtzQxfJvWQaGkM1BJUH1Su+JKB9IHdvwf0txEM0R8doMHs6onxEop8j3p3ec5YvKPB+5lsRCw0vxS/7muudwGC2LQivoU/3CHCq9d+7dfnmuFPyXT88z+kZ7KPOpBgBihsCxJyNMwU1gEuc2VQ0O0vNGVhsqxs2PwNC2SIk5QJo/fCJvgh2MSIntlAeXala7DonmahJag9iig/ZGr1AsLEa4b13qdfrvj7cExCtLXiteiepxo/XAn0+yw4f8WOdDFG6UCagDJfWVoA5FeodPWViA10j/9el7PDch7OxMFZhX4zSOhD1qWWbfg1DI23Hz3hO3EsWm7bfTBQ0vfTuVPrOW1kem3NxOHzQQozXWMyzxT7LETgsg/s7KEGBUyrIdKDbOoOP8x+lymcA+oeo9uaBSs46G4biRXBJXckviRfN72i6wSK7ott3t3I6osYft4UHkgg88QBADfqq9SqCPsF3J32Ri27RQY0tEvbhkeknJySq9VPAygddK6t3EAYHveUlgTxOCiIYDDx9Sv96Y+7UgAJbjvKtaZS4dEo+A8CL3qZKCxnESqubZbudRwXIHdJtDUk4h76rgPGDnvOvExfDKt0vlpcKZoo+2IPmQrVqT22u9/PLniw0/JHlARnDygGpURcVcIEO9ZxZcQLWKYCD83o3gyVGnzszE8jd3HAnKqG9lj3rVnIeEzNJKEZQd1q/LaMk+mB5P1deoHbymqLqJymXt8VuD+5aFFxh8bQt8czg5u65YSuj4dX9JsL45QGOxMpD8nCD/8QV9za5WCGABjGbcNczIy/EKHVrcBBMTyfFtRIdqrO6JuETLJbfpJDf+4ZLxQCoTfKHK2gJdO6nEVWeBpsLP6Xi0Ul48DXT0HtcyFqLW/xiltk0RetEdC9krAD8xNspuXhdr+QmrvxH2jDTUYSsKhhaQbkx9gXdMY4oX4ubsz2k562 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51edfd59-b248-4cdb-dc4c-08d950c686f3 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:44.9203 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 69DU1KTMbZgMDlCqUtGWrECjoG0UWVcdbfhcUN6vFqHnlfCeiI46GAHmm7HFTur+qwttzX6qMkGtjH/Ho+9zlSM8ofnz5q1UAUvNkjmNoLE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2791 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 suspectscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: HL6inXvCIfHtO3UNKlirZD-WvpDy1EEZ X-Proofpoint-ORIG-GUID: HL6inXvCIfHtO3UNKlirZD-WvpDy1EEZ Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: "Darrick J. Wong" Source kernel commit: a9642049d91105c676526817b527a1a62940888f Log incompat feature flags in the superblock exist for one purpose: to protect the contents of a dirty log from replay on a kernel that isn't prepared to handle those dirty contents. This means that they can be cleared if (a) we know the log is clean and (b) we know that there aren't any other threads in the system that might be setting or relying upon a log incompat flag. Therefore, clear the log incompat flags when we've finished recovering the log, when we're unmounting cleanly, remounting read-only, or freezing; and provide a function so that subsequent patches can start using this. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Signed-off-by: Allison Henderson --- libxfs/xfs_format.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h index 37570cf..5d8a129 100644 --- a/libxfs/xfs_format.h +++ b/libxfs/xfs_format.h @@ -495,6 +495,21 @@ xfs_sb_has_incompat_log_feature( return (sbp->sb_features_log_incompat & feature) != 0; } +static inline void +xfs_sb_remove_incompat_log_features( + struct xfs_sb *sbp) +{ + sbp->sb_features_log_incompat &= ~XFS_SB_FEAT_INCOMPAT_LOG_ALL; +} + +static inline void +xfs_sb_add_incompat_log_features( + struct xfs_sb *sbp, + unsigned int features) +{ + sbp->sb_features_log_incompat |= features; +} + /* * V5 superblock specific feature checks */ From patchwork Tue Jul 27 06:18:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401733 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CF51C432BE for ; Tue, 27 Jul 2021 06:19:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2777261108 for ; Tue, 27 Jul 2021 06:19:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235474AbhG0GTw (ORCPT ); Tue, 27 Jul 2021 02:19:52 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:48262 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235508AbhG0GTs (ORCPT ); Tue, 27 Jul 2021 02:19:48 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6Hge0023061 for ; Tue, 27 Jul 2021 06:19:48 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 : content-type : mime-version; s=corp-2021-07-09; bh=DE2KwluMVBHitQsexNUwKY8Mdp5Qa9bxOnYXrKGF48M=; b=fMwYRlLj/LS9HmsnN5/vs8OSc7DIxDrDu4xkbvbRHEcQCrHcPaDUl3ipTQKY5zthr6S2 6EFUSSuLmxb0MjMM1tOVKRyb965UgPtVocz/QuJUlx+l3DojnbV1BUwQ1+DzHULw6DPU +T0zHTyGXNDSQI2hCnHgewjp5c5ajPm77hEhVX9IH8Qj4eElPZFKZYLys2TMf7b/qb/y LrCucf7aLKtkDwhw/1hmH+bfH0KXPwDZsw1IzTc58Cn+2ihjl1/mu/0Tq9luAfpyeyF9 tjE6SLs/ghqC9w/2f4PJCrjPSbjuueSWIXXR18iKCnudJal5UP4u9WfKsvR5lmfHSEZX Iw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=DE2KwluMVBHitQsexNUwKY8Mdp5Qa9bxOnYXrKGF48M=; b=Kyg2uA8tLyj2Ca6zVJjwo/7/U9POWZYtND5veheey72rZm7CY2dSSgPULI6Rtwb154jo 9aQMJVSkNHwCD9xirG+BRrY0mcEhy4uA53DWa/7djfHBiiN850D4yrOUnv5g+Wu8aWof yEMcjlRFI55CY64YDowZmWQI+qOqg228LTse2bLzGPk0DilOaW7WoBP/4ti/LyG8C9G9 tuKKdMwTECB4TOdmYihJzYEDKCSJsJOOw5yayeZMR0rHWFUH8goZOGAHu8v/Ap/Q9sJ8 qacw0K8byewIIUPWIPcC59IKS1xV13IPSlChjzWy7hxa/oBmc2ZF8JK97UeE8+hfDOa3 GA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3a23538uw8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:48 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6FjJ4114851 for ; Tue, 27 Jul 2021 06:19:47 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by aserp3030.oracle.com with ESMTP id 3a2349tqqb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JiJaokkKGvvF/FrbadhfxBhrMNPInOUaCzzPmyoRqpXqigRyAPCcPzrboPMPWyFmCdQxMGO5uIOFGxWy8k/r14y7kT4TG+TtTK2a/epBxv2WlKwTX3RI1Y4AUVpq+vXEctwcYsB6/xoj9PqEHmnfaq20P5f2PA/fEGhQg7sZBM1oYTmR5+KMtEdpQ9KZSIM7RGlRl0ho4ob05VQ9DqPQL8RwbBQ2tDXCtcYRVKSRWm5lKoKskfkU376s23tq21oSO2n7dIbOj/O/UwhmzmTKdI59lNmEsakpuIECzqjZkn5Wn5hKz92g1qxBoVoeDSnxpqMsWw4ibIqFR2C6mrtgbg== 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-SenderADCheck; bh=DE2KwluMVBHitQsexNUwKY8Mdp5Qa9bxOnYXrKGF48M=; b=WH1879dA7JSP6dcmqc0YSmH5ucnmlXQFHZrbBNGzlkpLU7kAWS59jUNQwcb6vK1lynDqyo+b83fizfHdPYqznRndQVDY9PFP/4MOn6ui4qiUFrbZco3SO0uBi+gZqeEi7CBQiok4pAPrJnpCWYtaIQodqYijee/C09gkob0fd6oC8bFaRF1njsBH1qxrdwlb7vUBfyfru/orgDgJpT9GUX5566bnIHjSvzCLsq6BkcEGRhq2GdLJEHcuBMV74JeWXP4a+oz7SDpI6gG3tDBWf7j9HZ8BAZ09ivyaBtIaypy6s85aqPHymjfOMGTymUfEiIP31Pkhprp+LAAl/h3+CA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DE2KwluMVBHitQsexNUwKY8Mdp5Qa9bxOnYXrKGF48M=; b=NXRHExQuKnSx3b7PLA5pG52iwGdQl6qlgn8cX24EIioVsRynAccDhXNwV4vSSqTUMTwhMN3K+ezwq4jaayCObl3OOa2o0bMx7D9ydlUVPss1+wfRk3bhZLaqoD3+38kBxoVQ7PKMtj3NBoJe4uYzX7TUxrajB1RT3H6V3HtGcug= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2709.namprd10.prod.outlook.com (2603:10b6:a02:b7::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:45 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:45 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 16/27] xfsprogs: Return from xfs_attr_set_iter if there are no more rmtblks to process Date: Mon, 26 Jul 2021 23:18:53 -0700 Message-Id: <20210727061904.11084-17-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 96fec0c8-6670-4518-add1-08d950c6872c X-MS-TrafficTypeDiagnostic: BYAPR10MB2709: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gTxUggDay3GRlXJ8xleYk2jpXc2NbDrYES4fB0vvBJWy1OxI25CB2nJvKlpOehu5MK122j7E103kJj8JDWKQIKqeHWTA4vi0LxUdfJ5PH/auOk5l8UobyphkVlHdJY5LvK9eYCdqSFuTa1RPRisJ2xJ05N2OEw91M8zSfPsz5E1/KoJZGrJnnKTd6dyYVsjK1vLDXnfcEOrzY9pPL0UwB7y7Hd3xfClyJgkGYreB58veJLlqAfSggqy1HwYyXGyrBxafnVaHci8mGaAKWxM218C+Dv/ktIi+B2hkIrUTBQjfpevdbqr/iAAKTGLq1xrnrCKwZlRM+zX9rvcvJkiva+lr/UWpUf2cMUfktsn7dWVN8H8DavW8vbpk/l712TtmHG9fBz5MOeo4G1PK5kZ76VWqWsCIvdJpbCXxww7gu2GlWLiy75hR0vaBO2LOlmpabxOPjfCWcCIxzi/Qx8ODAVuK7ScG9o2+kstplr+qwAzPF3FXhwOv8uCLSnwTvlmY7A6qkl6CxqU6Hlid09A8+y9O1KQJdUSMm+OHserF6czl0L/s8hnmHYa8G5q+1xH8UTd/xvQVbczPy9JxNVhetW03uEqJ5TdONOoda25NdIEYlpf/GGMeusvnrD8GCex/LzPbjWjF2pNDL3CpetGuJ+hgWuTgwSg/TTe7+KKYhdxMNBdasHuS/C//CNHiJ/4P4EnQlz2sBVGg0pP8TxfpLsqOJbnYtTx/ktboQh95cElnoNL+oYsFM/P6olxafW3UbHBzBFubMWp8FXAyRR8qEA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(396003)(39860400002)(346002)(366004)(136003)(83380400001)(6486002)(2906002)(44832011)(6666004)(86362001)(6916009)(956004)(38100700002)(2616005)(36756003)(52116002)(38350700002)(478600001)(8936002)(186003)(8676002)(6506007)(5660300002)(66946007)(316002)(6512007)(26005)(1076003)(66476007)(66556008)(29513003)(40753002)(133343001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8968PamijWEjK4xkNphI1J3wSRJwCNu3UQ/WZU9gKyZy6oCARFNuhCJ+zir7XPhtQyev90YZoTT9vleOMcrGvLF4VU31kaWcH365dnoJZy+GSdaXuNAEhwjPyUTqSIeATEtzTQYxACSkHfATHw5WoS7+Ucy4n71wmKI6hh0sUkt2wI0FuiUwZNQjE2DJaNVT6z2NTJhngAg671QZv4/W7KbEcUON7P+zuHKixLNNZeRFrXZu6ZuAQG2oPSfV/gqcIIR51OaykcfoDm82Q6nR7blOlsOxMOd6vxzBKPjHEMs3IU9xLwbYNM4bXKJMoT456xRQbf7ykcrJPRiYli4JqBg3ng8M+zlOJ8/+npQ2Xav0xavB8ZLyoWBQCeDwC+st16X+ZxWLYjMeabz0/sRG3h3D1BCvCRCa1Kwy7ohUUN05mkZeD2T8AxKHJj5dHmJ3ToGH9+x1/4Aj2MAVBjM4ECOJaQfSe778HK/1kCIn1dVmhrOrYDX9/ks39xFq/WUckzQjrvWzuGHy19lhkUG/8zPi16ppwXtjDg7orBVcuTHZYcCUbhgOsXdY+ydDODVWAILuXFOfOagmqEgW3+jLyvKtpqS7W2ID6WU0949P3dOhG9p7n3VGwrCgJ+4lYcKfqIPdD/Pxqe6m5XwPwS1MmCO9QwEE/7DLOEtl6r3iluBNeJh/Fzv2PCWWxb9+PKSlY0Vy5WxGZnxfXTtEXva25D7CwJ88+dHOe5d0EIMQVbzTCDdcxLo4Ya80RjgC4HH4LoklFkpD4C/liFv0bgS8dW8kJXf1Fw1l/Dt2tBTJpT02mZlJ5P3sBiFpfi/m1s7w8Yhc7JiP8bHgTYynlpVEui+gZXFwWawdn3ZGOURZGP1ZhpAD/F3cZ2J0z7DQWLhxktqfKBAkNzfbTQBrKXEVkC8qixx+DANwIjJIRXuYEBYks6m0lZUUSIY6Tzll/4G0nYd9lA27J95MD47qK36MV14AzKp/tiLaJiUGEWW1G2UlaXWzFZgATg2GikwO6rMqu7fuCiN5/SDdOoCvWFsZOnpH1o44JxlhG8oMdyuV+fLgyka9rJqx5bZxKcwEfWZgi/XCbGctkjfWHEQn2OpGtCOayB/8KWaRyd3aD1dYyeXRVY69cP3vSO7mXx5fjCt2ITl6BS7kwxUMvhw+k+q6/QL5jNYf0j+1o3ZBJrv0RCiN/cTJDcco2D5IXyrY22gMapqnMcg09F2xL2QcCZqBWtJzPLzKXp0VUCJTOgtGOvP8kz+mgSd1OS4dof0eJ1JcKtw+81wFF6PrMbaTX+RojL0tQyJDM0dkm/oDxkonJdRyrPHAIbH0EVfx2WdVsFGq X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96fec0c8-6670-4518-add1-08d950c6872c X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:45.2728 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: A+OzzHNre23Ok3d3saXjuGhqBiXdwieCO4DQTB/87+wBHIvwRBh7j+dSxHmm8wf+pDfcDU6RpQ6Uo+ZECIra44nNWhxBGLLJoiADfQxBuwE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2709 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: UEfZC59EQ85wSQ7oqo2mH_EBsFGlt9Fo X-Proofpoint-ORIG-GUID: UEfZC59EQ85wSQ7oqo2mH_EBsFGlt9Fo Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Source kernel commit: df21062113850c5aaeaa38b5194ee4c64767fb7a During an attr rename operation, blocks are saved for later removal as rmtblkno2. The rmtblkno is used in the case of needing to alloc more blocks if not enough were available. However, in the case that neither rmtblkno or rmtblkno2 are set, we can return as soon as xfs_attr_node_addname completes, rather than rolling the transaction with an -EAGAIN return. This extra loop does not hurt anything right now, but it will be a problem later when we get into log items because we end up with an empty log transaction. So, add a simple check to cut out the unneeded iteration. Signed-off-by: Allison Henderson --- libxfs/xfs_attr.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 8f6f175..84b88f9 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -409,6 +409,13 @@ xfs_attr_set_iter( if (error) return error; + /* + * If addname was successful, and we dont need to alloc + * or remove anymore blks, we're done. + */ + if (!args->rmtblkno && !args->rmtblkno2) + return 0; + dac->dela_state = XFS_DAS_FOUND_NBLK; } return -EAGAIN; From patchwork Tue Jul 27 06:18:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401747 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62529C432BE for ; Tue, 27 Jul 2021 06:19:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52C8661108 for ; Tue, 27 Jul 2021 06:19:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235633AbhG0GT6 (ORCPT ); Tue, 27 Jul 2021 02:19:58 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:48686 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235550AbhG0GTt (ORCPT ); Tue, 27 Jul 2021 02:19:49 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6GdIV007040 for ; Tue, 27 Jul 2021 06:19:48 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 : content-type : mime-version; s=corp-2021-07-09; bh=WrBmQ84BTK8+9eXRsNE2y3XBeZ/95ltE0eeKsHw6xZU=; b=mlBRHl7kDgt3SysukNw1pM/1AifFyWGB+spfEfN3/7VGQNQiJetEjDpp2oH7sV8ubxo1 pX0/fYv3jqD9b75j1djMi5boI93HageyozCEMoVLJQE5YqKuagUw4pUvjPW0gMcgDQFs Amh2teEVrZ5qCMHRI1G0ArUIxF10IHQIX8QJGo3BHyN/6XBqIypzwjh2Y7IJD2DmgvVz FCWvQjVqJVLXpbiFRq5XzxCI3PBRR8aarB0mE41AYwC4jKnIrnyW/2MpWKj9oxQfZSVm xnM5jij2Sr8ku1a/2Y0RwyP/NiO62iQ7fy6IhcWqstaz1bqQzyXcZkS8VgMAPAqjs+Ha oA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=WrBmQ84BTK8+9eXRsNE2y3XBeZ/95ltE0eeKsHw6xZU=; b=lSUfWPHP13UgF8ajY9ctrO0oRRymE/tu7ncaeQnlHluXnYhHAqrS/4t6MLqC4BERQvRc cnmg4JV2ae6Uhjwjvw5ebIwnRmf8YFhn/lbEtqndPU4nJG6Jp3QFBx9akzSBnBvuaDOb vR6jY/Lg6VTisBpq51Th7zTSvtq19qMchN3emT77+DMH3DPpKGX36tW4RQJ6cGDrn2AW AmBCBol/nQSeuSDxWBNbomKlSrWfwq4duULt8pLBo80FyCWrf6XiomBpML45cMIg1w24 jXKvOXJk+1aDDNu0k4JGx5pE+09pasuaZq7ap5+OfLojNF9VTWKdH6PPntJM/ekRfzym 9A== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3a234n0udt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:48 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6FjJ5114851 for ; Tue, 27 Jul 2021 06:19:47 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by aserp3030.oracle.com with ESMTP id 3a2349tqqb-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QIMHQRL48hY7x00pvcwcOmb4LmJO6/3/0dRIPzpRetsKyC/DqbgsORTMktkskTSJxYLuoi0oJMM49uVaS/IC01OOik/acfhad/iu8a4vVd+bBP0/ZkzqJc7DIUJrryoj5GgwFtQCYATANnM/5O5CCoxvZIZaKSnu2tD1ZX3rWWKqo3R8+VZKW5xOQ5PE9PZnoR9ivwaULYDoqvg6k4hXoydW7xAS1M/7LnvuUzRZUwOXAlwvTlO6oT/e2Tq+KVrz/U02RL2LicMAHKRC5zHkUVa3aFwndnZEJX4n+vqZccVhBPh049hBcWrkQ1W2tD6L4IxB3Rih/dB+eDFrRGFDyQ== 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-SenderADCheck; bh=WrBmQ84BTK8+9eXRsNE2y3XBeZ/95ltE0eeKsHw6xZU=; b=JbnaQf856XJdXecv/sWiApIv+Kd/nYf7DADw+lJ1wIept+O0WO4gQxdtoJ/s4vuW/OCO+N/X+vrnuZa5nrfXzBoWeS5yNqJN6zzKBgYNl1p5hRX0m7gXvS+Kg6MpPEGAdaGCI/5mNFtkIv/YzI+W9XJVQ2NT8i/0f64fdk1aQqdfgC5jSEamZ1TdayGsbJNCK1GIOdJhaHACprzSm6Wz5enZorE+prBG1ZJJudaWvyDo0gLOKtHRlIE7OYtImRy5SlnPSYiTlyazTndrr5Vq89mdiOgOju7QUEEKE9iJ/lavdXUA/J6949DUkjlY7ZQVZtX5ey6K+DOqSbRhEx4GSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WrBmQ84BTK8+9eXRsNE2y3XBeZ/95ltE0eeKsHw6xZU=; b=YIUMIn2kJWQUqXdjGP4EWnlqSPmShJJwJHaRTt0PQBWctb8tpHztG9IRfUa4QtqWYqOkmSkV4IaNrAOfu7P9Gt4Gl41wXH2FOD8vlhfpTKg6gqmIl4SNFPx7nEbBRjbqYEf5AL4YGHtyfq2vdbPaaTmCtflvFHVSoPR6aoSOZA0= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2709.namprd10.prod.outlook.com (2603:10b6:a02:b7::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:45 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:45 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 17/27] xfsprogs: Add state machine tracepoints Date: Mon, 26 Jul 2021 23:18:54 -0700 Message-Id: <20210727061904.11084-18-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 33779882-43f8-4c2d-3b77-08d950c68768 X-MS-TrafficTypeDiagnostic: BYAPR10MB2709: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:199; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: igoOkkHIJrmpYdgWURIe8FkdjgEKrDa06HIt3wpi5DFDhiVHXO45Nvvvoqmvm6ZDoYb9MoVfahSd7QL1aQTbtXnhQn2VQzEaET1XuBW5D585tnDYJ4QadfcgGQJG3VIjj8HYiPOC7aKSiYxvwLRfmymlYlUVCJnX3yAhqWSQhrHP7polfiM4Mk2hpenALfpXbVJHbv4lwwMiccaz0Jy1I9BwsCTV0bnBtlvVaw6W7iwedFAiJXUSsGkFvNafZ8pmmVId8zfjklS96iakcbvw3YpTa2bjNP4a0TPaBt3nfRoQ/fJREnSqxBxVt40sbZPGuLNMwxH9cmAWMlOUBFyr0LR/SO1MWL1kuuVZGFPfoFyro1mdjLZ9qUnrqYEobDB5H79rU25cHXP+xDkhqvmP23DFIpXJJFDBOVFtvJGTDNU7xsVjLOkKZkL9agDjnIPu+HDA7TSYzLQ+5G3TC+L7Q4CxIAWXqeL6OnQSXyBAPHjser8JURJs5FfmNOWOeFrUNUdWM21Z9GEq8O9Xie+6E/l8nUgnbfQCs3eMU9CFSlod+mEOgIhOLnRX1OIiMZlZ2v7fLYXJkHTYTukeUIDdw1x0HrYJ0rCVlrA/o9b6ZSdOK8IC3OSQrm2Ws+ubyrGfoaiuJEOiClMm43WyVaJx9rSUxnPy7W8gSeuyiJ3fAaIYRLvVW4w+sS/y8WbzUKYfqSgOkF66HtxOtmfdI8NmBQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(396003)(39860400002)(346002)(366004)(136003)(83380400001)(6486002)(2906002)(44832011)(6666004)(86362001)(6916009)(956004)(38100700002)(2616005)(36756003)(52116002)(38350700002)(478600001)(8936002)(186003)(8676002)(6506007)(5660300002)(66946007)(316002)(6512007)(26005)(1076003)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: s8NY4oP8RJ1Rz2VqQJFx3IYHgbrhyst32HdI82cJ9ETTZ7RiopNq0ITBvGpQh1M6lRjJJN+k4JuOJcRflAw44grrkmsdHD9D0hMhYVuX0XILPoR7R4HEqhNoOpTzImFqawAScWzuidCvapYm27iYzr4dLEVi15bhGcAXkxs6TpiCnqa9/x9AL73TiYxOubWtRMwwl4MowS0qsjtJ8ViszhdINWaWcWSjLJmT4X4f4FHdp09NlfL78yiUMdquuUxdwcQB1P+BWWB+ToHr8wneznxMct/EAbky+rvQ9iZJ0d7EQEOWL0QHel391T7/Gbu2jNhLKCcmdB6i+qyAmDgzkDc392rpn98e05UQAkPK5phOl6CSCRZShwIKz+NZIOSezbNn0/ip5vytpgzpfZZwGsqRWXppIgyxtt+F++FtC1GdD062gp69be3//J/Roiz37NGaenrwO8kGtxKoeV+m7MbXbVD866ZtLoJRIKIIJrnLRn9dYuRFgTmE1CEvbrUgfvVJLXPXUO1lXv5oJsiCOIgDuPh+ldb4wzwXCtyiO4zIzaMmmSXjFgTlXTlt1GqNNJEeN/RwS597IuGbN7ItGHvlp8cb6Yg2PQvMVYmJdwisvlTKEefZOpFvr63idZyjgIKNz6PiEURJwd/dk4G5U9e8Qa0tjAHClN0cZzUUAn+/kyxmWkpOfknM4JVbiJtWonXKth5qyym0YA3ewGJrWEKJGxkZshUg7egErN5P2uSQeQSIewGN9+8G/+aoSTLgBn8W8E3mjjMepe3NZ4tuXmCYKGjw2vGKtqN2Od3/7TO1Bji81qv9mOw0HCCccvA4LyhAJULyHwK685/2Fu0VNQKzyFssC4RnunIq/Ig6pZZglNMw815sgfoqJyTTMB0rE7zQ9dtPgRhKWnZibjCzDJZUdiaWAYlkxcSWAQRdx65hwVbcoFVLlXaBL18PB7kzQwcsf7djoRu7tzyuId6eEiD1dSQCzXkxiUnCitC7t+nhzKrrse9xg5xxuOMg9ZDLR0oWjrLaSRt5xkOnXPoMJaLwKaZ0MWTTa6LJqOfEWuqk9iMrYLNVqYprWqTTqDnqHQouUmJ/SiLJeNj/zp7Kh4QgOF5ImQYehRZ4YziSMZmCujz9JE+bHIgtkftsqbYRidoUvEGwIPDE6fO9Fg+Qm2p8eBCqjD4lTPHBlodZAGAgiYUgsohiIZpk/FmxLxWUXMGUuJrFDRUcfZoekNWsGVXwRvKO4l3B1WYKSNIBHevp6w/ZYkK8Kjh6MUBagFKNHzM/00SvPozk8apIA0zgZIe+Zq/GkBAJ/oUp/81+SlMwnoVoQEkJxtHOq0/dufM5 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33779882-43f8-4c2d-3b77-08d950c68768 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:45.6820 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KrX48NJ8Usnls6ekAdm6LeUyppsgNgjmuCV2up78Ee+0olSmoGtMzSOy81tG3u5tUPBpzkbmU50Q7CRdfQtf/0PxEvpyqLj7SdXbMidRmso= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2709 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-ORIG-GUID: iqmbCkJs3TZzyavGWNR-tKj6x04H0hzK X-Proofpoint-GUID: iqmbCkJs3TZzyavGWNR-tKj6x04H0hzK Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Source kernel commit: fbc8d6bb875915e0afd8ff6cd4364b368a6f894f This is a quick patch to add a new tracepoint: xfs_das_state_return. We use this to track when ever a new state is set or -EAGAIN is returned Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong --- include/xfs_trace.h | 6 ++++++ libxfs/xfs_attr.c | 28 ++++++++++++++++++++++++++-- libxfs/xfs_attr_remote.c | 1 + 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/include/xfs_trace.h b/include/xfs_trace.h index a847b50..2169c27 100644 --- a/include/xfs_trace.h +++ b/include/xfs_trace.h @@ -312,4 +312,10 @@ #define trace_xfs_perag_get_tag(a,b,c,d) ((c) = (c)) #define trace_xfs_perag_put(a,b,c,d) ((c) = (c)) +#define trace_xfs_attr_sf_addname_return(a,b) ((void) 0) +#define trace_xfs_attr_set_iter_return(a,b) ((void) 0) +#define trace_xfs_attr_node_addname_return(a,b) ((void) 0) +#define trace_xfs_attr_remove_iter_return(a,b) ((void) 0) +#define trace_xfs_attr_rmtval_remove_return(a,b) ((void) 0) + #endif /* __TRACE_H__ */ diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 84b88f9..6380cae 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -335,6 +335,7 @@ xfs_attr_sf_addname( * the attr fork to leaf format and will restart with the leaf * add. */ + trace_xfs_attr_sf_addname_return(XFS_DAS_UNINIT, args->dp); dac->flags |= XFS_DAC_DEFER_FINISH; return -EAGAIN; } @@ -394,6 +395,8 @@ xfs_attr_set_iter( * handling code below */ dac->flags |= XFS_DAC_DEFER_FINISH; + trace_xfs_attr_set_iter_return( + dac->dela_state, args->dp); return -EAGAIN; } else if (error) { return error; @@ -418,6 +421,7 @@ xfs_attr_set_iter( dac->dela_state = XFS_DAS_FOUND_NBLK; } + trace_xfs_attr_set_iter_return(dac->dela_state, args->dp); return -EAGAIN; case XFS_DAS_FOUND_LBLK: /* @@ -445,6 +449,8 @@ xfs_attr_set_iter( error = xfs_attr_rmtval_set_blk(dac); if (error) return error; + trace_xfs_attr_set_iter_return(dac->dela_state, + args->dp); return -EAGAIN; } @@ -479,6 +485,7 @@ xfs_attr_set_iter( * series. */ dac->dela_state = XFS_DAS_FLIP_LFLAG; + trace_xfs_attr_set_iter_return(dac->dela_state, args->dp); return -EAGAIN; case XFS_DAS_FLIP_LFLAG: /* @@ -496,6 +503,9 @@ xfs_attr_set_iter( dac->dela_state = XFS_DAS_RM_LBLK; if (args->rmtblkno) { error = __xfs_attr_rmtval_remove(dac); + if (error == -EAGAIN) + trace_xfs_attr_set_iter_return( + dac->dela_state, args->dp); if (error) return error; @@ -549,6 +559,8 @@ xfs_attr_set_iter( error = xfs_attr_rmtval_set_blk(dac); if (error) return error; + trace_xfs_attr_set_iter_return( + dac->dela_state, args->dp); return -EAGAIN; } @@ -584,6 +596,7 @@ xfs_attr_set_iter( * series */ dac->dela_state = XFS_DAS_FLIP_NFLAG; + trace_xfs_attr_set_iter_return(dac->dela_state, args->dp); return -EAGAIN; case XFS_DAS_FLIP_NFLAG: @@ -603,6 +616,10 @@ xfs_attr_set_iter( dac->dela_state = XFS_DAS_RM_NBLK; if (args->rmtblkno) { error = __xfs_attr_rmtval_remove(dac); + if (error == -EAGAIN) + trace_xfs_attr_set_iter_return( + dac->dela_state, args->dp); + if (error) return error; @@ -1183,6 +1200,8 @@ xfs_attr_node_addname( * this point. */ dac->flags |= XFS_DAC_DEFER_FINISH; + trace_xfs_attr_node_addname_return( + dac->dela_state, args->dp); return -EAGAIN; } @@ -1429,10 +1448,13 @@ xfs_attr_remove_iter( * blocks are removed. */ error = __xfs_attr_rmtval_remove(dac); - if (error == -EAGAIN) + if (error == -EAGAIN) { + trace_xfs_attr_remove_iter_return( + dac->dela_state, args->dp); return error; - else if (error) + } else if (error) { goto out; + } /* * Refill the state structure with buffers (the prior @@ -1473,6 +1495,8 @@ xfs_attr_remove_iter( dac->flags |= XFS_DAC_DEFER_FINISH; dac->dela_state = XFS_DAS_RM_SHRINK; + trace_xfs_attr_remove_iter_return( + dac->dela_state, args->dp); return -EAGAIN; } diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c index d474ad7..137e569 100644 --- a/libxfs/xfs_attr_remote.c +++ b/libxfs/xfs_attr_remote.c @@ -695,6 +695,7 @@ __xfs_attr_rmtval_remove( */ if (!done) { dac->flags |= XFS_DAC_DEFER_FINISH; + trace_xfs_attr_rmtval_remove_return(dac->dela_state, args->dp); return -EAGAIN; } From patchwork Tue Jul 27 06:18:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401749 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D705CC4320A for ; Tue, 27 Jul 2021 06:19:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C6D1561108 for ; Tue, 27 Jul 2021 06:19:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235550AbhG0GT6 (ORCPT ); Tue, 27 Jul 2021 02:19:58 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:49084 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235041AbhG0GTt (ORCPT ); Tue, 27 Jul 2021 02:19:49 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6HkJ0023079 for ; Tue, 27 Jul 2021 06:19:49 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 : content-type : mime-version; s=corp-2021-07-09; bh=gn1M8AqWsHvy+9oWTouqTbCJtSesijYbIkjXp9ijIyU=; b=LofR6UgXzOzO/xuWLNd/g6JiEhYS0WjTrLcGLlp2634mNk4ULbn0oXVYIvfL5qErR8Nw LzeKM8Pvyc1CyOJHhq7DAMJ92k6+FbQULZnj9MU9CXrrffk2ZdRRzE9Z+KI0XXs4+3Tn FZZ1Jz8xo6F2hlzZbhU/YTA7L830DJc/CPtBTZvHnQreLgJDd9prNuYr7sEmBgDTFU0r ht44Hbahzlos3CjpFPFrE/RRrQJgCaZosCF+/ppdCUBmyoHKedkK5MDXAwKcGd6NiBij 5qrazKYIvWgPXQ57al/NYnTNm/E6Fz5X2qjiCRjYpFCvr8slmxH6q8pKZ861L8g4VXO3 TQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=gn1M8AqWsHvy+9oWTouqTbCJtSesijYbIkjXp9ijIyU=; b=rA01rKZABjBbUm6Q8InGE0sLX5Og3VvgSfMvh1oB1k3wdP9EUT5eg5FK/aJG7mI6vKCE 6tlSkj6euPAlxDHUmZZxq5YRZLGu+hrV1BklFdNt/nu4ghKPwQyi6wTkoSa7QhYcd1kJ RvggOcTQfZiPDJOC8+xjvj4E38CUeklOhftYDW7o8GsVYQwURQJZeVaOtLtyd7MPaaCH rXo18MRRPP1x9r7ze9Vbj/iO4o0kI9a9855YmWQrATJ9Ne92eYG5WupE+mXg20/zpR56 j/Zsrkq/GxijGOnTyTU6dthssQ/O4mixcXkcIwDhJaM5z7HdkDgoMkN/SdcLAbKvTIZf iQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3a23538uw9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:48 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6FjJ6114851 for ; Tue, 27 Jul 2021 06:19:48 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by aserp3030.oracle.com with ESMTP id 3a2349tqqb-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aUAHQa2rRqXIPlIhU3/IrT6HjVCd12v+x3wQHTPOwKTz3ql/TqU+G5IX9xBrZpGAP+ahjZrRxWjlRvsggZXiT/FaRrusFq/0SzmFBiZ8T6WEPcfeH4sTfM630t06AqTThPcsitxRXqqMmx7/E/xV0BFkvrVMRCNAdAt/m1G08rgZbX7heoxYrAveL5t8ZmRrlei+9R+7EVwuJk33vm2eDCulRH22ibc+6ld/tz2fd3CSceiozKAlwa2XTfMW9vDwQwVap6TpzEN3CniIvBwzZaJfS8BEkKjy2KnBYJn5l9PGyLX0CC4TSqEe0pDMXvbjdEYwfiACVulWQGr9CqZagw== 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-SenderADCheck; bh=gn1M8AqWsHvy+9oWTouqTbCJtSesijYbIkjXp9ijIyU=; b=W62iK6QRP3pk7tmoA6ghYLMIRpBim+Tl4YyyWGevwNbyO3ddLkYilBt7C5iA5UYU/Epg2CC22WHRTcbodc1RBifVnCM2/lldKtZOMm/cQtI8XyDLtGgce0pv+ono72VX/903RUe/8Ni3wrcIs4a+mIYRZ5X+7c23jgiEkwo+0O0bKGBYDGrWr40E952lHCzeeam946qpuqWkhIo6mFeZm8AT9f1nJhDbpwbbuSWq6uuh18aPlgN62YIGRAc//NhipUPm9EPZaRg0VbFUVLxiqlrs9gujS6sjKgKUyQWL0Lm7uwRnxnaiGemqCM/+it6Ku4xI68x1TjOOmQxwADF3tg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gn1M8AqWsHvy+9oWTouqTbCJtSesijYbIkjXp9ijIyU=; b=QRLQwrS5iWUTBzzu3NKiaxZ+MHpXS/km/nf98U9pkHYuM3lFuOZAw04VfHFx+OojLv2olFdHLEcNM31rABt2+3Gqd0lyChAzoOn7KpsDAkAfUoCMwqbw9ignwQgtFVWhE2SgiOL+eLwCL0WoSZfh6eI1e2sx4ndrQ8FfK86MDhg= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2709.namprd10.prod.outlook.com (2603:10b6:a02:b7::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:46 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:46 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 18/27] xfsprogs: Rename __xfs_attr_rmtval_remove Date: Mon, 26 Jul 2021 23:18:55 -0700 Message-Id: <20210727061904.11084-19-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2b858a3b-d683-4ce6-316e-08d950c687b4 X-MS-TrafficTypeDiagnostic: BYAPR10MB2709: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4feT/IUAzUxqhRIQnYHu5yFldG09phBt7+o7YD3pOu92OOXCZr0P633KLZRQo0rlektH8HwDMXoY/e9l4CLENlSlDbEuDHn3KTyZfq7t4WV/ip8EKKHIgfPtqbki6DJPZloGCHMzR86xVA+whsnbnQ6Yotllsz7Q3ydr0k/Y/YWNxjPxvgR33p7EAt0dnhkVfoplL/K1wpZPej9naqJVOtfS/xRFQHVWlYot4c28VbjEaJ1LoMv2Tjr1rebEXbRSkpCmCnPomUHQkflgpuiYKFr2qz9V2cylMdL+whL/OESCL+benApnaW3laIfqwmKGDSvDKV5E5BAAK8w4eQPHSYD8Anxa4rQOBGGjhCoXuiMq7ruLwBCSxEb/uKgHotVXmbY3LqNAVmS9vfubLZN+3whw4Fl4HIe01ig0NcTor5Vcm+QzmPN6v465YOObvmscrq3yocmoYIJEl3DgmzcQdf4yRVe4MHPQy1M3AIMp5iWGZgSlyhvizdph0ahp2iS44iTUUE8CMpWhFGlS/kK6StFpHg8pB2EzCYxZ779P2QuOreXhBA1uRH79BYzEemwjOaoLStlXfKhJNJo+CRm1LLHd3VNmCcpSm6uJ54iYUhyaBKOC80pLDyNQkWZGrZawuTQfFMOXITbdMaPljMNRsmGWVGKEYtxmo7euWlF4Oc/v69MVZry4425jYkj8ZWjIn0PYQ00+pWANXj95Uj03yg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(396003)(39860400002)(346002)(366004)(136003)(83380400001)(6486002)(2906002)(44832011)(6666004)(86362001)(6916009)(956004)(38100700002)(2616005)(36756003)(52116002)(38350700002)(478600001)(8936002)(186003)(8676002)(6506007)(5660300002)(66946007)(316002)(6512007)(26005)(1076003)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CpoHy+u2MRQrzaGmnWFyciD83Mhk0ab/jfDzApMiI+1Gx/RW69G3PNWn2dm8TDyfQ0f2X82bAAme2Oxo/IqmkBbNJou7sgplRo1ueDhPkGhmnc004Bu1bv5heCcVf8KcphbMLkgbf9KLbESYQMtJazYxgpI+2jU4O6qv9pecGsmYfWncX22B7IMnVTP4jZEzxfSl5OuUM5Zei080sz97HuDGR10JI8qLzOYbbpXozHlRTXtMmoUWXEAXuvPY+2bWp8nLfVmUYuEWqYjE/+38wqkZKhh3qRJtuoRTjKya39xHeC4y5RYBE5fK9QLQ5cQGhIkuSJAjrwEyWmIPB5Y+BuUzsTiU9mkTkx7BLm1KrD4f3CNDuJ6t0fLcVveb4+ooKsD7i/cPLzOjzRd48upDLfRI4TsDEuBD8oEKmWhG8A8vKEV6PWwDKl8tiphlFXPzqB6m7ik+bmbJnwj9AK0pOEXPKEQzL5kzIBoCrGWPBqHluHFcFYQmyOj04kiFTPvednomiJRtVzZQIU8vO7mJ/RhuB4YRt6/O44b25BdCEZbZUZSZ8YorAfphxYIPFCRrP8Lex9Tar+M7vUdHovwbzXtXt4zCmtzcDv6nPoXcKManIXB8n8agywdPjEQC/JmWCwIrUVxVyDaDAf6qASn5iaFsfbWTzgvaBEPkeTDXFaCV/dL9GuRGuJ28COK5DR2+4rDKAvxSyNNSnaJGtb/+wY6uSZMHdguiBBfj0sIh5FjfZ0E6Q66C8q1hP65/jnpGC/jgdkXOofe/4qkQLeQku9DDAtoiyoZDlzP/hgtWAUFigv+IiRqyDlaLccRqh76Zq6BdAic/O3eJtOCXrzr9i0suQp5axdoT1BQpz4lErs+xCPDVocUvxN+Jvj5yH3SUeI19C12oFzGnfh5uHouXNCuhGM5DF+Cdwwa7TE8m/pvUs0pQP8vOuEpggYaDeyHDSYVDaJ0UbGQQqeqSp+dX61USabys/yAQ4HnWNAR+pXoW+GGGoS8gRhHcPLQuoqrWwjqHTSXq4U5BR3y9R4G4UnawjvLVI9JCJ5e0i6XllGuzdCDTJCltfeITttctbezgZ5Y7KUVdBivnVNtsGaB4HA/Dlr27e0HRatBHkbaZj+kIVUeTNhlCQBYsvJMri3fBIdP0g2KWkGe0EJ6yV1QNXX/gSIQ/oNup/cwtsKpl6MrqFAklQIgzaT5d/1DTrouW6wii0iWA/V2y6iiPy+mtlMpNDVOUXWApchNqzTbE1II5Juhn3bb3Ix00kv0eKSIJg2sNBHWg9W+9WAI5ChhPndqLDVH8Z3uciiK8mNj4Zf2e5j+I8WyLuzdkNRxzcEat X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b858a3b-d683-4ce6-316e-08d950c687b4 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:46.2057 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1E2kL3TQRiH+Kp08C3RU5IDtWLHgtmabID+MJq1CJiJwrACN3zx5e9WdGqkhxIp8cCxr56TBOc2GaJP7BJfoOABOKJw2Jv1pXhuhoTIMDzo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2709 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: 2VAeR2lbb7pSrAPgR1n8jNdWhM54r20a X-Proofpoint-ORIG-GUID: 2VAeR2lbb7pSrAPgR1n8jNdWhM54r20a Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Now that xfs_attr_rmtval_remove is gone, rename __xfs_attr_rmtval_remove to xfs_attr_rmtval_remove Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong --- libxfs/xfs_attr.c | 6 +++--- libxfs/xfs_attr_remote.c | 2 +- libxfs/xfs_attr_remote.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 6380cae..f2db0d5 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -502,7 +502,7 @@ xfs_attr_set_iter( /* Set state in case xfs_attr_rmtval_remove returns -EAGAIN */ dac->dela_state = XFS_DAS_RM_LBLK; if (args->rmtblkno) { - error = __xfs_attr_rmtval_remove(dac); + error = xfs_attr_rmtval_remove(dac); if (error == -EAGAIN) trace_xfs_attr_set_iter_return( dac->dela_state, args->dp); @@ -615,7 +615,7 @@ xfs_attr_set_iter( /* Set state in case xfs_attr_rmtval_remove returns -EAGAIN */ dac->dela_state = XFS_DAS_RM_NBLK; if (args->rmtblkno) { - error = __xfs_attr_rmtval_remove(dac); + error = xfs_attr_rmtval_remove(dac); if (error == -EAGAIN) trace_xfs_attr_set_iter_return( dac->dela_state, args->dp); @@ -1447,7 +1447,7 @@ xfs_attr_remove_iter( * May return -EAGAIN. Roll and repeat until all remote * blocks are removed. */ - error = __xfs_attr_rmtval_remove(dac); + error = xfs_attr_rmtval_remove(dac); if (error == -EAGAIN) { trace_xfs_attr_remove_iter_return( dac->dela_state, args->dp); diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c index 137e569..b781e44 100644 --- a/libxfs/xfs_attr_remote.c +++ b/libxfs/xfs_attr_remote.c @@ -671,7 +671,7 @@ xfs_attr_rmtval_invalidate( * routine until it returns something other than -EAGAIN. */ int -__xfs_attr_rmtval_remove( +xfs_attr_rmtval_remove( struct xfs_delattr_context *dac) { struct xfs_da_args *args = dac->da_args; diff --git a/libxfs/xfs_attr_remote.h b/libxfs/xfs_attr_remote.h index 61b85b9..d72eff3 100644 --- a/libxfs/xfs_attr_remote.h +++ b/libxfs/xfs_attr_remote.h @@ -12,7 +12,7 @@ int xfs_attr_rmtval_get(struct xfs_da_args *args); int xfs_attr_rmtval_stale(struct xfs_inode *ip, struct xfs_bmbt_irec *map, xfs_buf_flags_t incore_flags); int xfs_attr_rmtval_invalidate(struct xfs_da_args *args); -int __xfs_attr_rmtval_remove(struct xfs_delattr_context *dac); +int xfs_attr_rmtval_remove(struct xfs_delattr_context *dac); int xfs_attr_rmt_find_hole(struct xfs_da_args *args); int xfs_attr_rmtval_set_value(struct xfs_da_args *args); int xfs_attr_rmtval_set_blk(struct xfs_delattr_context *dac); From patchwork Tue Jul 27 06:18:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401751 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D7BBC43216 for ; Tue, 27 Jul 2021 06:20:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 653B661108 for ; Tue, 27 Jul 2021 06:20:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235041AbhG0GT6 (ORCPT ); Tue, 27 Jul 2021 02:19:58 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:49474 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235656AbhG0GTu (ORCPT ); Tue, 27 Jul 2021 02:19:50 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6G8QM024358 for ; Tue, 27 Jul 2021 06:19:49 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 : content-type : mime-version; s=corp-2021-07-09; bh=+z9S5sFL1aw0KbnphArvHkpGRcbNGPfbO7xj96MaGqM=; b=DDPf/xhI8AcAJBr1zXLpEMtnUaUTchoeho31N05vDYBNy+za8uo0kabeZYDY+lPhLi9C BaBLPwZpqPikHP5cxcht4H/N531YZNuHBLQLWZxJwcxuhd21SOrzDPpUkWxAWWYRk46x /5yclXucFBhRSDa8K3+0xJQKEoe4JUOfL2l+rAzhtcrED3M3RBd3DklgjKqkmLA3upN7 1sM1Ec/QZ0iWIHyjfLpWtaYFa8LlvTxSAHj4A+ZcF+HC9Gbshq/u6wLNFmkXA6xZSSHq BB6H4eHAte1iQTBvbmBONz8Sh8lYlQ4/nmH+bBNmAAUjw0/GQAHq7q/fx/xqs5BF+i4w Tw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=+z9S5sFL1aw0KbnphArvHkpGRcbNGPfbO7xj96MaGqM=; b=uLe3HEcwoPpPIRaaEp1Cn9EVd6qUKNvILoeuCYhx+hztIGIuPpzQBM2Tuuc8Pr0ptIja QMqhxqkDsc1qPmvIjzkNjYbsjqZ4cHk2edmiGkgSBbTk+bLn+as1wTvArBN6RNgMWd6Q ZdFDYWa4Gz+IWXTvSG4aIhD+U5WGwZuWrpeIIT8Itlwq3nnkEwTRxn27WU0ahIP/eHQs qJ2LWKJCMGonqVXglAzubVtM53iN2GobOkMRBUGlYeq8IDy5Gjdg0+ZyBfpgasf4JUBi OdieGFaxIw7XGD2WmELML2fXVV/gmDT/qpCtjaJ9rL14+ulGD3UvdrwAVnK/xjR1jLu/ pA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3a235drun6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:49 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6FjJ7114851 for ; Tue, 27 Jul 2021 06:19:48 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by aserp3030.oracle.com with ESMTP id 3a2349tqqb-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BUnbj7zPMAOTUVUo8XNfYJGQkdWIDvJOA4KhBLlGQGmEc8yeHtQmqZCl17hi6UxgmI1CEwcuynJSMqf4lHqkhwLGDCPeHWFX1fuXuZvexegABVI2UgutxUQodWxdarclr8MrZuoxZswZ2DdPU1KocgQ9vP0Ba0dDR6b5K3aN1+2GciriiCNCimEOJsbFYA8TOmISiOdjSJ1CBFVROlI/DiIlL9ZOTkdG3tmtnQukubXQCTXb19ouNCYEDg+Sr7dI3KTBV6F4GTd7L7uK8TkI0+pcCtqnVioQh8HHv82n9hYyMArRGyPR8LGdQrv5A6HokTK9TpnD+E6c1QZ/Quy4Hw== 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-SenderADCheck; bh=+z9S5sFL1aw0KbnphArvHkpGRcbNGPfbO7xj96MaGqM=; b=euchzLCMRhSldFgSPNVZXKepbduPpHUrd9tjnQ3L8QA+w1ZMScMIqWBvs0g0Xm+yo7/zjmvX4EosW17zRBHwPMDj/SJqdSx/ylBL9bEMG9BTueXt3xXXy25V1zsVBdi7gjonsAYr9VxrpJDgmt5WwVA7ajPNszdo86AEjWIYkgRixwpjZuZ/Y9k/IJG3JUhXWpCQ+/1nWIeEdj/iF+Foyh7eikEpn2MoZ/oqw4tBIw7rcgdeWOji4EwrrnQf5arM2d4uOAvqHJywJZ1YuYfSXm6LxUxumVGp8B7QWEA/rYAQ6LeyUVnaCW6OVHwH/6ovYCq/g5/K248B35ZjsOSjTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+z9S5sFL1aw0KbnphArvHkpGRcbNGPfbO7xj96MaGqM=; b=zvdQLXwIDuOEs7boTsHAfEmVxeh7XGJvMy7K7im2QgUEnQw0EMtGx3u20wSdvsNKHJWN8ow6GmLH+Dq7446qcaG8/y3fWaNck4kPHVODIB2e3cFViT8caMoHTdbRyBHUg/wt4tJghS6tjIBkyEatdV2G/ZIdgWNPADwWfVwklfQ= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2709.namprd10.prod.outlook.com (2603:10b6:a02:b7::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:46 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:46 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 19/27] xfsprogs: Set up infrastructure for deferred attribute operations Date: Mon, 26 Jul 2021 23:18:56 -0700 Message-Id: <20210727061904.11084-20-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ecd3b2b-fccb-4283-26eb-08d950c687f4 X-MS-TrafficTypeDiagnostic: BYAPR10MB2709: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1443; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TPVi3LBgvs2FS0zxlXkEEsN0sgRw9QRvd5QNIqi0r4LZs9WV4qlmDs6XyCUzHUAQKsEeFtm6qi9WCbz41GL3zn1zIY3z/PgghQDTNFe4ORf46Yewc00vlSuC1bRNIznhjM41FP5h1yfhqYxU7Pc2A+mDfT5mczTnEZK2TXvf/kFNQ3Zp9sxp7lrVaNKUaDt+fs25339k2I131DVd2P/ZWEWUDXadfAPVaOXItSjijC9MzVqGiDFyhjqFIQ8s0oJtKi/ZYBfF/AwLlJgEk+Z5vz7AYe0UlIx9XAhQSF9GLtD4lYywJe6MPmytM8ikq3/KFFRkArmwjF6cP1jIrHg5fQv3Zj3pqEXwB3ZnRxUwe1Rv8iPI/n4JzNiftr1+RcupFzZ1WO5t59MiBKJvaXYa/oZ1vZv7SSlpIq4PojzFDJ9fNFSHDHyIHb+pfTm0BGDwPhp6fgl5mbs/poDGfoCs7ZCkM+vWzS5zagIQoPBBFHuNgsGC8M3wysrpZosyCCjzHg65DgFtpEldnba+jqHsdDsYW7yA2HysNRzs3Y7fTUkNNlky1/DCu9p95bqpgNdudQVhnFsrphfkTEgbgbivieGdUdmETqmt/jVJXxgwKsA/gjtE3w04IyvuE60zcbGWjZNL5TGF0tTaimV3YFq24QT+rOSB4Qj/vMt65cNLk6HDhASw3/IKlgCghy2EiXM8 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(396003)(39860400002)(346002)(366004)(136003)(83380400001)(6486002)(2906002)(44832011)(6666004)(86362001)(6916009)(956004)(38100700002)(2616005)(36756003)(52116002)(38350700002)(478600001)(8936002)(186003)(8676002)(6506007)(5660300002)(66946007)(316002)(6512007)(26005)(1076003)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rCu5QJI+7KUedh0wAXuhC2B6QpcbkTceJhy/EpD6WyuOJBzKr3FAlCOY6mzcysx0lUBDkUpR/Lr2s7B+ljrfj46AvJOaXZeT0s1uDYDYUyDoTKwKYaA2Wq3ZEKyXS4fjyE45z6XCKsLffOi4r0wEoBgzd1HK1fYUhRtLY7ufsxpaQw1iK2/oRESGiWxbtjxq0QyG212krwaSNdpZ4aEJrdCiZLvtrqVeozkB1U9Is0ysG2kFs2G2jTGSd6OMZMUJNiRiaRCmrXNqVzBzRNgJi1ct/M0/iG7SbhlM9E4Shb3cVLsu2j+mPbX7I4T6i9Ry2ST3oJXzpn9iRQYStVj8/gXhyWSt6P9HoXV2Ek8R1b9CvICPIYTkRAc7ZKxRQwRzjZFGpj7d4FNDUJupUl6txhLsXs+BpHhydPM/edENP+0pwSAT8cXJkSl1ySxf4KnN+xtXNyx/Omba3ie3vbiOXK8d2vgBMDxt7xQWqKKix1ZddnmmoWmMp3Sa7jYoaq64LPk/wNe5Zo0f397sH4ESdymD9ILK6HQpRMX+nm/ffJ6/ahAEDQR94xEj9gBEovU19RfJruvfJdzqunJukWCoWF/5fIyRRGRO0TZ3lhBf7UIh7N1XYlmweYk8iaGEUauCw4KcSRdaFIAgvlaS0YdfZW1znLlWfFVOq0GU7L0mJyC/N1tgRFJuR2dobDwuI/s4I+4WHOJkc1zFWnR9P2nS0oHpxCAUCRbB+8ANJuCRWGvj4HW4TA5kfnp3jDRFbInjg2jEVWxd8qkdChNWXRn/byYrI9eBaujgXHwfk3+4gHI19hBC1RMuHdm3C41AGksIGj1HQGlF7KIH5AOZkD1KAtNDHiEURHjJV05NWCyKX7Gog866pWj+JfgEgEZyYVkeNYJxs2mVr2tRmZWn0hA/0Al3/HQkvaC7nrmsFYcEMOPkjgETiUhUAyeOfLjlK8XmYYs8lERyPVVPEcGL+BHOMBlLgB78rcLg8w+lY6/JdUHVfs55uD7Y00xwE59XIjQHSKdA7YgMCbhUZdmUQ5xf2T37ReoKOi5X9pdk3FyZNscYws+lnm6Qh5jpY4fPLKo7ckR4Cxe8/lQrtDZSK6t18XqY1hI/s5iP0yW+uZl3RDlrqc5spVHNhLK9g+1HLAT7ZIa7P5vcCB+0oF1vqHA4cq8OIqSFk9tBtwMb18lrH0tFYtlzt4QJfrglrzD17aCCQ71vcvVyiaQYkXr9l84VHGIxDhN8UwsFrZ95rwUOFH7EXknZfJnnp9SwsbuiT050NgGbxLZT3RwCUEW/JjiNP/AxRBrdPSqZIf06qjJ42AL8hNCYP/e7R2PSy9DK0Vih X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ecd3b2b-fccb-4283-26eb-08d950c687f4 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:46.6019 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MB7sg8sjjbM6MmUpRDpDuB1GOazEe20G/T7clJDdHSA+7fADcUvwNgnEPXy/zYFkaNdQWzKwBQs9Gdmqs2Dkk49w3SuXCPiBPWwRS+OSFKM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2709 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: TN2a1mexl4oJrrbq3rVXOZOWW7wGlnco X-Proofpoint-ORIG-GUID: TN2a1mexl4oJrrbq3rVXOZOWW7wGlnco Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Currently attributes are modified directly across one or more transactions. But they are not logged or replayed in the event of an error. The goal of delayed attributes is to enable logging and replaying of attribute operations using the existing delayed operations infrastructure. This will later enable the attributes to become part of larger multi part operations that also must first be recorded to the log. This is mostly of interest in the scheme of parent pointers which would need to maintain an attribute containing parent inode information any time an inode is moved, created, or removed. Parent pointers would then be of interest to any feature that would need to quickly derive an inode path from the mount point. Online scrub, nfs lookups and fs grow or shrink operations are all features that could take advantage of this. This patch adds two new log item types for setting or removing attributes as deferred operations. The xfs_attri_log_item will log an intent to set or remove an attribute. The corresponding xfs_attrd_log_item holds a reference to the xfs_attri_log_item and is freed once the transaction is done. Both log items use a generic xfs_attr_log_format structure that contains the attribute name, value, flags, inode, and an op_flag that indicates if the operations is a set or remove. Signed-off-by: Allison Henderson --- libxfs/defer_item.c | 3 +++ libxfs/libxfs_priv.h | 1 + libxfs/xfs_attr.c | 4 +--- libxfs/xfs_attr.h | 31 +++++++++++++++++++++++++++++++ libxfs/xfs_defer.h | 1 + libxfs/xfs_log_format.h | 43 +++++++++++++++++++++++++++++++++++++++++-- 6 files changed, 78 insertions(+), 5 deletions(-) diff --git a/libxfs/defer_item.c b/libxfs/defer_item.c index b18182e..a1f0d7e 100644 --- a/libxfs/defer_item.c +++ b/libxfs/defer_item.c @@ -20,6 +20,9 @@ #include "xfs_refcount.h" #include "xfs_bmap.h" #include "xfs_inode.h" +#include "xfs_da_format.h" +#include "xfs_da_btree.h" +#include "xfs_attr.h" /* Dummy defer item ops, since we don't do logging. */ diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 7181a858..0272ef2 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -518,6 +518,7 @@ static inline int retzero(void) { return 0; } #define xfs_quota_reserve_blkres(i,b) (0) #define xfs_qm_dqattach(i) (0) +#define xfs_qm_dqattach_locked(i,b) (0) #define uuid_copy(s,d) platform_uuid_copy((s),(d)) #define uuid_equal(s,d) (platform_uuid_compare((s),(d)) == 0) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index f2db0d5..70665d9 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -61,8 +61,6 @@ STATIC int xfs_attr_node_hasname(xfs_da_args_t *args, struct xfs_da_state **state); STATIC int xfs_attr_fillstate(xfs_da_state_t *state); STATIC int xfs_attr_refillstate(xfs_da_state_t *state); -STATIC int xfs_attr_set_iter(struct xfs_delattr_context *dac, - struct xfs_buf **leaf_bp); STATIC int xfs_attr_node_removename(struct xfs_da_args *args, struct xfs_da_state *state); @@ -166,7 +164,7 @@ xfs_attr_get( /* * Calculate how many blocks we need for the new attribute, */ -STATIC int +int xfs_attr_calc_size( struct xfs_da_args *args, int *local) diff --git a/libxfs/xfs_attr.h b/libxfs/xfs_attr.h index 8de5d1d..463b2be 100644 --- a/libxfs/xfs_attr.h +++ b/libxfs/xfs_attr.h @@ -28,6 +28,11 @@ struct xfs_attr_list_context; */ #define ATTR_MAX_VALUELEN (64*1024) /* max length of a value */ +static inline bool xfs_hasdelattr(struct xfs_mount *mp) +{ + return false; +} + /* * Kernel-internal version of the attrlist cursor. */ @@ -454,6 +459,7 @@ enum xfs_delattr_state { */ #define XFS_DAC_DEFER_FINISH 0x01 /* finish the transaction */ #define XFS_DAC_LEAF_ADDNAME_INIT 0x02 /* xfs_attr_leaf_addname init*/ +#define XFS_DAC_DELAYED_OP_INIT 0x04 /* delayed operations init*/ /* * Context used for keeping track of delayed attribute operations @@ -461,6 +467,11 @@ enum xfs_delattr_state { struct xfs_delattr_context { struct xfs_da_args *da_args; + /* + * Used by xfs_attr_set to hold a leaf buffer across a transaction roll + */ + struct xfs_buf *leaf_bp; + /* Used in xfs_attr_rmtval_set_blk to roll through allocating blocks */ struct xfs_bmbt_irec map; xfs_dablk_t lblkno; @@ -474,6 +485,23 @@ struct xfs_delattr_context { enum xfs_delattr_state dela_state; }; +/* + * List of attrs to commit later. + */ +struct xfs_attr_item { + struct xfs_delattr_context xattri_dac; + + /* + * Indicates if the attr operation is a set or a remove + * XFS_ATTR_OP_FLAGS_{SET,REMOVE} + */ + unsigned int xattri_op_flags; + + /* used to log this item to an intent */ + struct list_head xattri_list; +}; + + /*======================================================================== * Function prototypes for the kernel. *========================================================================*/ @@ -490,11 +518,14 @@ int xfs_attr_get_ilocked(struct xfs_da_args *args); int xfs_attr_get(struct xfs_da_args *args); int xfs_attr_set(struct xfs_da_args *args); int xfs_attr_set_args(struct xfs_da_args *args); +int xfs_attr_set_iter(struct xfs_delattr_context *dac, + struct xfs_buf **leaf_bp); int xfs_has_attr(struct xfs_da_args *args); int xfs_attr_remove_args(struct xfs_da_args *args); int xfs_attr_remove_iter(struct xfs_delattr_context *dac); bool xfs_attr_namecheck(const void *name, size_t length); void xfs_delattr_context_init(struct xfs_delattr_context *dac, struct xfs_da_args *args); +int xfs_attr_calc_size(struct xfs_da_args *args, int *local); #endif /* __XFS_ATTR_H__ */ diff --git a/libxfs/xfs_defer.h b/libxfs/xfs_defer.h index 05472f7..7566f61 100644 --- a/libxfs/xfs_defer.h +++ b/libxfs/xfs_defer.h @@ -63,6 +63,7 @@ extern const struct xfs_defer_op_type xfs_refcount_update_defer_type; extern const struct xfs_defer_op_type xfs_rmap_update_defer_type; extern const struct xfs_defer_op_type xfs_extent_free_defer_type; extern const struct xfs_defer_op_type xfs_agfl_free_defer_type; +extern const struct xfs_defer_op_type xfs_attr_defer_type; /* * This structure enables a dfops user to detach the chain of deferred diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h index 3e15ea2..66ea559 100644 --- a/libxfs/xfs_log_format.h +++ b/libxfs/xfs_log_format.h @@ -117,7 +117,11 @@ struct xfs_unmount_log_format { #define XLOG_REG_TYPE_CUD_FORMAT 24 #define XLOG_REG_TYPE_BUI_FORMAT 25 #define XLOG_REG_TYPE_BUD_FORMAT 26 -#define XLOG_REG_TYPE_MAX 26 +#define XLOG_REG_TYPE_ATTRI_FORMAT 27 +#define XLOG_REG_TYPE_ATTRD_FORMAT 28 +#define XLOG_REG_TYPE_ATTR_NAME 29 +#define XLOG_REG_TYPE_ATTR_VALUE 30 +#define XLOG_REG_TYPE_MAX 30 /* * Flags to log operation header @@ -240,6 +244,8 @@ typedef struct xfs_trans_header { #define XFS_LI_CUD 0x1243 #define XFS_LI_BUI 0x1244 /* bmbt update intent */ #define XFS_LI_BUD 0x1245 +#define XFS_LI_ATTRI 0x1246 /* attr set/remove intent*/ +#define XFS_LI_ATTRD 0x1247 /* attr set/remove done */ #define XFS_LI_TYPE_DESC \ { XFS_LI_EFI, "XFS_LI_EFI" }, \ @@ -255,7 +261,9 @@ typedef struct xfs_trans_header { { XFS_LI_CUI, "XFS_LI_CUI" }, \ { XFS_LI_CUD, "XFS_LI_CUD" }, \ { XFS_LI_BUI, "XFS_LI_BUI" }, \ - { XFS_LI_BUD, "XFS_LI_BUD" } + { XFS_LI_BUD, "XFS_LI_BUD" }, \ + { XFS_LI_ATTRI, "XFS_LI_ATTRI" }, \ + { XFS_LI_ATTRD, "XFS_LI_ATTRD" } /* * Inode Log Item Format definitions. @@ -863,4 +871,35 @@ struct xfs_icreate_log { __be32 icl_gen; /* inode generation number to use */ }; +/* + * Flags for deferred attribute operations. + * Upper bits are flags, lower byte is type code + */ +#define XFS_ATTR_OP_FLAGS_SET 1 /* Set the attribute */ +#define XFS_ATTR_OP_FLAGS_REMOVE 2 /* Remove the attribute */ +#define XFS_ATTR_OP_FLAGS_TYPE_MASK 0xFF /* Flags type mask */ + +/* + * This is the structure used to lay out an attr log item in the + * log. + */ +struct xfs_attri_log_format { + uint16_t alfi_type; /* attri log item type */ + uint16_t alfi_size; /* size of this item */ + uint32_t __pad; /* pad to 64 bit aligned */ + uint64_t alfi_id; /* attri identifier */ + uint64_t alfi_ino; /* the inode for this attr operation */ + uint32_t alfi_op_flags; /* marks the op as a set or remove */ + uint32_t alfi_name_len; /* attr name length */ + uint32_t alfi_value_len; /* attr value length */ + uint32_t alfi_attr_flags;/* attr flags */ +}; + +struct xfs_attrd_log_format { + uint16_t alfd_type; /* attrd log item type */ + uint16_t alfd_size; /* size of this item */ + uint32_t __pad; /* pad to 64 bit aligned */ + uint64_t alfd_alf_id; /* id of corresponding attri */ +}; + #endif /* __XFS_LOG_FORMAT_H__ */ From patchwork Tue Jul 27 06:18:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64C93C4320A for ; Tue, 27 Jul 2021 06:20:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4DF9261108 for ; Tue, 27 Jul 2021 06:20:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235502AbhG0GUA (ORCPT ); Tue, 27 Jul 2021 02:20:00 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:49862 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235323AbhG0GTu (ORCPT ); Tue, 27 Jul 2021 02:19:50 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6HkJ1023079 for ; Tue, 27 Jul 2021 06:19:50 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 : content-type : mime-version; s=corp-2021-07-09; bh=K8/1r7HMYGqk1yYsUlSnIWER3NpsCLUmX/FH/8Ujzjo=; b=wb7I4fVuvhfOFVnArDKoZzB5J4+xDzClUpDmPZKRkmkSRn5ny/XVEOFpjkvz8gaPHeWy vY0Gd9Av3FncRZzcfsQY5XXIYmfiMlsJnMKy6kNeBE5sSCfoeo/obxDUBQSKp6CoYbOV dd9TI9Qtxj3yZ5BQjzROfB5JW110ngRCE3J+q0bg0XWA9CuHvxKYwEZzJgQQp2wLwQLG qfyz+IJL61zbiDjmx3Nm2G4uBt8E2qvFdwi03w7nkiEZKSLXCscbrjmidMucl8H5BSgv VcHDtuG0kKMLKLC8AuLiUAO9mGEBFMJ27im9FY9ddiIaoAtAi+pICZSLTGZhY/UDal+0 cA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=K8/1r7HMYGqk1yYsUlSnIWER3NpsCLUmX/FH/8Ujzjo=; b=obVNayKvTmnrmSbARdG1BcUnASRGYMAMxGntL9r6401Tt4c+1MXNPHcIX0kS9lxO+VD6 QA9aTTVrX/FRV5GvwQ6d2FqApOjEGh2SSTevYcV2N6DUe0uu5Ad64x1N+v7PaDSD9cme oiW6PVvmSoTrPqVMBzNNWVhlfNYTuWhuHpvYpE8dKC4Jctu3o82uG5h4oIvC/xsu9gX2 PrmBEuuPcD9yHUA/ZwinCaZ6Nh0KNvb5oqdxJTS+thQ6RSqcNp5DpTU9CE7MUdqqc5Kv Mu/eyDkwms3W2QVdKsf0cUdbdksgxwIr8fAYFykMkYww4VPFLzABGc2SnSCyg/KbuMB7 QQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3a23538uwa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:49 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6FjJ8114851 for ; Tue, 27 Jul 2021 06:19:48 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by aserp3030.oracle.com with ESMTP id 3a2349tqqb-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sc9FML+X6M8NZ64y//k5kdAUFCdnwaLktO2Mqg0R37lOz378dYj97rm0tvq4OGS2JeKv9kxZ+SXBWyUL40FcOYvKa0YjruveJXASsTPQM9wu20rj1LeoeXVtPYWWCeI1SzdDG6hNGpKzoRlvQxAolHaxr8naSeEn9/zDpj1OnSGt02QYwBjT/yTaKoEsrlgTs/ctreMEhfbNDGSG34YjIBzOwvv2b2Y7+dMTsW75JzgXO+nhnUYbZF33xipGcdOtNsQBKabOhUeA82eK5Vm/7iO4wg51zcmN/nrnpER6vJlVFiLD6ggsdMbITNWsejoNCc9t3/hqV2yfeWkcf4F14A== 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-SenderADCheck; bh=K8/1r7HMYGqk1yYsUlSnIWER3NpsCLUmX/FH/8Ujzjo=; b=dK2s5icKHyUcHKvrg8ik71KjNpFGyTL/Qvu+box2lXqR9e+EQRju0tusQ2Sgb7sY8Fa33HCnprci1Y8x68OIFoW/tPCwWTL6rkq+eH9VMnVkwsNxn8QCB5eVsfslHIDbitBTLyGHs6AMGzkh8gurTFHyym5EMcalYElM30/dYCKReqGteGj1ZTOFHKRIiCrcrcUiSQe+qUFsBlGlB0ojh13ABe/M6RvYgqEo2Az8aP2HIYtCltJ0nV8onZ36DKlgqX7j58Bn5O+lAR6T7x0OQ8Dd0Qbi/NCOaBqjk7SZtpTmZVtw0dKRo6Wz2vJzsLUFdAoFecueZQVWNpoAfhBMcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K8/1r7HMYGqk1yYsUlSnIWER3NpsCLUmX/FH/8Ujzjo=; b=aKkLh10Hwz/HsB7hzytbbFzpFBupZkMlD+3kW+gliF1qkckGjvZlpt+axWjtmaVjWkq5BQBOF3Qrsb+wJ0sp02Uu/D4pPWHEava0jWCY+p92gsnlVM/ZbUFIFkQvXzyDo9kKGmZwjRhnhjgaC0HQPJg+m4xFl95k/tOdhOmuuCs= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2709.namprd10.prod.outlook.com (2603:10b6:a02:b7::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:47 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:47 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 20/27] xfsprogs: Implement attr logging and replay Date: Mon, 26 Jul 2021 23:18:57 -0700 Message-Id: <20210727061904.11084-21-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2fab27b4-e9da-4862-8da0-08d950c6882f X-MS-TrafficTypeDiagnostic: BYAPR10MB2709: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1265; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AMdDFZ7cgzAui49fngq+3g/FiSEdeEkptGKhEZkKlzXpuPZF/yW/1I/9EkkHPL3b5QNKCVXjbd6/jcE4zqy1EtlydMWUtFMm81wbmt9LQoXBobjXLTahtd+kFeeGMHt0/iVhsoNGqZriGBrHdQx0yrHJ8zeWCEWcB5KP/XdeVI5DPYsVcA/LubA9OL6MVcudxFxxRo1IfcVarz/+ng6fdeRY45nNvgMqGXUSpco2UzViyLhc/1rtSIWx1BJKWrqJJl+YOfY5Dkp/dtcvWZM1vkE/y5Wgs48wmppGF+caqCjP439WxD3dIirsNgVcD88oQe2Zw5wkGjbWO3gmdwaSHF/E9Y3gCwHCklS8d+xlK1GWRs+ClSUjJuPHaasrK8JoIw/sNoaOhyheYAl4AYOajG5MS+HfG4PEhKRgvt1nypXKc6RknLqvc3oKmWPZVizd+Vy0hFU5vPdiVDA3isgoK54uspQH6lowBVLag7BSxdQLMkRgAmXrd9JrB23O15Ctw9Fy3Oa90BhQfefcanHwxwnzsr+Xamxr/MT2xKnlh4R6Z53zLt1P6lQnTCMRhWbrRLBsYfi8zPUHWQA3mL4EffvAk9ifa+VbJRG+/ho8piR2ZW0CwDiNcmSjZmqEuJzaRwewfJCPQmoK31wzK5R5HW+w0lCI17F8x96LXdg0Mlp5iGTGnpuGfyW0nnePIYJNZGwRYNrWnS/dg7RPYJ5tNQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(396003)(39860400002)(346002)(366004)(136003)(83380400001)(6486002)(2906002)(44832011)(6666004)(86362001)(6916009)(956004)(38100700002)(2616005)(36756003)(52116002)(38350700002)(478600001)(8936002)(186003)(8676002)(6506007)(5660300002)(66946007)(316002)(6512007)(26005)(1076003)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qsXzmJkq9tLPO3JfG28TYzGRAKEQLag7Wl6HTWybjG9x6haFMga+Q3SpxzFRghwZZOqjVSigkScGry2ExNgrTPbJBk2f+BBzf31nd+eMzJaB/K6ntKfHut+aITItPfwDeiwFSJcOkfNARtW8a215W7yQa9UhJok1vNSZKhO/J7ykSo9EfW22WSHasbQRUyloukxvZ0wXgdLW5SHYTP5uY6SEinI8tfM0P55r0/82ST5kJBGs7uFIqACRIaFAx6IEz5SxFFrjlFGrpkt1kSUBqGUb4yY1w8oDlQgtveJNGS8rvwtFbPGxMQ+yeNiqiuna5WbYVsmirqeeFVeCsAOopWJCry6HmhMTJ+IIiWFwnHgCp5D5Z0wZVOQ/DSjJHQKjD7eV2lJIbWtXN5vxPLVmAOFiWeMgIDd9Bjh1mVOWvpSUjPJlv1ku8QYLqJgzE7lldNeWLEFywk9jTi327jGoRqVC4R060rx4saN0J6el1qBEejZZvCVUSUWvFN5K1xZuzY+T15iTJt7NEHuVlGAHSVchWWWDa+B+iat4PW4cICRLj0TWZxaHL48ybYODpZLen4dMYx9waMhiS2MRXJMIIgOjNNDDl2M34ZsSr4lvQQ2dtFSNfhRvIuxVPs7l0n4SpKte5ZVashrWQyEPgBUmHJhggSeau5lzSr5E3ucjnac9zdR5ucpFHfbySF33syEByN6vpVHYFF9VFwVc+YuDbKPw6ECf7EvqNdtbtL8dqNmxDv0K7nGVQ4E49nT1cIJ9GVr9bY4ubFhyZekN0N7vjBC8ALBvb+QQkHABvzunXeMJQ3SsrYxO4e8IG5t/ZuLTTuLSG4mU4KgE4kQTmaqqRuFDdMQfZ831lD3lCfTcs/iYxzCBChUt2W8R+E9yVkLK6fhuQ3lMqlett5PhISayNtFd+3nTWKVNjmc9PPW9TOa9o8u3fn+21uEZLVx49NQsfnvltjHhz89v/K/fhjLgtm6yvXlxiQehhxQXq4UWrlf1b6B4LSdcsf0vhNy4T0n68Uw4gHkbLu40TFu3jMcvTiFxWZeHvUxTx583NhBj9iI34FV0PfsYMNzTYM99mRkrchPrNpzRTuMbayutbbPBGZpnsLvwfL6M60DDFnuso9gp8rXoZIU2PtAtPu90zFV9Srfj0E+32v0mIo6vDYuMFvbVPfKsjk7JfH/Rs1WCykNKor5ESyrkTd6b5kploMHpcA1hwKPpXMyHIU97g6GSUA6ijISGduYYuAJ9LMaAo1oYty//H691x/xcMtTJ5L+ubnqCi83q0uDYWnOO6QpkUGbzsl0bI2rffc5FfVVZqi/BeKKuhi95+ZnTMw2m18um X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fab27b4-e9da-4862-8da0-08d950c6882f X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:46.9902 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eTA+hIyVFcbFPRJ983b92GE9H+fezbcrQqBTeU3yqbO2lmV09hVckdGjo6+q5ss5eXrIiO9XlAO2dIZTd75wYqb7UVwJ/oFTTJujVBthOmI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2709 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: D7xrgZcgEVO2TEojZA92rUWrJ1C4fhda X-Proofpoint-ORIG-GUID: D7xrgZcgEVO2TEojZA92rUWrJ1C4fhda Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This patch adds the needed routines to create, log and recover logged extended attribute intents. Signed-off-by: Allison Henderson --- libxfs/defer_item.c | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++ libxfs/xfs_defer.c | 1 + libxfs/xfs_defer.h | 1 + libxfs/xfs_format.h | 10 +++- 4 files changed, 148 insertions(+), 1 deletion(-) diff --git a/libxfs/defer_item.c b/libxfs/defer_item.c index a1f0d7e..f144ed6 100644 --- a/libxfs/defer_item.c +++ b/libxfs/defer_item.c @@ -116,6 +116,143 @@ const struct xfs_defer_op_type xfs_extent_free_defer_type = { }; /* + * Performs one step of an attribute update intent and marks the attrd item + * dirty.. An attr operation may be a set or a remove. Note that the + * transaction is marked dirty regardless of whether the operation succeeds or + * fails to support the ATTRI/ATTRD lifecycle rules. + */ +STATIC int +xfs_trans_attr_finish_update( + struct xfs_delattr_context *dac, + struct xfs_buf **leaf_bp, + uint32_t op_flags) +{ + struct xfs_da_args *args = dac->da_args; + unsigned int op = op_flags & + XFS_ATTR_OP_FLAGS_TYPE_MASK; + int error; + + error = xfs_qm_dqattach_locked(args->dp, 0); + if (error) + return error; + + switch (op) { + case XFS_ATTR_OP_FLAGS_SET: + args->op_flags |= XFS_DA_OP_ADDNAME; + error = xfs_attr_set_iter(dac, leaf_bp); + break; + case XFS_ATTR_OP_FLAGS_REMOVE: + ASSERT(XFS_IFORK_Q(args->dp)); + error = xfs_attr_remove_iter(dac); + break; + default: + error = -EFSCORRUPTED; + break; + } + + /* + * Mark the transaction dirty, even on error. This ensures the + * transaction is aborted, which: + * + * 1.) releases the ATTRI and frees the ATTRD + * 2.) shuts down the filesystem + */ + args->trans->t_flags |= XFS_TRANS_DIRTY; + + return error; +} + +/* Get an ATTRI. */ +static struct xfs_log_item * +xfs_attr_create_intent( + struct xfs_trans *tp, + struct list_head *items, + unsigned int count, + bool sort) +{ + return NULL; +} + +/* Abort all pending ATTRs. */ +STATIC void +xfs_attr_abort_intent( + struct xfs_log_item *intent) +{ +} + +/* Get an ATTRD so we can process all the attrs. */ +static struct xfs_log_item * +xfs_attr_create_done( + struct xfs_trans *tp, + struct xfs_log_item *intent, + unsigned int count) +{ + return NULL; +} + +/* Process an attr. */ +STATIC int +xfs_attr_finish_item( + struct xfs_trans *tp, + struct xfs_log_item *done, + struct list_head *item, + struct xfs_btree_cur **state) +{ + struct xfs_attr_item *attr; + int error; + struct xfs_delattr_context *dac; + + attr = container_of(item, struct xfs_attr_item, xattri_list); + dac = &attr->xattri_dac; + /* + * Corner case that can happen during a recovery. Because the first + * iteration of a multi part delay op happens in xfs_attri_item_recover + * to maintain the order of the log replay items. But the new + * transactions do not automatically rejoin during a recovery as they do + * in a standard delay op, so we need to catch this here and rejoin the + * leaf to the new transaction + */ + if (attr->xattri_dac.leaf_bp && + attr->xattri_dac.leaf_bp->b_transp != tp) { + xfs_trans_bjoin(tp, attr->xattri_dac.leaf_bp); + xfs_trans_bhold(tp, attr->xattri_dac.leaf_bp); + } + + /* + * Always reset trans after EAGAIN cycle + * since the transaction is new + */ + dac->da_args->trans = tp; + + error = xfs_trans_attr_finish_update(dac, &dac->leaf_bp, + attr->xattri_op_flags); + if (error != -EAGAIN) + kmem_free(attr); + + return error; +} + +/* Cancel an attr */ +STATIC void +xfs_attr_cancel_item( + struct list_head *item) +{ + struct xfs_attr_item *attr; + + attr = container_of(item, struct xfs_attr_item, xattri_list); + kmem_free(attr); +} + +const struct xfs_defer_op_type xfs_attr_defer_type = { + .max_items = 1, + .create_intent = xfs_attr_create_intent, + .abort_intent = xfs_attr_abort_intent, + .create_done = xfs_attr_create_done, + .finish_item = xfs_attr_finish_item, + .cancel_item = xfs_attr_cancel_item, +}; + +/* * AGFL blocks are accounted differently in the reserve pools and are not * inserted into the busy extent list. */ diff --git a/libxfs/xfs_defer.c b/libxfs/xfs_defer.c index 1fdf6c7..06df7ea 100644 --- a/libxfs/xfs_defer.c +++ b/libxfs/xfs_defer.c @@ -174,6 +174,7 @@ static const struct xfs_defer_op_type *defer_op_types[] = { [XFS_DEFER_OPS_TYPE_RMAP] = &xfs_rmap_update_defer_type, [XFS_DEFER_OPS_TYPE_FREE] = &xfs_extent_free_defer_type, [XFS_DEFER_OPS_TYPE_AGFL_FREE] = &xfs_agfl_free_defer_type, + [XFS_DEFER_OPS_TYPE_ATTR] = &xfs_attr_defer_type, }; static void diff --git a/libxfs/xfs_defer.h b/libxfs/xfs_defer.h index 7566f61..58cf4e2 100644 --- a/libxfs/xfs_defer.h +++ b/libxfs/xfs_defer.h @@ -19,6 +19,7 @@ enum xfs_defer_ops_type { XFS_DEFER_OPS_TYPE_RMAP, XFS_DEFER_OPS_TYPE_FREE, XFS_DEFER_OPS_TYPE_AGFL_FREE, + XFS_DEFER_OPS_TYPE_ATTR, XFS_DEFER_OPS_TYPE_MAX, }; diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h index 5d8a129..f062766 100644 --- a/libxfs/xfs_format.h +++ b/libxfs/xfs_format.h @@ -485,7 +485,9 @@ xfs_sb_has_incompat_feature( return (sbp->sb_features_incompat & feature) != 0; } -#define XFS_SB_FEAT_INCOMPAT_LOG_ALL 0 +#define XFS_SB_FEAT_INCOMPAT_LOG_DELATTR (1 << 0) /* Delayed Attributes */ +#define XFS_SB_FEAT_INCOMPAT_LOG_ALL \ + (XFS_SB_FEAT_INCOMPAT_LOG_DELATTR) #define XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN ~XFS_SB_FEAT_INCOMPAT_LOG_ALL static inline bool xfs_sb_has_incompat_log_feature( @@ -590,6 +592,12 @@ static inline bool xfs_sb_version_hasbigtime(struct xfs_sb *sbp) (sbp->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_BIGTIME); } +static inline bool xfs_sb_version_hasdelattr(struct xfs_sb *sbp) +{ + return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 && + (sbp->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_LOG_DELATTR); +} + /* * Inode btree block counter. We record the number of inobt and finobt blocks * in the AGI header so that we can skip the finobt walk at mount time when From patchwork Tue Jul 27 06:18:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0746DC432BE for ; Tue, 27 Jul 2021 06:20:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E744C61107 for ; Tue, 27 Jul 2021 06:20:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235323AbhG0GUB (ORCPT ); Tue, 27 Jul 2021 02:20:01 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:50162 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235103AbhG0GTu (ORCPT ); Tue, 27 Jul 2021 02:19:50 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6GBvp024367 for ; Tue, 27 Jul 2021 06:19:50 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 : content-type : mime-version; s=corp-2021-07-09; bh=HUFIKKBzbHEMKWM2m+0ajmiNbCXlZFxGJvTB/Em5jQQ=; b=09PYeeksW67tJMMx7/mT28tKz6JSOHNtj/9swLK/u6rtA6kbDpyoVUE8J/6pdrQglxJt vLHKoJdBaacbvW8JD/E2gXKSOGWKIOe6BjA3BWAZ3s2KtgKQY+cdUz2vwIXkwbcKCsIr MUucdancHAaYKA0tvTHTQV7hCZ3weeXEcyQt8Zf3q8ZHrKcJcqBPaIoBy1X8OVRhJepz G1Ef4vw/UKBsk1/nuinjUFyMPfa5aBpUlZtAXxQxFpStfPMNMXRpup5JGW3Miw6mP/Jr 7u2YLMkl6yV6LYzXXjSyNvPW5VK6TNor9xaXQegyjEV9VJmqdEz3qApBWL8b8gek01cc xw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=HUFIKKBzbHEMKWM2m+0ajmiNbCXlZFxGJvTB/Em5jQQ=; b=cupzySjMQJ7sj/c7ip7zwh40Vd9Mf1WGj8qvYx9/JMuDi4k7bQKKalVHLa24r7FPihwb 35M/iGZAmBo7wfWGd2CGniUtKLQa1dMU9xWRxk0t/09a80HWjHoFFx9s0EL2F+NeETIq Ns1JR91OC+K5On1orsJ/iIAchhu7NQC0bhBXJk15h6F2frw6OsSHc0jkXxnKp1FT2Yyp Yc+FCS05BhGBLzTp6j8uslHfyKKGlL8JfLq3b6S7zRHbKqUtpxxTDRvbSa4D+e+qEZ+K yzLndieYUxjMG6FiiuNaFFJiu59JuOUyYTb+pjBsN4ZRrC26lRslCa5+2EcG3tVfTBW4 gA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3a235drun8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:50 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6FknP114917 for ; Tue, 27 Jul 2021 06:19:49 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by aserp3030.oracle.com with ESMTP id 3a2349tqr9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JmAtnE8LcGmNMVlT9q+6NewqGw2sVNIl3DcU4BV5FESETuxEwtnLXxrqNab5LLzS0EJU+CCRsa8rWn2EPmybPLBqoESK1RyyOJjTGLBoXV3sg+BbbWdp0uNG8Pd1vzPLf0bH1HLSWqDLwVOUMquWleUoY8clzH+yvwne12BjIhj3qBdxb8d8g0ctNIs82vAAtk+qikkIHAW7oyfzRuLuXksWV0vkGnYoJwctCMbnh3entxTLQhl9MWum2ttAogebl4tYCiUtmHlMVxQ9HeqArxXVViwc4MsVU9QpbRv/p64DpjtpzRrOFHPCO3NWeLuxKtDzk3OOiKlsMnJmsAB2nw== 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-SenderADCheck; bh=HUFIKKBzbHEMKWM2m+0ajmiNbCXlZFxGJvTB/Em5jQQ=; b=RUAlBgLSr4M9lzW92Uzrj9Vum1NcSnzKbW/WKDbPzs04tBxqVLb5tkzzlFXFTrhEaVF6m3aKZkm0XKGJ3HDUyxnEn1VGAp9VipsN+zyoL3KywdTcVNpHdy7F+Q8b7elOWfA/TcsnqpEF3bcif+frvHhvPpURP6/nHydN+zCdj2xynaYuPrvf1tweUz1Kvem2qjetBmnn2o2xKa+s+z4he7hyzu0KbnZK/B1cAjEZZ8Eg8gXRelzAlhSutz/PzP24oI7b+lmJ/uTNKYXV4Q0T8iIF2y47SByRduPb1XDHnMDxc+x6pJ8smy9Amp1f+3gBJqHVOUTZ8k2oeWTGrNqh6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HUFIKKBzbHEMKWM2m+0ajmiNbCXlZFxGJvTB/Em5jQQ=; b=fgN0fSqzx+vyqBQ73c5U4a4AiSBxVFOA2tAY5f82foALvlwLDxdE9Xs0hR3BdQHK1imqyfTcazC+JWxLA3S1mmwmBhWPkCRuaA/Y5I2UfhOJKB2branCYYujtxs78UDfOixeRCm9WNnVpArJTWnwYoC9KtB62dz6bTBJdTBPV6Y= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2791.namprd10.prod.outlook.com (2603:10b6:a03:83::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:47 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:47 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 21/27] RFC xfsprogs: Skip flip flags for delayed attrs Date: Mon, 26 Jul 2021 23:18:58 -0700 Message-Id: <20210727061904.11084-22-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a4733e38-4e03-4d42-b365-08d950c68866 X-MS-TrafficTypeDiagnostic: BYAPR10MB2791: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p7pYxGX9ma20kuUMt3YCoaQifFgwAJMT6jEu0iVT6BIMfVWU6YcOnKo4bbyXeJoOlq2Yc5trY5pLiVZFeVCFyX8Wx1OuXF8VgVNknJ8f5G+pLMvyL87y0J7SMW0ii0Rhb14L49xJFJWeXhKWQT7UuCro+Sg0ESLAD3MhioJ7a8qVVkX/DbkITRdQZrfezCVpy11s3pioGcQBaprzutuFIL9Q3T5pKnbLAxvJoJWuxyfVPo3yDW6sK/1NtjAbpzoNzQmv1kDHGZ1dBIs2/Y3E8UJogPThMdWavQStb5HczKtuW6QbiXAqs8yrpGvaQe6h/gAe8tOXYAnwAH8wuke/o8F8geC8ADXAEyuOAwMcARr7FARTzl3Ut0KPi0vZsZZ/14XwFtx0PIQftDThZWhSIdLfu1bRCk4iSGYUO+g3k+k6+RCW0IRLk0b9T3vtSr70WWdCi8/HPkz7lW/fDBJPfJvSpa0KkwGsshK8EwabmiVXwjbc338UILSIbc+iOBGlqse3qMMbgLWcY24G8tngQG+Zd153MrE3ntqLYzE8U96K8edAtoxhiBZnn+uv7UHjvR3EdgOIS73biLZhX2t7WBkkFxDT168raomSQ4j6af0Szj4tk76562mqvE2RfI81hZY24i1fIeBiXzSZkiZBSXH2RS4kTdJQxodfWrGTMTl1d33XBYMLA9N2s6gbsd2f X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(376002)(396003)(366004)(346002)(44832011)(2906002)(36756003)(52116002)(86362001)(6916009)(83380400001)(8936002)(478600001)(956004)(1076003)(38350700002)(66476007)(6512007)(66946007)(38100700002)(66556008)(316002)(6506007)(6666004)(6486002)(26005)(5660300002)(8676002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zt+Iah015QVwzTk6y3Iiijpzr4tlQSMsE1xsw5vLY8Nh5S/LoxU94CTEv+5gs+LJjs/BADAsS2I9N3Pv8aZfYZPpW9rcMYmJy5BwTdPfG8rEk2jNBC84YEPMxTQmso/LqQzkCtEXzQqL5JHHMJPES6J4dSmDXMnJGnoFtG97lhuDR135CPK08HtWA4ryoSWzwWwynClZXly+lviY7SCTx3cHOXK81lw6+ftPbhbRSfZY5EJ0XxZAL+axTuvpJsYZAj7/HAtJfDl02SvbsKWLrfUv8qBEcfuXxKisq3UElMmbRUJOAlQOGlwJyQewAZJ3k/sa545e9xYNX3d25ItR91MhLIGNbL9I1V8U8vBTyos/v6alpBA8ZO4aenn0ZS0ZudOCyWb0JcJiQRuiRK0p8Kx4hCVvpkicRIM21YD8Q9MTTBDBY7FgmkISIfDmQnAofQFdMCiisF0vXB+3TKh0dThWxBTqK12Mw/YJyVS/wL4sfgBzC+Xe58u3J+hm4fFwwdETBIxin9pModYq6hzGlwFL8SnMtMFcuM5rL/6grmJeabyKDpe8Wx+deeKT5HSb8rPIjYcMPfulCs0lX0z1ZxtA2W5otsLQ2aBLeWj8x0q9int/4VMYWecRL5c/odDPjCEL63XbDaxYn8xJNPmJdd0AFVzFXyisZ3FSD9PhgpAwMiWdfEyUBbnDjNqqRydaF6KWxaR01xvhZyfg5kaHYIFpDeNvCcKMntlmVHU61NJnMwxYwRFJqus1x0CbpHVOVcFdI6m1iTwe1f1pDvIpbUx5VbsUePVKJxc/HcbN8sstsqV32eEWFqD+i689KWZFHhtAurwBqNkf8bB/OvYUGezfbzdTATmWSyU+TyndXGu68uT/oJhvJpgQjCerQtRrjoPBJIBnjSC9OCtZgr7WyQ87CBe9dr6cLY1mcJfCm0JbJUsrN9Qm7nsjgQ2Bwx1ncXQMHDXgQsAllasNyGHSBJIDwoETzFFqfkXfWwuR26lryahyO3EiQhWxgOFPmFUWjLtnxNfFjj+y6CFp2pMy0s0w3VKBa8yu++uKYP4U29rsDxnZxZSPACMOoYZbId9kVv8+VY6I3N9UR/k5I4dkat+qHBiSiZa1gC0ZCcReZNMHKHDX00EOALBMpE/4sZhp5DUuxXTl+6XntTJJ9x39Ic1fvBWN3eswtNYo9fdvjAmzqxDANuj7SPk4bntRvpq3fMFwnuW5GRtIIRPRMlrwk2gCwB9JvjtOvhThbuf8Y/+VV3qy4yItjwd+5r98t4rEdJhGtHihdiBEBBe8mJ7yYpjmgomrP/6na1ayYR/SDq3oqfgNF6MDEYGXlEjJtQ0g X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4733e38-4e03-4d42-b365-08d950c68866 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:47.3636 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wud718N1+rp/ihsnyP2D0/S64cFwmkUJWfsqWVl8ncwFDlsRqhs3BEeGM7OSkgKWCXtJ0GJN+opCwGbLUjAs8FkotxLYdSPDC3HHJiqzPnk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2791 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: cSHgT8wbdkA_tE33e3Jh5qJpKmpKMTkw X-Proofpoint-ORIG-GUID: cSHgT8wbdkA_tE33e3Jh5qJpKmpKMTkw Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Source kernel commit: 2b1c81a8c3f453ba16b6db8dae256723bf53c051 This is a clean up patch that skips the flip flag logic for delayed attr renames. Since the log replay keeps the inode locked, we do not need to worry about race windows with attr lookups. So we can skip over flipping the flag and the extra transaction roll for it RFC: In the last review, folks asked for some performance analysis, so I did a few perf captures with and with out this patch. What I found was that there wasnt very much difference at all between having the patch or not having it. Of the time we do spend in the affected code, the percentage is small. Most of the time we spend about %0.03 of the time in this function, with or with out the patch. Occasionally we get a 0.02%, though not often. So I think this starts to challenge needing this patch at all. This patch was requested some number of reviews ago, be perhaps in light of the findings, it may no longer be of interest. 0.03% 0.00% fsstress [xfs] [k] xfs_attr_set_iter Keep it or drop it? Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong --- libxfs/xfs_attr.c | 51 +++++++++++++++++++++++++++++--------------------- libxfs/xfs_attr_leaf.c | 3 ++- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 70665d9..9967719 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -354,6 +354,7 @@ xfs_attr_set_iter( struct xfs_inode *dp = args->dp; struct xfs_buf *bp = NULL; int forkoff, error = 0; + struct xfs_mount *mp = args->dp->i_mount; /* State machine switch */ switch (dac->dela_state) { @@ -475,16 +476,21 @@ xfs_attr_set_iter( * In a separate transaction, set the incomplete flag on the * "old" attr and clear the incomplete flag on the "new" attr. */ - error = xfs_attr3_leaf_flipflags(args); - if (error) - return error; - /* - * Commit the flag value change and start the next trans in - * series. - */ - dac->dela_state = XFS_DAS_FLIP_LFLAG; - trace_xfs_attr_set_iter_return(dac->dela_state, args->dp); - return -EAGAIN; + if (!xfs_hasdelattr(mp)) { + error = xfs_attr3_leaf_flipflags(args); + if (error) + return error; + /* + * Commit the flag value change and start the next trans + * in series. + */ + dac->dela_state = XFS_DAS_FLIP_LFLAG; + trace_xfs_attr_set_iter_return(dac->dela_state, + args->dp); + return -EAGAIN; + } + + /* fallthrough */ case XFS_DAS_FLIP_LFLAG: /* * Dismantle the "old" attribute/value pair by removing a @@ -586,17 +592,21 @@ xfs_attr_set_iter( * In a separate transaction, set the incomplete flag on the * "old" attr and clear the incomplete flag on the "new" attr. */ - error = xfs_attr3_leaf_flipflags(args); - if (error) - goto out; - /* - * Commit the flag value change and start the next trans in - * series - */ - dac->dela_state = XFS_DAS_FLIP_NFLAG; - trace_xfs_attr_set_iter_return(dac->dela_state, args->dp); - return -EAGAIN; + if (!xfs_hasdelattr(mp)) { + error = xfs_attr3_leaf_flipflags(args); + if (error) + goto out; + /* + * Commit the flag value change and start the next trans + * in series + */ + dac->dela_state = XFS_DAS_FLIP_NFLAG; + trace_xfs_attr_set_iter_return(dac->dela_state, + args->dp); + return -EAGAIN; + } + /* fallthrough */ case XFS_DAS_FLIP_NFLAG: /* * Dismantle the "old" attribute/value pair by removing a @@ -1240,7 +1250,6 @@ xfs_attr_node_addname_clear_incomplete( * Re-find the "old" attribute entry after any split ops. The INCOMPLETE * flag means that we will find the "old" attr, not the "new" one. */ - args->attr_filter |= XFS_ATTR_INCOMPLETE; state = xfs_da_state_alloc(args); state->inleaf = 0; error = xfs_da3_node_lookup_int(state, &retval); diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c index e23fc3d..056f4eb 100644 --- a/libxfs/xfs_attr_leaf.c +++ b/libxfs/xfs_attr_leaf.c @@ -1478,7 +1478,8 @@ xfs_attr3_leaf_add_work( if (tmp) entry->flags |= XFS_ATTR_LOCAL; if (args->op_flags & XFS_DA_OP_RENAME) { - entry->flags |= XFS_ATTR_INCOMPLETE; + if (!xfs_hasdelattr(mp)) + entry->flags |= XFS_ATTR_INCOMPLETE; if ((args->blkno2 == args->blkno) && (args->index2 <= args->index)) { args->index2++; From patchwork Tue Jul 27 06:18:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401759 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4D6BC4320A for ; Tue, 27 Jul 2021 06:20:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 88EEE610A0 for ; Tue, 27 Jul 2021 06:20:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235668AbhG0GUC (ORCPT ); Tue, 27 Jul 2021 02:20:02 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:50442 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235675AbhG0GTv (ORCPT ); Tue, 27 Jul 2021 02:19:51 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6GdIW007040 for ; Tue, 27 Jul 2021 06:19:50 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 : content-type : mime-version; s=corp-2021-07-09; bh=J7eU3T/UQ2Mly4rg6q6HHFpr9b/VATWPGLy+ovlgcuY=; b=k/GgfB/+hn59AWDW3cJTe+vgccUNJoNM8vAppqqsXwN8da1/G3teN8sL2KSm6YnAevPO NqAPvZjTRGcnMS/W0G3lK8hvc1hXhxS0B338xVGHPtxsp+et6kCojiQpT77BQZlKGcJc F6uhN77uy5G6ejlD9scz17dOrj+VikkAWIDNSgQUb26L+DG8Ehw5CJJB6qXq4XJt+p0p 5C1vejNS7cIQPsjK8vgmKWRGUh1KTM4QWezCyCWhx1uwP3gah6Rr00Ef3WOHXgPPJe7f LchTgYlRlyyA/T1n8+kJvB3MaIETm6PQYw8D8iw60GuB7pqWCAVxL01MroYZvBti1yvr UA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=J7eU3T/UQ2Mly4rg6q6HHFpr9b/VATWPGLy+ovlgcuY=; b=ZMI/XmUxswkjnWcZlTckQfhmjBik1dv22xX4WXCkx2fN5rR1wZY+HOL23zuOwHbo0QY+ mRvIECG5uWYq/xmZdEV47jM567XnQg/CH/JY8g1MK+sBF/ubAPxhv8QtvMMZJoRQ58Cu uT2XvaQb0B19Vw/+Uv+0PbvFAh1Zgz9X/1WQO6kLQ1LrfafpUFjfRB2ZjBDwRCYWnine yFj60N8YulNOejNXDguQ7P4BmIDae4V5wVqiE13HkHGoQL9PLKc9prIVSBrtffg42cWP 9EfuGlcfxBh6cHvPZzjBwr/cVPmEXys6SppMnGdZHxCOW7II0pMJ4gkiyGNdkZgRQJfa 3Q== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3a234n0ue0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:50 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6FjJ9114851 for ; Tue, 27 Jul 2021 06:19:49 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by aserp3030.oracle.com with ESMTP id 3a2349tqqb-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l1WHvyUM9NfuamJGkui/iMVYgft20LpT/poVQJwXF3mWBsSxflxjt/U9kS7DTPoc6T1USvBXjxGUdArhWRWKj1YsGKSQTM3noZ9x0LUmUAiCcx2vn9vpz9CM4x+EA7DldwsA7AHXfeAd/qSGVFzQdzoPIgAKD2biJcBcrIzseR4IYx4ag1l0c0fxcPQYRNgM9GeTDlRxNYaEfda9/aJ8hJAaXKz7EmAHYxuckEtIOptulf3KgT9iQXwi8nPWquna4JnVMVago/cr3axTf1aCr6h3oJW5rcX8zDVXNGiUwc8xSrUfarJ1vBT3WET2YOEjKAoDfbKlmbCxvh2SacVXLA== 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-SenderADCheck; bh=J7eU3T/UQ2Mly4rg6q6HHFpr9b/VATWPGLy+ovlgcuY=; b=KdYZV4kmOyyPKwlSD5L0RB/Oy2ZgjvMQ0Np+tHhE0d8ADRuLNrH2/SpT9sQBPMta9zeVFAyEyTh6KabiAwKK65nyq6kiVg/+8llk0oPZtqQseQxbHQftxKjymfn/Nw6erfGObzbRwf6cyxHL1qejJ8dSZiipy1/1mIxox4d1dXom94ybjlHF38xBd8a5kdJIIhSZ2hzHgYHS1RybP+rmNEtDxwjUpCF7LCifxsKykIC1ENEp3Gqp7zjgcEA9A3tRx7VgnnDZW41SKB3ody52fWktSL+nrC4XrgUEo/7nAzXebN5ZRxGcBAhjfegqpArmJmmWQmzOMvVrlDEL/HMXwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=J7eU3T/UQ2Mly4rg6q6HHFpr9b/VATWPGLy+ovlgcuY=; b=NEuWcV/YBtgt+8v/M+maD25D8/LNawMrROY8JYGA19PRwvDNe0Z/7tHmq5u3263RmyMKSF+UqCjVEqTq4cjsemkFRagEmIM73Xs3BrcgP5PcxZhXNfprH1lnllOS/HSRvQiungVsYc/TOaQw4MULO/G2G2gwOFPb8PtJf7m0jMA= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2709.namprd10.prod.outlook.com (2603:10b6:a02:b7::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:47 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:47 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 22/27] xfsprogs: Add xfs_attr_set_deferred and xfs_attr_remove_deferred Date: Mon, 26 Jul 2021 23:18:59 -0700 Message-Id: <20210727061904.11084-23-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 27987aad-bd92-4e35-f33d-08d950c688a1 X-MS-TrafficTypeDiagnostic: BYAPR10MB2709: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dtGEzKDoHwed6XMkFdpkEG9oglYBCAZySdLJlEvNEjL9+MNfj+yXE1R+hSi2pfDJPMXPeBUAWAdtZgMg851fdMnDe30/FfT2gQB7teJ9IK3REe3PS7WX/dhNjIXxwTXaxwUVktUXn2jW3ypvE/KwRjjKQPDh21+OCtcmhbh7PUIlfmcWRX7x6+QIL5Pwm9wuGC5GMlp5sBprkD8VRF8Ei5nfGZwtPAGTS3XJMwq8bjR1E0SUoWKpIflYGwwXBloYRwPD7qcFbat89zdf7WpWe4rHL/2Tj2zTE96kcDJ8F3JA73hfn48mCMt1hn/zE0Cx9e7MNFz10uF61qdHvoWSxlO88IP0LVbY7IPdoJowk8EbBe5i9ndOZOaFag33tGrWEZKjAmerFdcVjUf3ATVJpyaimpKc7Ff9Riq38ivbQyIQauX3VsG83Sc/K2qqIRuOCIKpBZTZYrovFEQ6BcCTcSzmBl+cgf1VeMmdzam2gldN/aXPfhvC/5Ks99taaG6R8kIU4OLfVyhsph3Zi04aM4Cv+t7yioCkABQUcS9fngT1OFwkPNBkN+6Mp03gBHp52nyIZK8b0GfwollohBkFF6qYQ4LpUhINl/wqwMDns78MMayZkgwSAFRtFvwF+CEix0DI+YmwuibOMrfq/AWHQQGHvP/NWVuo/dg6PB+lKrf3Ca3T4hDM80QZE0koGj2K X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(396003)(39860400002)(346002)(366004)(136003)(83380400001)(6486002)(2906002)(44832011)(6666004)(86362001)(6916009)(956004)(38100700002)(2616005)(36756003)(52116002)(38350700002)(478600001)(8936002)(186003)(8676002)(6506007)(5660300002)(66946007)(316002)(6512007)(26005)(1076003)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KFsdr0IHLesmjZCbGGhg3Mo/zPfJeoWb/rVaqSREv8yDw49mS8JBDgHdErscRdNbMnfCwTlBJ37b7St4t7ti4uU6P3rOTmG0bxEABkmUKHaxJf2Op1OBI/kCDvpZFixaECzzYUCa93NW+acdHzpcn872u6LGQNuFBkxjctudTHLs8ijnIpVICFwc9nNDWpWRqwlHJLr/Fh3NFYhosmJw3ol8Adt2aNo42HRMUFXdSQnoWp1SrKpAGQr4gGzpUcPQt4jgSC5wOR65ue5sqeq/PNe0YJ3ORty4rnIboJcWobw0kD9GllnHqaR0L/+wCDsTFb5/6XPQkaU3WgXc70L32XafAm5QVTBUm8oyswlhXKajoeOeT7kgaNG3daQbQZusgLXTjCkevkALaRm/DtKKbFpF78kw8cUtydt3alYCbCr6ty4XKq+OQps/eb5IU3rkH73Ff5ekLL41/pXglekiY0SyNL5BVXUYwVixP/sUHWuMRy9Bk7cWuncrogD+7hhtur5KjrRYJBZPFfbJsAoR1vpktBqmZcP59a2AzEYeknCzBOraZiYvDvnoGBq77LHfynRKZ7skNE8tuNpd6haZZ0yTmoWhQFIu3fcST/rcmlL9bq7WegJLSOcc3JF1egfp57qRM9IjHZaM4CnZMDJj46oYB/OAHgI9OvWDmxObM3pFkAvRy1cChZ8JdxL012OMQSSKQaKGy+7eNML3e9Veu4aTsZ0TwVoE/Tul1e7cbroaCwarzfcpJGYq5ELwwEcZ6Ur424HS82LAkPIluz2NG7oUbEkV65GpbM3JBIfVC5BdazpWP/DTAbT09zPsQ1yW43PP7kpxWz3WHzOtR8DdPr49uHPgVdUoyIAURVjt+YjL4Mb57v/IsltHFYXLNb/c8CWWSOjnR+YOOGQCKFhsf0dmMEyAUJtlmJFAb/3ZVXrZkRYeRrEeAdOrmxsM3Wk1AMF5OrI0+knrpOHy5k0vW8BDgF3NOGTuxwo7xI7NZxNYkFb9BPXrfttPtwrO08O14RgP+XuJHr86LmYxi482Bcuu5dMrksS5aB50Md8z+ho/ZD4krpsDwfnKlLUhh+KrRwjyag8jLneFhmC81LjzJA/Tikz1QnABrCw9b7HDTvH7AgexDj5icL4TPoxyTZ3WeRvLdoAudss2Us3WhHUJMRqVVeno6UA3AkqNhHN1IT9f4P4fNUgd71aCVr6Riwo+1o6vfYk8N/jZDW7uJQ2n/qhNdNIzD2hEAQtmPSJmchiXuYA9PQDazJZNfd5/ya27FruPAJrbZfv1iXXqVPijmX4uC7lQN5NMpdSv1eOZpMGYkf17k0dmKWZ05gvncXxb X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27987aad-bd92-4e35-f33d-08d950c688a1 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:47.7519 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yrY+CHXlxQ4zLaH03ab7FX6Vq9JhnJCqVnKYTqTZ7Xs3wVPQZwQPtObQg9gNtAn7LUrtCoD2uu9ddEYkoppq3EeEh2ki9P9v0tQhqz/7R9Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2709 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-ORIG-GUID: a7X8gNkgTDz_-3UQe6kn3aR8TCNF-YyJ X-Proofpoint-GUID: a7X8gNkgTDz_-3UQe6kn3aR8TCNF-YyJ Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Allison Collins These routines set up and queue a new deferred attribute operations. These functions are meant to be called by any routine needing to initiate a deferred attribute operation as opposed to the existing inline operations. New helper function xfs_attr_item_init also added. Finally enable delayed attributes in xfs_attr_set and xfs_attr_remove. Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong --- libxfs/libxfs_priv.h | 4 ++++ libxfs/xfs_attr.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++--- libxfs/xfs_attr.h | 2 ++ 3 files changed, 71 insertions(+), 3 deletions(-) diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 0272ef2..0d4ec11 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -614,9 +614,13 @@ typedef int (*xfs_rtalloc_query_range_fn)( int libxfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb, xfs_off_t count_fsb); +/* xfs_log.c */ +struct xlog; bool xfs_log_check_lsn(struct xfs_mount *, xfs_lsn_t); void xfs_log_item_init(struct xfs_mount *, struct xfs_log_item *, int); +int xfs_attr_use_log_assist(struct xfs_mount *mp); +void xlog_drop_incompat_feat(struct xlog *log); #define xfs_log_in_recovery(mp) (false) /* xfs_icache.c */ diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 9967719..260ae8f 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -778,13 +778,19 @@ xfs_attr_set( rmt_blks = xfs_attr3_rmt_blocks(mp, XFS_XATTR_SIZE_MAX); } + if (xfs_hasdelattr(mp)) { + error = xfs_attr_use_log_assist(mp); + if (error) + return error; + } + /* * Root fork attributes can use reserved data blocks for this * operation if necessary */ error = xfs_trans_alloc_inode(dp, &tres, total, 0, rsvd, &args->trans); if (error) - return error; + goto drop_incompat; if (args->value || xfs_inode_hasattr(dp)) { error = xfs_iext_count_may_overflow(dp, XFS_ATTR_FORK, @@ -802,9 +808,10 @@ xfs_attr_set( if (error != -ENOATTR && error != -EEXIST) goto out_trans_cancel; - error = xfs_attr_set_args(args); + error = xfs_attr_set_deferred(args); if (error) goto out_trans_cancel; + /* shortform attribute has already been committed */ if (!args->trans) goto out_unlock; @@ -813,7 +820,7 @@ xfs_attr_set( if (error != -EEXIST) goto out_trans_cancel; - error = xfs_attr_remove_args(args); + error = xfs_attr_remove_deferred(args); if (error) goto out_trans_cancel; } @@ -835,6 +842,9 @@ xfs_attr_set( error = xfs_trans_commit(args->trans); out_unlock: xfs_iunlock(dp, XFS_ILOCK_EXCL); +drop_incompat: + if (xfs_hasdelattr(mp)) + xlog_drop_incompat_feat(mp->m_log); return error; out_trans_cancel: @@ -843,6 +853,58 @@ out_trans_cancel: goto out_unlock; } +STATIC int +xfs_attr_item_init( + struct xfs_da_args *args, + unsigned int op_flags, /* op flag (set or remove) */ + struct xfs_attr_item **attr) /* new xfs_attr_item */ +{ + + struct xfs_attr_item *new; + + new = kmem_zalloc(sizeof(struct xfs_attr_item), KM_NOFS); + new->xattri_op_flags = op_flags; + new->xattri_dac.da_args = args; + + *attr = new; + return 0; +} + +/* Sets an attribute for an inode as a deferred operation */ +int +xfs_attr_set_deferred( + struct xfs_da_args *args) +{ + struct xfs_attr_item *new; + int error = 0; + + error = xfs_attr_item_init(args, XFS_ATTR_OP_FLAGS_SET, &new); + if (error) + return error; + + xfs_defer_add(args->trans, XFS_DEFER_OPS_TYPE_ATTR, &new->xattri_list); + + return 0; +} + +/* Removes an attribute for an inode as a deferred operation */ +int +xfs_attr_remove_deferred( + struct xfs_da_args *args) +{ + + struct xfs_attr_item *new; + int error; + + error = xfs_attr_item_init(args, XFS_ATTR_OP_FLAGS_REMOVE, &new); + if (error) + return error; + + xfs_defer_add(args->trans, XFS_DEFER_OPS_TYPE_ATTR, &new->xattri_list); + + return 0; +} + /*======================================================================== * External routines when attribute list is inside the inode *========================================================================*/ diff --git a/libxfs/xfs_attr.h b/libxfs/xfs_attr.h index 463b2be..72b0ea5 100644 --- a/libxfs/xfs_attr.h +++ b/libxfs/xfs_attr.h @@ -527,5 +527,7 @@ bool xfs_attr_namecheck(const void *name, size_t length); void xfs_delattr_context_init(struct xfs_delattr_context *dac, struct xfs_da_args *args); int xfs_attr_calc_size(struct xfs_da_args *args, int *local); +int xfs_attr_set_deferred(struct xfs_da_args *args); +int xfs_attr_remove_deferred(struct xfs_da_args *args); #endif /* __XFS_ATTR_H__ */ From patchwork Tue Jul 27 06:19:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 888A9C4320E for ; Tue, 27 Jul 2021 06:20:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C8D6610A0 for ; Tue, 27 Jul 2021 06:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235691AbhG0GUE (ORCPT ); Tue, 27 Jul 2021 02:20:04 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:50746 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235695AbhG0GTv (ORCPT ); Tue, 27 Jul 2021 02:19:51 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6Hlhl023082 for ; Tue, 27 Jul 2021 06:19:50 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 : content-type : mime-version; s=corp-2021-07-09; bh=j8Gq9Y8PWrE/L2p7yPywza/y6db8MuyHSV6v2gUyiEg=; b=iZRY0ymF7cHY4WaKOhMH7c0ZZUdBq4C89K/4MyIHWUxLh5YhQF01Ymk0mFRviGbX9tgP xFk9QNE9D/fKdjOVAAxnk0H8vgzYu/Y8ndegXfguRR2ZF+z9OJuALXl22QoM/YVvHCOd i2x62PYAGH2kSyBMqF+xWaeTnmHsMOXilt1VpkH3aK0VDnavX4IBGSPLu8hgnp58n9Y1 x8Ff1GAKKTjhmVDym5NVqPXtKzL4Ck0UQ6dlEj2jwzoLYS9Fj2PadQq1O05PoAp6x639 Gcr2VVNn1kM33iAIHog3N2NZZJevd6Wc8cNZBuk74JamcQnccuN1l1qcse0QtO4UdWeZ Rg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=j8Gq9Y8PWrE/L2p7yPywza/y6db8MuyHSV6v2gUyiEg=; b=LLSfzHM7lZtzqFKyESDzWXx+zfjHb/ONGLyYvHCoEHMrJOOx6mNfYE+K6G3BjMO0pBnQ YGlicGuTJCiRMHBgM+L/FjHeFlQm7eABNgzW3O0z5ZNyq3jtRH1TJb9Z2/sjDfEYttht GeYVN/9wJok3+0vv5fnKqEVEH5qbsh3UQVJfhcNC04rwP/oaFlhlnkwPy9qTPrlr5H35 BfPSjXmRPuFy4Vnxa6V3EwMeRq5QYX0N31m1AsoQk3IuqexyaEKrmEVd3zSdvwPYGbLN HOGu/4HYALGnTLwhPYuvCrZotE8Jq9araZy0OIKWI0hpAk3yE/nTj3zokI7lrKxii7gu AQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3a23538uwe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:50 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6FjJA114851 for ; Tue, 27 Jul 2021 06:19:49 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by aserp3030.oracle.com with ESMTP id 3a2349tqqb-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jNJYuBXLKw+rpuvpQ+7q3WRO1OgKKWlc05Tx3hwayXHe3MSMH4oHZmjQNvkzszgDtcwo4ihJKmYFpB4a6+54qjYpNNdGca6iZjwQDM5s2I2zSTvR1Paqhr2Jygy1w1yR4zYWPZg9L1aMFgaTFIUbLg4FldW1hTlZzEJ11A5ZE1LllIQuVA5aQGK0DXJyvkpgvaJT+bu4fwQ+INjsYzB2QAex95E4e/S7z/TVoENNjPgF+b3ULI+J45Cn2/XPyMExz+aANqZMqlMQgVgJxYx11c1J8bdv7pNUMlKJFhX4SKiBsCByCmX9nuG9jmTkM9hblMfOTINLrodDngLOrcxUKA== 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-SenderADCheck; bh=j8Gq9Y8PWrE/L2p7yPywza/y6db8MuyHSV6v2gUyiEg=; b=AcTg08PrGdG6qyoOpEhzbjs+Gv2gL5++V39xZi8eT0Q9ALqgdVFMS4HPonrIuPNIlgyKDakHLYNeNZ77Aica9KDQIJw3ZZmP9vV0DAPMK8GO7KLUHFfVyUwL8DgyguMi+HZcKSjbRXG5v+TKO4Nof1pO4+27qvBtGBjNbq7f9H43nujVcotEk+TGz4nbBkDo+IhgHtW3lrBJFHCKKQDpRx/FoXL8j305OXQDKa8+nY7gWSDedjF5PjlCS+3yaIPbvp4s1/muRJcM2waIQstFTB771kO43bo/HJBcMZnnVNre2MYujYUu0x9n9vUqCCwnAgP2gO6Ez8HvDrJKuA04rg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j8Gq9Y8PWrE/L2p7yPywza/y6db8MuyHSV6v2gUyiEg=; b=AusgoDXPL71RYSH1gEnOA+nR3xi2pCTkWGxE5IDTmyFGM/zroHAmRpiPy1kPOm0Gxusz0/G0EUzti68zw6cpKdnKgOdrP1vWZS7akFFhtWo2VbYA9+LGIINOqfAGscKLPFfI3SGR4OIXzrm05/wuii2FcBR3Y+vHW8gRjhrpl0Y= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2709.namprd10.prod.outlook.com (2603:10b6:a02:b7::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:48 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:48 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 23/27] xfsprogs: Remove unused xfs_attr_*_args Date: Mon, 26 Jul 2021 23:19:00 -0700 Message-Id: <20210727061904.11084-24-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a470cdff-7c85-4005-0938-08d950c688e4 X-MS-TrafficTypeDiagnostic: BYAPR10MB2709: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WzMqyDYfNDqZF23jV5GhC/Ob+1SSXQKaJLcmq0Ai7o4fUfhpdhu5XqlQCaMuZ9Zjbnm0eiAC+B4g5ofAZc6agFx4J7Psp+nn5hieIzzxkEITjuXOSagZ4ARXken1uFAc1b5g2ttVNUpt7ah7V+T0U4Nm0rfk2hORJBLfOXNPcFuvbVmCFLZDtCuYaeGQ44ZRofv76XrfzqBUQPUguA7Dg9PaeJy3xLi2Ih+aL1/E73jTeTGPnYxncg1kKLLeomuVBQVYWuYREINIP7Ea+2M4tWA4SVN5QDC21d3wXxHzho8FKHLREoVEtvFz+oqA/WCgRNz3doXCBKaB70rRctbb/VV5KcuaR3kQK6VIOsJbEPRONdgop6yGncIWWCLd10fYOwx3SvkaAa3+hswriIBF70IFlV8VaEqdTMli5RisY2w00+cib/4EsKeAIcF02iTb4lyVEoZEAXGNce2tQJer5FDeafrx/Jl4uCKBQKwC9uNOjy9/YmQVVj+VYHMPoVDDyC6GlGVRgXkS76NOg3ai0kLB9exEAuBtCxK1UT59hi1B5FSGG18frSrJMmadr93BfHGwyPtIEUW/bUu3oUkjqzYCSuPegRc3h/6xeP+rp17aqtGixrsikXEjPAUAWqJXXkRUpOvBk8l9mqi1nNgnpw1/m9J4znZTxr5aPgcKl5ChsYFcZHwOSesCokDTvNb2 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(396003)(39860400002)(346002)(366004)(136003)(83380400001)(6486002)(2906002)(44832011)(6666004)(86362001)(6916009)(956004)(38100700002)(2616005)(36756003)(52116002)(38350700002)(478600001)(8936002)(186003)(8676002)(6506007)(5660300002)(66946007)(316002)(6512007)(26005)(1076003)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eGaABnocbCmIRw9SuQeYe9DK561XUeKErlt0JoBrj6h4BP6356e6Q9uw/1Gzku/althtkIdBZUfFKPBaVXrUdI528Tolxe8OwgvSGd/+23ahEN+X0ZkNqCE3Kcp/NW0dVKhQkwiM2gaC0Ph//yu+GzBrx+S5SYo3Pg66ly5ZqpY8kqNhp4yEESMx7fGMgCscRj8rmEYJ/bQS2V6kqY33dLHnonv1SYvvWfYEHGQBkvr8yacKyazoI6siNT5eio7ZViA6WlreL4ANCD63wkEtk5Mh7cLOAV4+Va7CffvGJsCVJH1ZG8RW9ZlpbLyPvPgb38SW+ghzaLZfeEPj0nZNIZ7XS/mGcGUIxOgp047i7f4nNDOD5l3DrLwojpQ64NU9HvbtjM3H6b89RfWGttw/OiHWdstg2k4WguLWFYPpF+t/pxX2Zpyx80z9pq5/orm9NOSpnkWBXEzsJyu8Nrrwzb6oTDsJ0/waf4qZA8a63Z7KowgoeK9TgEuwxF42cMka8eLmKsKT/YCi5GGroUxW5y1T59QhS0ffWUss273gvthJCI5u4tYc4gdZKnAEdwDXwi9POtfkjJnrtFw5osd9JGq0BO7HnW5PC4Nnd+aoA8KgoyNLGAaEEmIzzQh89Hpo8v6eJJELhGcCByZTR1bFg4fgA9+z1yZJEh77TCsxq3VXCavE+g2uJtV6JAUj1wPfl5bTkunA/pYzSnEnuwoiQL80m/tgok+SGF62eXNJ68mFqrmbgeOKKXTthU+Mhd7t5OACBZPFQ4mjgW6x9oSYh5Ak5lVtHy5hdjDpNAcQ7KQhq2s8AfUAVsGF5JkZIgBm5Ri7k7ep9TAVW/+QmK8P5k6XqwPZo+TKRHoZO/+k8CgXxg95Q/DAdI5j5W1Kg2qil7B5dXsOh7cTwRXn5ATeikXy5E5Aen5snIP0wf9pf8YetM+XOQ3Hk8xsUxiIHaz+qRtjzej6zT9v0T0ttyRay0diuqroUqCSVpKKDH5u4Qj/M/eSIiAhmlYtdSHMuzpZcdSVCWsiGOWqh64iXdoPYK5PM8BMsG+DcVxVwZnGyZPrOQ9ILWQpdaizoJc78hpqrymtpzavXN6n3cUv46GcLYlPfqQXH03V7t5qHMciNaYLJH/w+cZx3Hnow9XlD27WYIe8Pr7vMeS+ZVVW8s80SsBfHzlkJv+cK7Op59qu26f+fOe20bGmwhVdcQ4WPLxIqs9s5CK+CEo0fSJ3D9Nr6rnqIfpAIiSLF2NgWOqHijPbY05Vjh4zdMDx8v6Hf+mfqjIg/hKe8DXHbGb47dV8EbIiCnSmeGoO6yj80ScyhnI6etRWcE1+74UJH5A+oy3f X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a470cdff-7c85-4005-0938-08d950c688e4 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:48.1681 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Bl98HnlV5XcEvJuQFaPeBWxjTF4zwOSApS/hZXPjGUBoNwmZ9TN0u8CZkO/uQMqWHWonncPsFlrMumFXTzM60Mes4fIC3bdTdxXcSvVBu9k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2709 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: Bh0TelF-Dx7E3Q-VMMBqQ0aW1Kq4diq6 X-Proofpoint-ORIG-GUID: Bh0TelF-Dx7E3Q-VMMBqQ0aW1Kq4diq6 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Remove xfs_attr_set_args, xfs_attr_remove_args, and xfs_attr_trans_roll. These high level loops are now driven by the delayed operations code, and can be removed. Additionally collapse in the leaf_bp parameter of xfs_attr_set_iter since we only have one caller that passes dac->leaf_bp Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong --- libxfs/defer_item.c | 6 +-- libxfs/xfs_attr.c | 96 +++--------------------------------------------- libxfs/xfs_attr.h | 10 ++--- libxfs/xfs_attr_remote.c | 1 - 4 files changed, 10 insertions(+), 103 deletions(-) diff --git a/libxfs/defer_item.c b/libxfs/defer_item.c index f144ed6..41cf921 100644 --- a/libxfs/defer_item.c +++ b/libxfs/defer_item.c @@ -124,7 +124,6 @@ const struct xfs_defer_op_type xfs_extent_free_defer_type = { STATIC int xfs_trans_attr_finish_update( struct xfs_delattr_context *dac, - struct xfs_buf **leaf_bp, uint32_t op_flags) { struct xfs_da_args *args = dac->da_args; @@ -139,7 +138,7 @@ xfs_trans_attr_finish_update( switch (op) { case XFS_ATTR_OP_FLAGS_SET: args->op_flags |= XFS_DA_OP_ADDNAME; - error = xfs_attr_set_iter(dac, leaf_bp); + error = xfs_attr_set_iter(dac); break; case XFS_ATTR_OP_FLAGS_REMOVE: ASSERT(XFS_IFORK_Q(args->dp)); @@ -224,8 +223,7 @@ xfs_attr_finish_item( */ dac->da_args->trans = tp; - error = xfs_trans_attr_finish_update(dac, &dac->leaf_bp, - attr->xattri_op_flags); + error = xfs_trans_attr_finish_update(dac, attr->xattri_op_flags); if (error != -EAGAIN) kmem_free(attr); diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 260ae8f..36ef8e7 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -241,67 +241,13 @@ xfs_attr_is_shortform( ip->i_afp->if_nextents == 0); } -/* - * Checks to see if a delayed attribute transaction should be rolled. If so, - * transaction is finished or rolled as needed. - */ -STATIC int -xfs_attr_trans_roll( - struct xfs_delattr_context *dac) -{ - struct xfs_da_args *args = dac->da_args; - int error; - - if (dac->flags & XFS_DAC_DEFER_FINISH) { - /* - * The caller wants us to finish all the deferred ops so that we - * avoid pinning the log tail with a large number of deferred - * ops. - */ - dac->flags &= ~XFS_DAC_DEFER_FINISH; - error = xfs_defer_finish(&args->trans); - } else - error = xfs_trans_roll_inode(&args->trans, args->dp); - - return error; -} - -/* - * Set the attribute specified in @args. - */ -int -xfs_attr_set_args( - struct xfs_da_args *args) -{ - struct xfs_buf *leaf_bp = NULL; - int error = 0; - struct xfs_delattr_context dac = { - .da_args = args, - }; - - do { - error = xfs_attr_set_iter(&dac, &leaf_bp); - if (error != -EAGAIN) - break; - - error = xfs_attr_trans_roll(&dac); - if (error) { - if (leaf_bp) - xfs_trans_brelse(args->trans, leaf_bp); - return error; - } - } while (true); - - return error; -} - STATIC int xfs_attr_sf_addname( - struct xfs_delattr_context *dac, - struct xfs_buf **leaf_bp) + struct xfs_delattr_context *dac) { struct xfs_da_args *args = dac->da_args; struct xfs_inode *dp = args->dp; + struct xfs_buf **leaf_bp = &dac->leaf_bp; int error = 0; /* @@ -334,7 +280,6 @@ xfs_attr_sf_addname( * add. */ trace_xfs_attr_sf_addname_return(XFS_DAS_UNINIT, args->dp); - dac->flags |= XFS_DAC_DEFER_FINISH; return -EAGAIN; } @@ -347,10 +292,10 @@ xfs_attr_sf_addname( */ int xfs_attr_set_iter( - struct xfs_delattr_context *dac, - struct xfs_buf **leaf_bp) + struct xfs_delattr_context *dac) { struct xfs_da_args *args = dac->da_args; + struct xfs_buf **leaf_bp = &dac->leaf_bp; struct xfs_inode *dp = args->dp; struct xfs_buf *bp = NULL; int forkoff, error = 0; @@ -367,7 +312,7 @@ xfs_attr_set_iter( * release the hold once we return with a clean transaction. */ if (xfs_attr_is_shortform(dp)) - return xfs_attr_sf_addname(dac, leaf_bp); + return xfs_attr_sf_addname(dac); if (*leaf_bp != NULL) { xfs_trans_bhold_release(args->trans, *leaf_bp); *leaf_bp = NULL; @@ -393,7 +338,6 @@ xfs_attr_set_iter( * be a node, so we'll fall down into the node * handling code below */ - dac->flags |= XFS_DAC_DEFER_FINISH; trace_xfs_attr_set_iter_return( dac->dela_state, args->dp); return -EAGAIN; @@ -682,32 +626,6 @@ xfs_has_attr( } /* - * Remove the attribute specified in @args. - */ -int -xfs_attr_remove_args( - struct xfs_da_args *args) -{ - int error; - struct xfs_delattr_context dac = { - .da_args = args, - }; - - do { - error = xfs_attr_remove_iter(&dac); - if (error != -EAGAIN) - break; - - error = xfs_attr_trans_roll(&dac); - if (error) - return error; - - } while (true); - - return error; -} - -/* * Note: If args->value is NULL the attribute will be removed, just like the * Linux ->setattr API. */ @@ -1269,7 +1187,6 @@ xfs_attr_node_addname( * this. dela_state is still unset by this function at * this point. */ - dac->flags |= XFS_DAC_DEFER_FINISH; trace_xfs_attr_node_addname_return( dac->dela_state, args->dp); return -EAGAIN; @@ -1284,7 +1201,6 @@ xfs_attr_node_addname( error = xfs_da3_split(state); if (error) goto out; - dac->flags |= XFS_DAC_DEFER_FINISH; } else { /* * Addition succeeded, update Btree hashvals. @@ -1535,7 +1451,6 @@ xfs_attr_remove_iter( if (error) goto out; dac->dela_state = XFS_DAS_RM_NAME; - dac->flags |= XFS_DAC_DEFER_FINISH; return -EAGAIN; } @@ -1562,7 +1477,6 @@ xfs_attr_remove_iter( if (error) goto out; - dac->flags |= XFS_DAC_DEFER_FINISH; dac->dela_state = XFS_DAS_RM_SHRINK; trace_xfs_attr_remove_iter_return( dac->dela_state, args->dp); diff --git a/libxfs/xfs_attr.h b/libxfs/xfs_attr.h index 72b0ea5..c0c92bd3 100644 --- a/libxfs/xfs_attr.h +++ b/libxfs/xfs_attr.h @@ -457,9 +457,8 @@ enum xfs_delattr_state { /* * Defines for xfs_delattr_context.flags */ -#define XFS_DAC_DEFER_FINISH 0x01 /* finish the transaction */ -#define XFS_DAC_LEAF_ADDNAME_INIT 0x02 /* xfs_attr_leaf_addname init*/ -#define XFS_DAC_DELAYED_OP_INIT 0x04 /* delayed operations init*/ +#define XFS_DAC_LEAF_ADDNAME_INIT 0x01 /* xfs_attr_leaf_addname init*/ +#define XFS_DAC_DELAYED_OP_INIT 0x02 /* delayed operations init*/ /* * Context used for keeping track of delayed attribute operations @@ -517,11 +516,8 @@ bool xfs_attr_is_leaf(struct xfs_inode *ip); int xfs_attr_get_ilocked(struct xfs_da_args *args); int xfs_attr_get(struct xfs_da_args *args); int xfs_attr_set(struct xfs_da_args *args); -int xfs_attr_set_args(struct xfs_da_args *args); -int xfs_attr_set_iter(struct xfs_delattr_context *dac, - struct xfs_buf **leaf_bp); +int xfs_attr_set_iter(struct xfs_delattr_context *dac); int xfs_has_attr(struct xfs_da_args *args); -int xfs_attr_remove_args(struct xfs_da_args *args); int xfs_attr_remove_iter(struct xfs_delattr_context *dac); bool xfs_attr_namecheck(const void *name, size_t length); void xfs_delattr_context_init(struct xfs_delattr_context *dac, diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c index b781e44..42943b3 100644 --- a/libxfs/xfs_attr_remote.c +++ b/libxfs/xfs_attr_remote.c @@ -694,7 +694,6 @@ xfs_attr_rmtval_remove( * the parent */ if (!done) { - dac->flags |= XFS_DAC_DEFER_FINISH; trace_xfs_attr_rmtval_remove_return(dac->dela_state, args->dp); return -EAGAIN; } From patchwork Tue Jul 27 06:19:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401763 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94C23C432BE for ; Tue, 27 Jul 2021 06:20:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C912610A0 for ; Tue, 27 Jul 2021 06:20:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235675AbhG0GUD (ORCPT ); Tue, 27 Jul 2021 02:20:03 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:50580 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235691AbhG0GTv (ORCPT ); Tue, 27 Jul 2021 02:19:51 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6Hge2023061 for ; Tue, 27 Jul 2021 06:19:50 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 : content-type : mime-version; s=corp-2021-07-09; bh=K2E7qvG3FrPd9pWeBPpcDaXk5KEgCcpbMA1g7PaUm9Q=; b=veDKm15xaZaveAi9OXuv3Q4+G8ApuyLlgHcMj2GuiYxa7gPmQClctvaHyQi53JR5xWft ZvRN5QYdOQqa9fjrq36wsjrpm+yU/iUFhyF8rUoh0W/aLX3EY/eVj4cdPxaGwhEiVzQy 4hfjFdfbd/+n5tCU9MAdiB8S8RCpyUWiArZaL9k5555UACK1r/S0bDN7zBxvYDCP/j+X O77yUWWImXpegUZpXxYqGprCq5CE4oyyB9E6KCOQGkJI+6qk4vDnJGZclKsaDnv6Dxss C9m5DtJWRj4SZa/5c2qGDLTDUYalb700A6tiLH6TzOgi1p4S4GzB7ebeiaMtJmUUtsCp Zg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=K2E7qvG3FrPd9pWeBPpcDaXk5KEgCcpbMA1g7PaUm9Q=; b=YHrerrMnjWWvqyNJ0t0OJx+2Ab5OeKqv2yynQ3+zBDmLp0amSUMiKw2r/o+tVwduVdHw +s/ufgJ2ESjkoY20ky3jh+t+M4ZDCz5NY7jXXrfMo13rC/bc/Mx2DATq8d29A0brux+m jeRXwc0w6G51VBTbZ1Ex0V85qoLevfnpvI1MdKlRaeZ1KRW0hdSqr2NLlN0ZU5JkzPi+ Spqj+iJKVZymKnDmK1FWwQ91q2igoMIC9rlGr/xRpdH4lBdqokYOkVdnssHNGNrc4nze xa9Y6rdgpk8XxxSqZqzVSGP6iw//YOnV+K0SgeBCArd3TqdUASDSibaVLpZDf8vNB7fM Zg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3a23538uwd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:50 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6FknQ114917 for ; Tue, 27 Jul 2021 06:19:49 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by aserp3030.oracle.com with ESMTP id 3a2349tqr9-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GQBEVg4hbg5+jDdQ1fCsPOeZAd+gdP5f69ruGvGN1RQqeiOtI0wmGfnWrW9AMkzgPALSK1BRSqSlhR61MGmpWRikv5Ng7JoBcnQr+aCDC6q7VHTPYZUk77+xwwnTSWfznRQkIjwqihRe3Ji0eBVyP71vc+eOXjs/t3xyMhFlsjVjsQJ13IfVdimY44O4g3fp2BENwajykdqFgnAaN19Q6UGHSqGbiYCwNQpw10b06oxjKwUbDDmcOf+YOCiOMZdoUd9f8LAvovMkGLTc+n/joD6e9jOJ0wjWyrk+ibZS0w0vaAarZipy9guan4vyq2JbjiC93vAFjCQlxMwfjbkHVw== 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-SenderADCheck; bh=K2E7qvG3FrPd9pWeBPpcDaXk5KEgCcpbMA1g7PaUm9Q=; b=E1slet6ElSAODRBmED00y2F2NXlmcB24cM3XBRgXRsyrfPTCW5FTpbl/GchvqpM92q2/fYJeanE6f12dzqa9W9/mdrJ32sNCDJl68b1VR2gHaWex2pPKEHaB4kUrJjk+63tl6lHvREh94hJjVbfHpb8FzAuWinaUKroiuCioetZEitmAjWMa+yO+wsObKnhpC7cTh/GLdIkDtV4BVR3xZLE5x5m//TmNNrnJm3Sy885HPwuk6UPPnA2gWxLSudK6TWDW7EhPM3afFw1YNJIBuC14S7FRR0iEsbOR53sVPYi5Sj3pWz9SXxRryuGdIqsxyqgVYrq5PXPP8xOd6bWLsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K2E7qvG3FrPd9pWeBPpcDaXk5KEgCcpbMA1g7PaUm9Q=; b=B/3mBOfRRpJKGvD03FKRj98/etjYwRGr5B+wxLDhoMJQi2J4IdakTKa5wcLOlkA9d8GxvDFn3qzejjQ3nknkqvQKoPsqlNlaJIyMQKi1FVey8B4V8NUBuBkHlbrCXZB9Rz/QVUgabN+aGtOKHnQ6Wj2eL4/P00+SRyBe19SJ0Ww= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2791.namprd10.prod.outlook.com (2603:10b6:a03:83::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:48 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:48 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 24/27] xfsprogs: Add delayed attributes error tag Date: Mon, 26 Jul 2021 23:19:01 -0700 Message-Id: <20210727061904.11084-25-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 12325bac-72ff-4b0b-42a8-08d950c68921 X-MS-TrafficTypeDiagnostic: BYAPR10MB2791: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2150; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZTHYSHUihtUWsDqmac3FULcFFhW+jPQh/YLdma5dI3oXCpLvdFcx664yArfUDjCIkAs5SSrVTUNEytk+nLyznMUQXY4WHtFnkwJr/wlLSbjwXMBO6iCoYtcQHhumwoxZ+VzUZY3MwEec3rC/mKXJRfpDUyFC3+KF0YsTfqUlrz81ziH3y2GzMuCdDaWgXcG2csIkJXtgH7X1l7KZifJNV7qo7wFdeHY1xwazWFwyPcq7+DI817l8JR4KC/cM5ysLmbP8Id43NL6qL8gr1FqplAQk+s8dovsJRGxj0fXd5Hc4DxDpMJhbCzW1bqUpTlqLfe7euIV9smoNbphG7lEwm1RmN8GuIRGFQlGJUw31r+jn88xcMbn4ht+CzSB0oYOBNQavfWAMm1eXBfrlcmtLVkI2XmzVlrvcd3hd57kgAAf4Fwr8nFJF7dI7KfMF9x40obnv74+fpfNGQdR28jG41clU4lFaf5hiFuzQrTEnvdGNLx6TuW70fAOVbMppr1ZfYxH5Fpr+2AJQzv9khqlRcG/ObGMXYwybDsZ+uXo+lcHo2OBmguhC/WMjonc03uf6PO6VVmNT7ISwIOfx1h//gcmY8EiBAXlI5Aq/aIWYKQRgYjqh4s5AYhXhPszbAsN/bf4NVAdAeKq52iBzz/nkD/5koOxTBRMGYAFSfDHxVfDUwAU8f4J9671M0le6luPfBeiHlwOd/y3y6tAC0ueMZg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(376002)(396003)(366004)(346002)(44832011)(2906002)(36756003)(52116002)(86362001)(6916009)(83380400001)(8936002)(478600001)(956004)(1076003)(38350700002)(66476007)(6512007)(66946007)(38100700002)(66556008)(316002)(6506007)(6666004)(6486002)(26005)(5660300002)(8676002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: H1zCxcWbbzb40F4c/XSohIsVVz94xsUOqvHUktCH5QWZ1IRCnBRZeNeHejkz5Vut2tWUv9WE+ogk+beleyaIK3oE7Qok2x5wLfFTHLdowcrpFNUtoGuY2/Xe7KVzrSbnBUYJO4QIV4lJ9Up5S3cuEGKVe6WVPttHh3D4Yo/fWLtGLalkwWHDo4pL+ZTx10CKc4WcSpSRwN+OG6ckqgn81M5mYLaCFqKykB+x7N7eBg8acgWPP5tiLgOkiKvY0BCHfRIZnl4P/+p8/l4y7kZr7UVBFWoeiLSLMv1Ct+5p4EGkl/eoyqtdoi8DfjN8WJbQTS7TsHxUlyVzlQQrNZk6h0YlulaE4CNUlv7tEdrANW8gE6JdO9Ip+ZZFH6Z4loxNsQlWQtkofCVf8jUn/qnrPuDb4ir51i5tAv9jf4cZiTDa/FzuJy/J3jb1tMf3Sia307Zjktt44l/DQotYdEfKkFyObCC7PT8e6Zgvy3xl6hAchs/QiyLoLeo6MkASmx9yvcLHbXcUb8zXfKsVanHcJBoLBMP8lPsKl955tKjQMHBL1FVJgkaon0n2GP/HEqZPHMZD/BBfRChMQvZj6Nka4uw4rxWHS2yFSKPrKNsuqArkYoQkT3sQKnJq9/IFnU7ASjFsHNi8dKIiOUnay7LGiEtWZrOxcWsFfKpiM6N5bHOZ8EmfVKzOWjIjh3oLE4D3JyYHQAi0eTbfSDZetMNvelcO57lyS0Qng9ME25Tn32bAEgo1LWkdJdUEpe2gWV1JU5rwko5pYfFeMczGJtzR4OI+s6F82u6kgj/KlDr06rPLe4llcJstNI0HDl8jOCrk0OOrxnfCI2QPrqvRDPoZ5RcOfM/PoZxuNfxb+9XFYiYXnWoWfJ6kn1qnJM3r1MhWSC/+qCRBfTHcCUZn3U+8UItAFgZcK3uXR7cv3rS7o6LC5UOqdWOlR4vOX0fJVtBTROIbpyoPLEeXjeSdK75jt7/MRNZyNwVAD7+dLHOQIvregaXa0Hhcp/UyW1RCISyzdsmBdjftiHdI70PprZmyInlQGYLNvvFiHsrW0VeasFEgbuKLjSRIkn6Lqz3Wm+Puilff4xrjwTNv9PYqWPePYMXWTpWyH2jXc9xeI4GFAfGX8V9og7zIf7mGgQn09pjIRjEJdNLhvo27L64cKVAPG3OHR5tYeea4HpUdHr/IlwU9Fsh16c7mDtNe9fhdnY7/r5XdL7sZ+ZkOqQws96LXRUfWvD0u8Rh7RyHc/0sHUEk8VrM56gT0+DZOYKL2vbxNvnoEgUgPTUmUGNjSVIhiQa5AWKQvCUWLG1LWosoBAnHQlkYRi0FZSJJivIjGCPul X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 12325bac-72ff-4b0b-42a8-08d950c68921 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:48.5554 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: plgyTF95XH1X3G9O3+Jicc9vrNDie6v7uI8KyNE+Vi4NaETEQbCUN7jYHGJQ/EwAZaqYAnO6KtisMAHHnbjlx2tpm4H5Kd/8IK/dkHETXA4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2791 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: sscCaEK9B-zPvwaj_xf3e1Pxh3L2AxAZ X-Proofpoint-ORIG-GUID: sscCaEK9B-zPvwaj_xf3e1Pxh3L2AxAZ Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This patch adds an error tag that we can use to test delayed attribute recovery and replay Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong --- io/inject.c | 1 + libxfs/defer_item.c | 6 ++++++ libxfs/xfs_errortag.h | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/io/inject.c b/io/inject.c index b8b0977..53286a3 100644 --- a/io/inject.c +++ b/io/inject.c @@ -58,6 +58,7 @@ error_tag(char *name) { XFS_ERRTAG_REDUCE_MAX_IEXTENTS, "reduce_max_iextents" }, { XFS_ERRTAG_BMAP_ALLOC_MINLEN_EXTENT, "bmap_alloc_minlen_extent" }, { XFS_ERRTAG_AG_RESV_FAIL, "ag_resv_fail" }, + { XFS_ERRTAG_DELAYED_ATTR, "delayed_attr" }, { XFS_ERRTAG_MAX, NULL } }; int count; diff --git a/libxfs/defer_item.c b/libxfs/defer_item.c index 41cf921..6db4380 100644 --- a/libxfs/defer_item.c +++ b/libxfs/defer_item.c @@ -135,6 +135,11 @@ xfs_trans_attr_finish_update( if (error) return error; + if (XFS_TEST_ERROR(false, args->dp->i_mount, XFS_ERRTAG_DELAYED_ATTR)) { + error = -EIO; + goto out; + } + switch (op) { case XFS_ATTR_OP_FLAGS_SET: args->op_flags |= XFS_DA_OP_ADDNAME; @@ -149,6 +154,7 @@ xfs_trans_attr_finish_update( break; } +out: /* * Mark the transaction dirty, even on error. This ensures the * transaction is aborted, which: diff --git a/libxfs/xfs_errortag.h b/libxfs/xfs_errortag.h index a23a52e..46f359c 100644 --- a/libxfs/xfs_errortag.h +++ b/libxfs/xfs_errortag.h @@ -59,7 +59,8 @@ #define XFS_ERRTAG_REDUCE_MAX_IEXTENTS 36 #define XFS_ERRTAG_BMAP_ALLOC_MINLEN_EXTENT 37 #define XFS_ERRTAG_AG_RESV_FAIL 38 -#define XFS_ERRTAG_MAX 39 +#define XFS_ERRTAG_DELAYED_ATTR 39 +#define XFS_ERRTAG_MAX 40 /* * Random factors for above tags, 1 means always, 2 means 1/2 time, etc. @@ -103,5 +104,6 @@ #define XFS_RANDOM_REDUCE_MAX_IEXTENTS 1 #define XFS_RANDOM_BMAP_ALLOC_MINLEN_EXTENT 1 #define XFS_RANDOM_AG_RESV_FAIL 1 +#define XFS_RANDOM_DELAYED_ATTR 1 #endif /* __XFS_ERRORTAG_H_ */ From patchwork Tue Jul 27 06:19:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401767 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E2D9C4338F for ; Tue, 27 Jul 2021 06:20:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 65ECE61107 for ; Tue, 27 Jul 2021 06:20:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235695AbhG0GUF (ORCPT ); Tue, 27 Jul 2021 02:20:05 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:51408 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235366AbhG0GTw (ORCPT ); Tue, 27 Jul 2021 02:19:52 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6GunL007326 for ; Tue, 27 Jul 2021 06:19:51 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 : content-type : mime-version; s=corp-2021-07-09; bh=7hn+/kfRV/bjjoR9w506HS9owY8p4367NlFHckTYsSg=; b=KAPyJXhR76s+j+siVt3zQCcGjazUcz2iGe6hDwIdWfRaj18iX0VOLWwNDrkAQnNVD126 GBIQnyL/p6ZfZmTriMXdz3BOl5gWKh2okkFPp4StZzLG4qeg5MMJsW3yN05xLFmDYaPf SeGJsLf7NZKb4asLsjbTomdJ4AO/KBt5v6BFvVo7w4PqOwsidrQpHq0+HbG4KBjx04PE bM8ICKQHgPtd8ChKgQ2miBWmuqN4rO+pS2UAOtVQCy5BgDaHMuAPFECVVmeLgA8Zfdaf os7o/5Hy/Mx1+n/RnP41CdmyFLld9/CgDTXZLitG7MDHNVeoQdJj879PCqNFZDCRtvyv 2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=7hn+/kfRV/bjjoR9w506HS9owY8p4367NlFHckTYsSg=; b=njTshsAAMfNsR/Dlbqu5Bl8+A4ITJMhIIe9xU4cam55XC0RDyIwpIw9Kjos4OXb/x8dR 3QweYoOWBAzLBT2twdMLYYASL1uAb+1RdB3DfB4DvmESU4ZFC4sLPaSdLdlAzUOwcEgm gHKVoI4UC3egRnqY9ixvhohDxBXe05cAGDmKabJdOBgu7I6MY3TLacU4GaHGa8LjTx5A nqc0wK8YK/3W/93c8HhgDJ05OvkpT+k8vUaOBivQYA5+II6pxGlgu3ldzHgMgFUEICKG /Ko2xLq2285DhjhS3ripQwJRDNL5MsvuvHQjzohfMmvAYu+fPIeGRD/Zwn4zM93+d6+W Cg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3a234n0ue3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:51 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6FjJB114851 for ; Tue, 27 Jul 2021 06:19:50 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by aserp3030.oracle.com with ESMTP id 3a2349tqqb-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZMpNyn4ZU4qCdQY+Khuk4t+70Dk3GuvJyMUFy6FxLKPs8W57kRMdx32UZmhd7TNINOGnr6mvjbxvIihtTMHrK0wgt4JwU/T/WeX6YNP/eOKhl7Bw/fEOTKVr5gdlcNnW1oW258zE/YH7k12nUp7Vy3I25sTe+8hlUzkHdG9wMsMfHz0GDj68+kmLsOSidGSEwXusEaXxG3056sdV9rYWFlJe7r6DjdUmCeWggJNACjiyRNq4SACeoTIXYxJQhcfUdaVcSL73kNf/kI39pPA1hJXrnLOJ93ipNc0XFVHDFRIMmUFmJmkM1hKsp8kge2e6uUHTtDBCiitwjAk5NRxNvA== 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-SenderADCheck; bh=7hn+/kfRV/bjjoR9w506HS9owY8p4367NlFHckTYsSg=; b=PHB/eavuoFvZWZYsX3yk6o7BXgyL4pbZYnrszNAQ8hsCzOQqN4uotkiDH8tFZM+P2PLJTCnImsXBIxQNuPl9KoTtzErRucCzlA2cSVA0UqndYXfVWirdrL4ut/+lZA0pX28FNlJa7phgaKANZyRNAeX7Orn66MomDHoBira9stoFXaB7QwliVc63cwOO/HQrs6X8H3BLuJRONSfoB4wT6jUIqdI5KIM/re8vTIoawboUzzXlXSXQEK3khsWQ02WWlpFJtlsN99UmoH9CLHjDOQHPbHu8laGEZtaFIXsHVwjBw0dHleqAfm7Rzi62lQTgn+TpSP1N1zvJAqfKk3y1NQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7hn+/kfRV/bjjoR9w506HS9owY8p4367NlFHckTYsSg=; b=mmcuqfuIpHeotYZ9o1PsSOhIw6KZcreLKc1cF3jFE/KgsOIYq9T8+Ce1y6AwoxI46pFV7MU0TqFujMMAM3kzmYSom+7E7Xb060y1MYOicsAUysGMDTXmcjxJKpRsUlK6PcRRF+IS6qsv16R/CEWSma7Ptj9ow5oBVNU4gdhe3gU= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2709.namprd10.prod.outlook.com (2603:10b6:a02:b7::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:49 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:49 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 25/27] xfsprogs: Merge xfs_delattr_context into xfs_attr_item Date: Mon, 26 Jul 2021 23:19:02 -0700 Message-Id: <20210727061904.11084-26-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d4a9fce9-277c-460d-e37b-08d950c68956 X-MS-TrafficTypeDiagnostic: BYAPR10MB2709: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1079; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mtBzYIWUcthhsirE2/h0gLZDFQQyvnPlk0lLCdAbcy9/r+jaNt09UBfS3/6RXiWnEh3ry1JVzGS25+5HmmmIDP+rNuyrOvoHJJuznBz+zQn3asPnrNoApvxTxEsmfuwT8/fX7Z8rOgI3rlptNX44bws3k8GEsZuN2RZVCpeHdc8vKYiy9w3ONwgt1OTAMtrShT2NNywTYWL6vuuz+nEzHhmzq7JSPcc/cWqV3sICLlKT/O886lKsZp3uijlPNvammR19Fr7hv/ZiqUuv8Q8k0PO19/D9lJW2EiOSnWvDk/Tfayc83/G7YlPYtxGMBiUTIB9/Uv/UkORtnWvy/TUE6fF94zl4KbazOhEn/v69OZNZ6PP2iDn43BjuONY2KqcCV2V0PIYz324wR3VgOwwsQI8BYGKJ7EV9ZHFj56bJOP3Qt7/0OcMJNidAya72WE+JufKzaiXyqk3Vy7A6zv+dGOkfSe5p8GYYI/ABhRltL4P1fOCq5VhtxSt56mKzWqPJyACudhwCMZFSdZ4zzzLmhYJMo00pZxVOwxyD5N4yg1ux2DYhFMGbhPxPNG0b5B+B4fLXXL6oqkSBHv4GhxISeVAZI6t/t9drlK7b5WQp8MAFxbURAFeMqXQBA1uBLTUEh3Bf/WxzRorcS947wg9ky2w3Ms492f+2AM8LjISx52qOQPaC23EoXkKF7W23SMtPauT/hPUg4ynfdk6XD2WwAQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(396003)(39860400002)(346002)(366004)(136003)(83380400001)(6486002)(2906002)(44832011)(6666004)(86362001)(6916009)(956004)(38100700002)(2616005)(36756003)(52116002)(38350700002)(478600001)(8936002)(186003)(8676002)(6506007)(5660300002)(66946007)(316002)(30864003)(6512007)(26005)(1076003)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RfZrLd0Zwv8Es12UaG30OGyUQWp/egvpRVP4HF+6FhHCwnFRjTxUhXM3MlpsOPiih3sigqLzpafKDn4uDrkNEv4eaWRi/uG1w3aA3HqrCZflpTpMV4ffglPsz4oT1jEl5/zn5zdX3/kEvNYTj7JfbrWlFdXVlyowx1QZLtU9SiJZK1CAM2nCPzLyIR/BNHBHITJ5Nm9ru0YFDrxrzWN+AByA+kuIMSkUEErheF2rI3/R6ib1yIp26A/qz92Vu4qxJCnaaoj8JevVtMGhqYynIo9OScrZ3JYUAkPpmI2Sr8lFz7BvJQBzqmLE4Cu8XQPXuTSStn3Pqd4aNKchiEzk8jQve0xbxX01sg6KLvC8fwvp+hSIQ4h0b284RC99Pj/8dh3C9kurp6kvEwJJqgiCAxRxN2rX5ec+rWnR0+VcQJqb3tmwWnCz+dmKByB96PhuidLNduE7owttz/lIf4VregEpEVemXCVvQ7zPWn56c+wPp6inTJjwCYBzcG1XGh7iLIgDWeeTJ5ahBHrdYunrfn/0P0RadBRHrYcjYFS3cLbqNdooTjA588wpOLlAZiWqXt3wFtCm53peMIxoPd3t0hrZEvlWRnbQVwJIflVY7C8Rv1pjVmaC5yj1mo1a9RrGRt4LpcqlccZqGHnOCzQosyje5bIij/eYn1O1gXZbnJYuKl0maaQkXfOJ6GvTzmcYCQnm/qQ3+wn+RlwRRmt3PvBdnq9hkdE4y/XwFUqA6086z1N7O80eCQJEdVcGVuO/VwsOtNYHrgtC5EKS5VXgyhzFJIXCGlH32kgb3VPQ62e5oq94AOjhpX5x4z2VQq+irUU4b56C4ma6RGHIzVooTeMlGRQXf7W6CMAECmKvzOB2C8OnVhCdDE9OXwow7kwKa5WZ1F3LYB/oJC0k/F/vx7xbQZgxj5kH/X3jCTL1joPVLgEOlx2oxM0gdx+bqGob4WW3GD6utDRQc/GqitqfzWH3qJX8QuB3GOYaiYQHiZf+6CSLzHJCeL8oUzxdUxkIcjWswfP7xrBYig+HevfoI6N/nAUdowsRp3xyLN/viJXp4AFzURD6U57o2d2/qQpqyCk+eS5+0R/nHwO9LCeC++R4l7QXU1Nn9HTJL2u2xO41kmizVASpVZEYjWKnool6xhC0obtHgo3LtWT5jFI5TiNeM5OcGmGKnLrkrMC5/rxu+DTh/RNltp3HtUsbOUB2jbLOVOPc5wCnnh+g/WXBtbaIfdf92UiI58TzdgUXKfv7wF7zuYWnQOdFUZ/SiOmrrWR8p9KMvhEXyi6jGhYXPTQ7HZbt3ww2rQIh2LW1mrN/yCP9CMIcRQMp9WQpbxhZ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4a9fce9-277c-460d-e37b-08d950c68956 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:48.9596 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: f8WEDxRfXqjEQqVmKHBcrNstzSOuhbvk/Bx/lMnkMOyURZ5oRwIA0AXpG+hs6MUuxCGKBL2H3lj92ZBv1t/F3M4+w6UsJ+i/Y3aSvXU69Bk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2709 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-ORIG-GUID: eSqp5mAhtL3-ECLAHkj-DNQGQZNMBl2o X-Proofpoint-GUID: eSqp5mAhtL3-ECLAHkj-DNQGQZNMBl2o Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This is a clean up patch that merges xfs_delattr_context into xfs_attr_item. Now that the refactoring is complete and the delayed operation infrastructure is in place, we can combine these to eliminate the extra struct Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong --- libxfs/defer_item.c | 21 +++---- libxfs/xfs_attr.c | 142 +++++++++++++++++++++++------------------------ libxfs/xfs_attr.h | 40 ++++++------- libxfs/xfs_attr_remote.c | 36 ++++++------ libxfs/xfs_attr_remote.h | 6 +- 5 files changed, 119 insertions(+), 126 deletions(-) diff --git a/libxfs/defer_item.c b/libxfs/defer_item.c index 6db4380..a595e8c 100644 --- a/libxfs/defer_item.c +++ b/libxfs/defer_item.c @@ -123,10 +123,10 @@ const struct xfs_defer_op_type xfs_extent_free_defer_type = { */ STATIC int xfs_trans_attr_finish_update( - struct xfs_delattr_context *dac, + struct xfs_attr_item *attr, uint32_t op_flags) { - struct xfs_da_args *args = dac->da_args; + struct xfs_da_args *args = attr->xattri_da_args; unsigned int op = op_flags & XFS_ATTR_OP_FLAGS_TYPE_MASK; int error; @@ -143,11 +143,11 @@ xfs_trans_attr_finish_update( switch (op) { case XFS_ATTR_OP_FLAGS_SET: args->op_flags |= XFS_DA_OP_ADDNAME; - error = xfs_attr_set_iter(dac); + error = xfs_attr_set_iter(attr); break; case XFS_ATTR_OP_FLAGS_REMOVE: ASSERT(XFS_IFORK_Q(args->dp)); - error = xfs_attr_remove_iter(dac); + error = xfs_attr_remove_iter(attr); break; default: error = -EFSCORRUPTED; @@ -205,10 +205,8 @@ xfs_attr_finish_item( { struct xfs_attr_item *attr; int error; - struct xfs_delattr_context *dac; attr = container_of(item, struct xfs_attr_item, xattri_list); - dac = &attr->xattri_dac; /* * Corner case that can happen during a recovery. Because the first * iteration of a multi part delay op happens in xfs_attri_item_recover @@ -217,19 +215,18 @@ xfs_attr_finish_item( * in a standard delay op, so we need to catch this here and rejoin the * leaf to the new transaction */ - if (attr->xattri_dac.leaf_bp && - attr->xattri_dac.leaf_bp->b_transp != tp) { - xfs_trans_bjoin(tp, attr->xattri_dac.leaf_bp); - xfs_trans_bhold(tp, attr->xattri_dac.leaf_bp); + if (attr->xattri_leaf_bp && attr->xattri_leaf_bp->b_transp != tp) { + xfs_trans_bjoin(tp, attr->xattri_leaf_bp); + xfs_trans_bhold(tp, attr->xattri_leaf_bp); } /* * Always reset trans after EAGAIN cycle * since the transaction is new */ - dac->da_args->trans = tp; + attr->xattri_da_args->trans = tp; - error = xfs_trans_attr_finish_update(dac, attr->xattri_op_flags); + error = xfs_trans_attr_finish_update(attr, attr->xattri_op_flags); if (error != -EAGAIN) kmem_free(attr); diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 36ef8e7..f5d4380 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -53,10 +53,9 @@ STATIC int xfs_attr_leaf_try_add(struct xfs_da_args *args, struct xfs_buf *bp); */ STATIC int xfs_attr_node_get(xfs_da_args_t *args); STATIC void xfs_attr_restore_rmt_blk(struct xfs_da_args *args); -STATIC int xfs_attr_node_addname(struct xfs_delattr_context *dac); -STATIC int xfs_attr_node_addname_find_attr(struct xfs_delattr_context *dac); -STATIC int xfs_attr_node_addname_clear_incomplete( - struct xfs_delattr_context *dac); +STATIC int xfs_attr_node_addname(struct xfs_attr_item *attr); +STATIC int xfs_attr_node_addname_find_attr(struct xfs_attr_item *attr); +STATIC int xfs_attr_node_addname_clear_incomplete(struct xfs_attr_item *attr); STATIC int xfs_attr_node_hasname(xfs_da_args_t *args, struct xfs_da_state **state); STATIC int xfs_attr_fillstate(xfs_da_state_t *state); @@ -243,11 +242,11 @@ xfs_attr_is_shortform( STATIC int xfs_attr_sf_addname( - struct xfs_delattr_context *dac) + struct xfs_attr_item *attr) { - struct xfs_da_args *args = dac->da_args; + struct xfs_da_args *args = attr->xattri_da_args; struct xfs_inode *dp = args->dp; - struct xfs_buf **leaf_bp = &dac->leaf_bp; + struct xfs_buf **leaf_bp = &attr->xattri_leaf_bp; int error = 0; /* @@ -292,17 +291,17 @@ xfs_attr_sf_addname( */ int xfs_attr_set_iter( - struct xfs_delattr_context *dac) + struct xfs_attr_item *attr) { - struct xfs_da_args *args = dac->da_args; - struct xfs_buf **leaf_bp = &dac->leaf_bp; + struct xfs_da_args *args = attr->xattri_da_args; + struct xfs_buf **leaf_bp = &attr->xattri_leaf_bp; struct xfs_inode *dp = args->dp; struct xfs_buf *bp = NULL; int forkoff, error = 0; struct xfs_mount *mp = args->dp->i_mount; /* State machine switch */ - switch (dac->dela_state) { + switch (attr->xattri_dela_state) { case XFS_DAS_UNINIT: /* * If the fork is shortform, attempt to add the attr. If there @@ -312,7 +311,7 @@ xfs_attr_set_iter( * release the hold once we return with a clean transaction. */ if (xfs_attr_is_shortform(dp)) - return xfs_attr_sf_addname(dac); + return xfs_attr_sf_addname(attr); if (*leaf_bp != NULL) { xfs_trans_bhold_release(args->trans, *leaf_bp); *leaf_bp = NULL; @@ -339,19 +338,19 @@ xfs_attr_set_iter( * handling code below */ trace_xfs_attr_set_iter_return( - dac->dela_state, args->dp); + attr->xattri_dela_state, args->dp); return -EAGAIN; } else if (error) { return error; } - dac->dela_state = XFS_DAS_FOUND_LBLK; + attr->xattri_dela_state = XFS_DAS_FOUND_LBLK; } else { - error = xfs_attr_node_addname_find_attr(dac); + error = xfs_attr_node_addname_find_attr(attr); if (error) return error; - error = xfs_attr_node_addname(dac); + error = xfs_attr_node_addname(attr); if (error) return error; @@ -362,9 +361,10 @@ xfs_attr_set_iter( if (!args->rmtblkno && !args->rmtblkno2) return 0; - dac->dela_state = XFS_DAS_FOUND_NBLK; + attr->xattri_dela_state = XFS_DAS_FOUND_NBLK; } - trace_xfs_attr_set_iter_return(dac->dela_state, args->dp); + trace_xfs_attr_set_iter_return(attr->xattri_dela_state, + args->dp); return -EAGAIN; case XFS_DAS_FOUND_LBLK: /* @@ -375,10 +375,10 @@ xfs_attr_set_iter( */ /* Open coded xfs_attr_rmtval_set without trans handling */ - if ((dac->flags & XFS_DAC_LEAF_ADDNAME_INIT) == 0) { - dac->flags |= XFS_DAC_LEAF_ADDNAME_INIT; + if ((attr->xattri_flags & XFS_DAC_LEAF_ADDNAME_INIT) == 0) { + attr->xattri_flags |= XFS_DAC_LEAF_ADDNAME_INIT; if (args->rmtblkno > 0) { - error = xfs_attr_rmtval_find_space(dac); + error = xfs_attr_rmtval_find_space(attr); if (error) return error; } @@ -388,11 +388,11 @@ xfs_attr_set_iter( * Repeat allocating remote blocks for the attr value until * blkcnt drops to zero. */ - if (dac->blkcnt > 0) { - error = xfs_attr_rmtval_set_blk(dac); + if (attr->xattri_blkcnt > 0) { + error = xfs_attr_rmtval_set_blk(attr); if (error) return error; - trace_xfs_attr_set_iter_return(dac->dela_state, + trace_xfs_attr_set_iter_return(attr->xattri_dela_state, args->dp); return -EAGAIN; } @@ -428,8 +428,8 @@ xfs_attr_set_iter( * Commit the flag value change and start the next trans * in series. */ - dac->dela_state = XFS_DAS_FLIP_LFLAG; - trace_xfs_attr_set_iter_return(dac->dela_state, + attr->xattri_dela_state = XFS_DAS_FLIP_LFLAG; + trace_xfs_attr_set_iter_return(attr->xattri_dela_state, args->dp); return -EAGAIN; } @@ -448,16 +448,16 @@ xfs_attr_set_iter( /* fallthrough */ case XFS_DAS_RM_LBLK: /* Set state in case xfs_attr_rmtval_remove returns -EAGAIN */ - dac->dela_state = XFS_DAS_RM_LBLK; + attr->xattri_dela_state = XFS_DAS_RM_LBLK; if (args->rmtblkno) { - error = xfs_attr_rmtval_remove(dac); + error = xfs_attr_rmtval_remove(attr); if (error == -EAGAIN) trace_xfs_attr_set_iter_return( - dac->dela_state, args->dp); + attr->xattri_dela_state, args->dp); if (error) return error; - dac->dela_state = XFS_DAS_RD_LEAF; + attr->xattri_dela_state = XFS_DAS_RD_LEAF; return -EAGAIN; } @@ -488,7 +488,7 @@ xfs_attr_set_iter( * state. */ if (args->rmtblkno > 0) { - error = xfs_attr_rmtval_find_space(dac); + error = xfs_attr_rmtval_find_space(attr); if (error) return error; } @@ -501,14 +501,14 @@ xfs_attr_set_iter( * after we create the attribute so that we don't overflow the * maximum size of a transaction and/or hit a deadlock. */ - dac->dela_state = XFS_DAS_ALLOC_NODE; + attr->xattri_dela_state = XFS_DAS_ALLOC_NODE; if (args->rmtblkno > 0) { - if (dac->blkcnt > 0) { - error = xfs_attr_rmtval_set_blk(dac); + if (attr->xattri_blkcnt > 0) { + error = xfs_attr_rmtval_set_blk(attr); if (error) return error; trace_xfs_attr_set_iter_return( - dac->dela_state, args->dp); + attr->xattri_dela_state, args->dp); return -EAGAIN; } @@ -544,8 +544,8 @@ xfs_attr_set_iter( * Commit the flag value change and start the next trans * in series */ - dac->dela_state = XFS_DAS_FLIP_NFLAG; - trace_xfs_attr_set_iter_return(dac->dela_state, + attr->xattri_dela_state = XFS_DAS_FLIP_NFLAG; + trace_xfs_attr_set_iter_return(attr->xattri_dela_state, args->dp); return -EAGAIN; } @@ -565,17 +565,17 @@ xfs_attr_set_iter( /* fallthrough */ case XFS_DAS_RM_NBLK: /* Set state in case xfs_attr_rmtval_remove returns -EAGAIN */ - dac->dela_state = XFS_DAS_RM_NBLK; + attr->xattri_dela_state = XFS_DAS_RM_NBLK; if (args->rmtblkno) { - error = xfs_attr_rmtval_remove(dac); + error = xfs_attr_rmtval_remove(attr); if (error == -EAGAIN) trace_xfs_attr_set_iter_return( - dac->dela_state, args->dp); + attr->xattri_dela_state, args->dp); if (error) return error; - dac->dela_state = XFS_DAS_CLR_FLAG; + attr->xattri_dela_state = XFS_DAS_CLR_FLAG; return -EAGAIN; } @@ -585,7 +585,7 @@ xfs_attr_set_iter( * The last state for node format. Look up the old attr and * remove it. */ - error = xfs_attr_node_addname_clear_incomplete(dac); + error = xfs_attr_node_addname_clear_incomplete(attr); break; default: ASSERT(0); @@ -782,7 +782,7 @@ xfs_attr_item_init( new = kmem_zalloc(sizeof(struct xfs_attr_item), KM_NOFS); new->xattri_op_flags = op_flags; - new->xattri_dac.da_args = args; + new->xattri_da_args = args; *attr = new; return 0; @@ -1095,16 +1095,16 @@ xfs_attr_node_hasname( STATIC int xfs_attr_node_addname_find_attr( - struct xfs_delattr_context *dac) + struct xfs_attr_item *attr) { - struct xfs_da_args *args = dac->da_args; + struct xfs_da_args *args = attr->xattri_da_args; int retval; /* * Search to see if name already exists, and get back a pointer * to where it should go. */ - retval = xfs_attr_node_hasname(args, &dac->da_state); + retval = xfs_attr_node_hasname(args, &attr->xattri_da_state); if (retval != -ENOATTR && retval != -EEXIST) return retval; @@ -1132,8 +1132,8 @@ xfs_attr_node_addname_find_attr( return 0; error: - if (dac->da_state) - xfs_da_state_free(dac->da_state); + if (attr->xattri_da_state) + xfs_da_state_free(attr->xattri_da_state); return retval; } @@ -1154,10 +1154,10 @@ error: */ STATIC int xfs_attr_node_addname( - struct xfs_delattr_context *dac) + struct xfs_attr_item *attr) { - struct xfs_da_args *args = dac->da_args; - struct xfs_da_state *state = dac->da_state; + struct xfs_da_args *args = attr->xattri_da_args; + struct xfs_da_state *state = attr->xattri_da_state; struct xfs_da_state_blk *blk; int error; @@ -1188,7 +1188,7 @@ xfs_attr_node_addname( * this point. */ trace_xfs_attr_node_addname_return( - dac->dela_state, args->dp); + attr->xattri_dela_state, args->dp); return -EAGAIN; } @@ -1217,9 +1217,9 @@ out: STATIC int xfs_attr_node_addname_clear_incomplete( - struct xfs_delattr_context *dac) + struct xfs_attr_item *attr) { - struct xfs_da_args *args = dac->da_args; + struct xfs_da_args *args = attr->xattri_da_args; struct xfs_da_state *state = NULL; int retval = 0; int error = 0; @@ -1320,10 +1320,10 @@ xfs_attr_leaf_mark_incomplete( */ STATIC int xfs_attr_node_removename_setup( - struct xfs_delattr_context *dac) + struct xfs_attr_item *attr) { - struct xfs_da_args *args = dac->da_args; - struct xfs_da_state **state = &dac->da_state; + struct xfs_da_args *args = attr->xattri_da_args; + struct xfs_da_state **state = &attr->xattri_da_state; int error; error = xfs_attr_node_hasname(args, state); @@ -1382,16 +1382,16 @@ xfs_attr_node_removename( */ int xfs_attr_remove_iter( - struct xfs_delattr_context *dac) + struct xfs_attr_item *attr) { - struct xfs_da_args *args = dac->da_args; - struct xfs_da_state *state = dac->da_state; + struct xfs_da_args *args = attr->xattri_da_args; + struct xfs_da_state *state = attr->xattri_da_state; int retval, error; struct xfs_inode *dp = args->dp; trace_xfs_attr_node_removename(args); - switch (dac->dela_state) { + switch (attr->xattri_dela_state) { case XFS_DAS_UNINIT: if (!xfs_inode_hasattr(dp)) return -ENOATTR; @@ -1410,16 +1410,16 @@ xfs_attr_remove_iter( * Node format may require transaction rolls. Set up the * state context and fall into the state machine. */ - if (!dac->da_state) { - error = xfs_attr_node_removename_setup(dac); + if (!attr->xattri_da_state) { + error = xfs_attr_node_removename_setup(attr); if (error) return error; - state = dac->da_state; + state = attr->xattri_da_state; } /* fallthrough */ case XFS_DAS_RMTBLK: - dac->dela_state = XFS_DAS_RMTBLK; + attr->xattri_dela_state = XFS_DAS_RMTBLK; /* * If there is an out-of-line value, de-allocate the blocks. @@ -1432,10 +1432,10 @@ xfs_attr_remove_iter( * May return -EAGAIN. Roll and repeat until all remote * blocks are removed. */ - error = xfs_attr_rmtval_remove(dac); + error = xfs_attr_rmtval_remove(attr); if (error == -EAGAIN) { trace_xfs_attr_remove_iter_return( - dac->dela_state, args->dp); + attr->xattri_dela_state, args->dp); return error; } else if (error) { goto out; @@ -1450,7 +1450,7 @@ xfs_attr_remove_iter( error = xfs_attr_refillstate(state); if (error) goto out; - dac->dela_state = XFS_DAS_RM_NAME; + attr->xattri_dela_state = XFS_DAS_RM_NAME; return -EAGAIN; } @@ -1460,7 +1460,7 @@ xfs_attr_remove_iter( * If we came here fresh from a transaction roll, reattach all * the buffers to the current transaction. */ - if (dac->dela_state == XFS_DAS_RM_NAME) { + if (attr->xattri_dela_state == XFS_DAS_RM_NAME) { error = xfs_attr_refillstate(state); if (error) goto out; @@ -1477,9 +1477,9 @@ xfs_attr_remove_iter( if (error) goto out; - dac->dela_state = XFS_DAS_RM_SHRINK; + attr->xattri_dela_state = XFS_DAS_RM_SHRINK; trace_xfs_attr_remove_iter_return( - dac->dela_state, args->dp); + attr->xattri_dela_state, args->dp); return -EAGAIN; } diff --git a/libxfs/xfs_attr.h b/libxfs/xfs_attr.h index c0c92bd3..8a5acde 100644 --- a/libxfs/xfs_attr.h +++ b/libxfs/xfs_attr.h @@ -430,7 +430,7 @@ struct xfs_attr_list_context { */ /* - * Enum values for xfs_delattr_context.da_state + * Enum values for xfs_attr_item.xattri_da_state * * These values are used by delayed attribute operations to keep track of where * they were before they returned -EAGAIN. A return code of -EAGAIN signals the @@ -455,7 +455,7 @@ enum xfs_delattr_state { }; /* - * Defines for xfs_delattr_context.flags + * Defines for xfs_attr_item.xattri_flags */ #define XFS_DAC_LEAF_ADDNAME_INIT 0x01 /* xfs_attr_leaf_addname init*/ #define XFS_DAC_DELAYED_OP_INIT 0x02 /* delayed operations init*/ @@ -463,32 +463,25 @@ enum xfs_delattr_state { /* * Context used for keeping track of delayed attribute operations */ -struct xfs_delattr_context { - struct xfs_da_args *da_args; +struct xfs_attr_item { + struct xfs_da_args *xattri_da_args; /* * Used by xfs_attr_set to hold a leaf buffer across a transaction roll */ - struct xfs_buf *leaf_bp; + struct xfs_buf *xattri_leaf_bp; /* Used in xfs_attr_rmtval_set_blk to roll through allocating blocks */ - struct xfs_bmbt_irec map; - xfs_dablk_t lblkno; - int blkcnt; + struct xfs_bmbt_irec xattri_map; + xfs_dablk_t xattri_lblkno; + int xattri_blkcnt; /* Used in xfs_attr_node_removename to roll through removing blocks */ - struct xfs_da_state *da_state; + struct xfs_da_state *xattri_da_state; /* Used to keep track of current state of delayed operation */ - unsigned int flags; - enum xfs_delattr_state dela_state; -}; - -/* - * List of attrs to commit later. - */ -struct xfs_attr_item { - struct xfs_delattr_context xattri_dac; + unsigned int xattri_flags; + enum xfs_delattr_state xattri_dela_state; /* * Indicates if the attr operation is a set or a remove @@ -496,7 +489,10 @@ struct xfs_attr_item { */ unsigned int xattri_op_flags; - /* used to log this item to an intent */ + /* + * used to log this item to an intent containing a list of attrs to + * commit later + */ struct list_head xattri_list; }; @@ -516,12 +512,10 @@ bool xfs_attr_is_leaf(struct xfs_inode *ip); int xfs_attr_get_ilocked(struct xfs_da_args *args); int xfs_attr_get(struct xfs_da_args *args); int xfs_attr_set(struct xfs_da_args *args); -int xfs_attr_set_iter(struct xfs_delattr_context *dac); +int xfs_attr_set_iter(struct xfs_attr_item *attr); int xfs_has_attr(struct xfs_da_args *args); -int xfs_attr_remove_iter(struct xfs_delattr_context *dac); +int xfs_attr_remove_iter(struct xfs_attr_item *attr); bool xfs_attr_namecheck(const void *name, size_t length); -void xfs_delattr_context_init(struct xfs_delattr_context *dac, - struct xfs_da_args *args); int xfs_attr_calc_size(struct xfs_da_args *args, int *local); int xfs_attr_set_deferred(struct xfs_da_args *args); int xfs_attr_remove_deferred(struct xfs_da_args *args); diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c index 42943b3..72461bd 100644 --- a/libxfs/xfs_attr_remote.c +++ b/libxfs/xfs_attr_remote.c @@ -567,14 +567,14 @@ xfs_attr_rmtval_stale( */ int xfs_attr_rmtval_find_space( - struct xfs_delattr_context *dac) + struct xfs_attr_item *attr) { - struct xfs_da_args *args = dac->da_args; - struct xfs_bmbt_irec *map = &dac->map; + struct xfs_da_args *args = attr->xattri_da_args; + struct xfs_bmbt_irec *map = &attr->xattri_map; int error; - dac->lblkno = 0; - dac->blkcnt = 0; + attr->xattri_lblkno = 0; + attr->xattri_blkcnt = 0; args->rmtblkcnt = 0; args->rmtblkno = 0; memset(map, 0, sizeof(struct xfs_bmbt_irec)); @@ -583,8 +583,8 @@ xfs_attr_rmtval_find_space( if (error) return error; - dac->blkcnt = args->rmtblkcnt; - dac->lblkno = args->rmtblkno; + attr->xattri_blkcnt = args->rmtblkcnt; + attr->xattri_lblkno = args->rmtblkno; return 0; } @@ -597,17 +597,18 @@ xfs_attr_rmtval_find_space( */ int xfs_attr_rmtval_set_blk( - struct xfs_delattr_context *dac) + struct xfs_attr_item *attr) { - struct xfs_da_args *args = dac->da_args; + struct xfs_da_args *args = attr->xattri_da_args; struct xfs_inode *dp = args->dp; - struct xfs_bmbt_irec *map = &dac->map; + struct xfs_bmbt_irec *map = &attr->xattri_map; int nmap; int error; nmap = 1; - error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)dac->lblkno, - dac->blkcnt, XFS_BMAPI_ATTRFORK, args->total, + error = xfs_bmapi_write(args->trans, dp, + (xfs_fileoff_t)attr->xattri_lblkno, + attr->xattri_blkcnt, XFS_BMAPI_ATTRFORK, args->total, map, &nmap); if (error) return error; @@ -617,8 +618,8 @@ xfs_attr_rmtval_set_blk( (map->br_startblock != HOLESTARTBLOCK)); /* roll attribute extent map forwards */ - dac->lblkno += map->br_blockcount; - dac->blkcnt -= map->br_blockcount; + attr->xattri_lblkno += map->br_blockcount; + attr->xattri_blkcnt -= map->br_blockcount; return 0; } @@ -672,9 +673,9 @@ xfs_attr_rmtval_invalidate( */ int xfs_attr_rmtval_remove( - struct xfs_delattr_context *dac) + struct xfs_attr_item *attr) { - struct xfs_da_args *args = dac->da_args; + struct xfs_da_args *args = attr->xattri_da_args; int error, done; /* @@ -694,7 +695,8 @@ xfs_attr_rmtval_remove( * the parent */ if (!done) { - trace_xfs_attr_rmtval_remove_return(dac->dela_state, args->dp); + trace_xfs_attr_rmtval_remove_return(attr->xattri_dela_state, + args->dp); return -EAGAIN; } diff --git a/libxfs/xfs_attr_remote.h b/libxfs/xfs_attr_remote.h index d72eff3..62b398e 100644 --- a/libxfs/xfs_attr_remote.h +++ b/libxfs/xfs_attr_remote.h @@ -12,9 +12,9 @@ int xfs_attr_rmtval_get(struct xfs_da_args *args); int xfs_attr_rmtval_stale(struct xfs_inode *ip, struct xfs_bmbt_irec *map, xfs_buf_flags_t incore_flags); int xfs_attr_rmtval_invalidate(struct xfs_da_args *args); -int xfs_attr_rmtval_remove(struct xfs_delattr_context *dac); +int xfs_attr_rmtval_remove(struct xfs_attr_item *attr); int xfs_attr_rmt_find_hole(struct xfs_da_args *args); int xfs_attr_rmtval_set_value(struct xfs_da_args *args); -int xfs_attr_rmtval_set_blk(struct xfs_delattr_context *dac); -int xfs_attr_rmtval_find_space(struct xfs_delattr_context *dac); +int xfs_attr_rmtval_set_blk(struct xfs_attr_item *attr); +int xfs_attr_rmtval_find_space(struct xfs_attr_item *attr); #endif /* __XFS_ATTR_REMOTE_H__ */ From patchwork Tue Jul 27 06:19:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401775 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33C7AC4320E for ; Tue, 27 Jul 2021 06:20:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F9DC61107 for ; Tue, 27 Jul 2021 06:20:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235724AbhG0GUI (ORCPT ); Tue, 27 Jul 2021 02:20:08 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:51812 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235718AbhG0GTw (ORCPT ); Tue, 27 Jul 2021 02:19:52 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6G8Ps024355 for ; Tue, 27 Jul 2021 06:19:51 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 : content-type : mime-version; s=corp-2021-07-09; bh=LVXiYrc8zJ36wJ2cmleTKxT9EdHvQrSciQjMlXsSbPE=; b=ArUfrK3iet++rC2NU4r8Rn0uAMbtaFiBqxLAfC+FYYTD07btxJeA7jLgziQk2+EPcANQ u44YVbqG7GrFaG9aIVpwmG6Ce0r09jh4v9FYZ574N9PPsBk4b8SiXkv9CFY8ygzuOgyU w7MR7d41322vEZ/hbUqOnJUxHYnubPOH8KPXfuWypotx1Xxt5hbOHYNxlJx9aCvdd8LN Rb48Fq6NyuEKrT2OtH3GqiJCGm6M5lC91MAsvc2mSr3u0h9dGIqrNLAFU30Iit5Vo2J3 ZZHIKciCckvy2CQoozNbcyZnyIH8liJSuujM6UwGHCt8ndpysN3liQlDTFoG6q/QZh4I xw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=LVXiYrc8zJ36wJ2cmleTKxT9EdHvQrSciQjMlXsSbPE=; b=JM6TytJzjXGGKmSAKyh51b5IvCltynkPXyCZFspGi4/Q0R/Th+2/UID9DT81Ag5ZYm/B XL4/AfXS8qCp3kvkyKYb4im9gVdpkQg2yEWoNq3QUgPSA48UBDXkQFbn8J/uocYNDpxJ s8l/xH46TGJ07AFogGAcAa2rVuZx/B7SwEQ/1CIs6nQu1qWfXMJWSVUws1pFj0pOJXzs ooAWKW6gQyIYgr0vDvYHjQpkKJ+j3bntdnrVrNhSPxoj/LSiwQBNesXcLuTJ7ESdAYMM ru3DzvVhnomOOJOfHoGyzlP7ICMKh7HAA7lnErAosbXqDDPiUNqYj8lz/m7umdfJRttt Bw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3a235drund-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:51 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6FjJC114851 for ; Tue, 27 Jul 2021 06:19:50 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by aserp3030.oracle.com with ESMTP id 3a2349tqqb-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GBjrkiCNSkqAVRiblZj+YV2dYnPkZwm3J/W6q1jHMkrIRsNrz97jYFcjWOF02udh1WXS2ciLVqe9dX3vfWogwQi4w9w8U7qjLTSd9JILNCdO866C63DbC9XSAVvzQgXWew9hhIH2JfQLx6/gsnkZaMDYKGzjulSY7tSOMr3IjD/4YXxinR2yuBJAvYovYFAzkiOohXgYm6YyaSXWMU7upCaZnXC4oNjhAOLixPRBFGFx4pMc624fCvX3+jcilkbbArI79nbLE15hp4sTlCqzOqrTqyq/tMBfzaBD2TAV6OzFfQHTw0/vcikgckCJvK0Zm7UgksoPUWf2ZvSuGhsrkw== 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-SenderADCheck; bh=LVXiYrc8zJ36wJ2cmleTKxT9EdHvQrSciQjMlXsSbPE=; b=N33zcKvwybOz75xCw34NCed/Gp4FGtH2+1zbAV9HqOn4AggHbnIMXUlAI9gVKiWeljijN9IJWwFfYfLb3TLZgrOnNiY55dopSSdzO9UURF7LXG4npAdOhFqNia0adE7xBD9aJaNnSwXjn8EgtkDmTpzuCxO+K9OWKmHQVklfFcgI1/Cspt/Hcs15Bc8f4xFz3HqGsow3LhDDMSmn1IjzLpXCJNlvBjp32xHcQew+iLhtg3UOXjqLzyq0GknNl7+9qto5fiXX75NwyNQP0QNA0HTJ5sArgiiYpJo/SjU4GVNWaiMxQqK8Q08yVoGWyoNnkZhk89C2DRscte6IJ7u9Ag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LVXiYrc8zJ36wJ2cmleTKxT9EdHvQrSciQjMlXsSbPE=; b=SLXWFXcm8tGSi27Sum1x/C24XbfMYZMUbnRLwBEop8xY62Jo0O60iOUKIg9ryOMmAT5AGF+q9+FbBtzuHN0W+vCwDNEtltRQf1wfqc6TLHYiP8ZidJan8PG/y6ojp1Ag+aOKZ9/gZMasABY30ja9EJSaSL42JEe46qXY9+QCA/A= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2709.namprd10.prod.outlook.com (2603:10b6:a02:b7::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:49 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:49 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 26/27] xfsprogs: Add helper function xfs_attr_leaf_addname Date: Mon, 26 Jul 2021 23:19:03 -0700 Message-Id: <20210727061904.11084-27-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a15f8887-4d94-44c9-26bf-08d950c68997 X-MS-TrafficTypeDiagnostic: BYAPR10MB2709: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sg9CZYdL9IGuVTZLIszqVp9FaPHYga7rEak1mA6QZ+7e1ZncUH9mzMbB75eHYqfe4EVJcmBH1ZK4awFz9Yhcf07TzbGqmneYIZbETZgb8xiILkcFDg2l4eRu77qxpT/JD+GwZbarISGHIM/bAhLDqrSjCsv0k08lEUCZM0oQKbvGJxp2ioABvu5xe0GP2GQAyKYNvFu0OhmYYmlzpWZnzD/91gHQGXmeTlOTaqTcHFes06+8RXzZ1EfxrQVlxoKJ2iahCy8WFxKR7v0ShGVMYPCMvxDHvmXqoQ0jV8q7PUwo8ZbrZf7NNWb12fYORWZvSZB6V74MFnwnM6d9kzdXKqRepOCOPI+gsyRsMF7gTlQrUWNmg7HtEWFWLVgJq0idHM+vIw8UakeYtZA86PF61wYg8V2lz2AC9Sa5QIGVvdhmk+HCeoI+MoiijtXscFzJL7ue+7Elc+ndt8sv8UhE/CvOWuhyq9jXovI2REmTGnzDLMFveDh6BkYuHsLFlo//Hmd7oglnlaDqa9RsLcrnNP2QN2aj6Ll3cNSkDSzT/GXLcYYsY62TvWyLieh7AalkvYvoYjy7Pq2x97yKMSJxsNB4q83HvHcYCo4YXEP5FHd5GhVnnsSiniQ3KXPVFoGuhw7d7v23qB/UWEVpEuAyg0MFBBYRz/rGWOoMTgHQRT4LbVM9cnqBcTGpW6JLyYf8 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(396003)(39860400002)(346002)(366004)(136003)(83380400001)(6486002)(2906002)(44832011)(6666004)(86362001)(6916009)(956004)(38100700002)(2616005)(36756003)(52116002)(38350700002)(478600001)(8936002)(186003)(8676002)(6506007)(5660300002)(66946007)(316002)(6512007)(26005)(1076003)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ypWvO+eEPGwPyTe9mQh3HaOFwnlet22Lnj2HQdSiBwLGMEC8SVn2Lr1r1QzGuqrilKMaQBxAhyKJE3h1Yy9BqEv9crUJW6Mlk3Rr00g4ODIf8We50nsrKDGUlR9TKTs2oaEOiWtEJmoj41yUubq/eaPBIU36P9rmk6nWSKpzmitJ1YgL1/I2EiHQdwDbsCjkQMVc3Y7adsv5j9vfDXQv66k9mUERRKIM+NEW1X6Nnp2BPV4xhVS1LPI5B6g0FKKIAF97IikBTWPpfUHDuX3diHApwvJliCBcPmHRMN/oBl+V2gNgqMhhi3dnUHssaTiIz7S8OsmEYcRK7HrcLoZkLyQWbW1dLRo1Ax75JTAQ+TSvwcHWHo5HWjNyPoApivUTFJw1UAUpAK6Lfv/NGk7rYP7kYEDVeqhPUb0Fzw2EyDw4YkDg5q7CFHLjf3IRC2gxSkkpI/tns6icLqtf0rGYCuiiNC6EsfvC56NIo80JIw9xSk/Mw0ZfTfwEalrjSpSNGu3i6H/SlwUxBSqnnNPndMQZAS+bySoByqZGMnPmGHfU48l40WnlcD0OmOmhHRHl82PwmQdnYdC5GM+PvBrWNgnLvM8cyV/TGzDpSCSeA0E5JXV4mnjTQZ47a6yBo70Q/qMaSEAJBYt+bFuXGXOvbbtRa/k6RvnmiZbYYdAaO8nxGEQVp7iSRwNLNz65WTw12RUfEabGHVzecYtwg4Og3pntu/z3uRAMsDSmqTC/T7tyGifPFa7/s/O6qZNTkkM+8tk7LWRF813fqFhZ/W+0fwW3K3QEWPYv5wIjSq1s74noqQfcafzZu7NrpBX0D82mlbMLwIb+JMP26u7AdCZaw8n0kZPWXGqSim07aXZmjNwdoVWJLSOYSkQrFTSNm+sRfUbTv84MEpUDG7U4+R3IlNXDmEn4FCzksFG8VMLkVVVo7f9fdiOKaOiduayteXY4E3Yc7IfaRPgRzcfGy1gVaeH4aPRyC5ZJp3ubmOmDWf7N/ehlcq/+fPs/LkHDMPVfJPTvnITgUR4i1pRuTc9emOHXQf95yFhpK46WIsB8waSwiS3YK+vxVwQhmwiPR7btO6hZnUO/YGuKJdeywCsL9DEmp0wJR2lL0hcKSam5THjrrwinBpiYD+mV086L53CsPCWg+S8HqqwIacZpPRr6FQf6SODsj0N4mVWpKBfnt5RDqXBAHa/BB27K4mgLMvouTwB/SD6qRXyimBIsrcEhT4e9/PjLcF4eeM1cOEDhMKAhzGlpBVSfXCU8sY6H3sr9OiJCuyU+bC6dPqGvxAHnFUZE6I1XsjCV+hp6LdBuuVTkw3RGFFazNF1Cl06rtSfn X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a15f8887-4d94-44c9-26bf-08d950c68997 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:49.3549 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tgZQJmiIZ0ZG6HX5fquId7OfaJ3+tuoB7K/ViQ38WhYUbbpCGhZCLY64D2ycUQ+dDtF7HmPIWfIkbO50zvn7Y/oNlNNR8noO3QT9xqzzi/8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2709 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-GUID: bX7z6gm0RegPpArIp3uzP6cu4Fzt_lBE X-Proofpoint-ORIG-GUID: bX7z6gm0RegPpArIp3uzP6cu4Fzt_lBE Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Source kernel commit: 6d9d518192a3f633fce0821601847966280857f7 This patch adds a helper function xfs_attr_leaf_addname. While this does help to break down xfs_attr_set_iter, it does also hoist out some of the state management. This patch has been moved to the end of the clean up series for further discussion. Suggested-by: Darrick J. Wong Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong --- include/xfs_trace.h | 1 + libxfs/xfs_attr.c | 108 +++++++++++++++++++++++++++++----------------------- 2 files changed, 61 insertions(+), 48 deletions(-) diff --git a/include/xfs_trace.h b/include/xfs_trace.h index 2169c27..4557ddd 100644 --- a/include/xfs_trace.h +++ b/include/xfs_trace.h @@ -314,6 +314,7 @@ #define trace_xfs_attr_sf_addname_return(a,b) ((void) 0) #define trace_xfs_attr_set_iter_return(a,b) ((void) 0) +#define trace_xfs_attr_leaf_addname_return(a,b) ((void) 0) #define trace_xfs_attr_node_addname_return(a,b) ((void) 0) #define trace_xfs_attr_remove_iter_return(a,b) ((void) 0) #define trace_xfs_attr_rmtval_remove_return(a,b) ((void) 0) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index f5d4380..c84997e 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -282,6 +282,65 @@ xfs_attr_sf_addname( return -EAGAIN; } +STATIC int +xfs_attr_leaf_addname( + struct xfs_attr_item *attr) +{ + struct xfs_da_args *args = attr->xattri_da_args; + struct xfs_buf *leaf_bp = attr->xattri_leaf_bp; + struct xfs_inode *dp = args->dp; + int error; + + if (xfs_attr_is_leaf(dp)) { + error = xfs_attr_leaf_try_add(args, leaf_bp); + if (error == -ENOSPC) { + error = xfs_attr3_leaf_to_node(args); + if (error) + return error; + + /* + * Finish any deferred work items and roll the + * transaction once more. The goal here is to call + * node_addname with the inode and transaction in the + * same state (inode locked and joined, transaction + * clean) no matter how we got to this step. + * + * At this point, we are still in XFS_DAS_UNINIT, but + * when we come back, we'll be a node, so we'll fall + * down into the node handling code below + */ + trace_xfs_attr_set_iter_return( + attr->xattri_dela_state, args->dp); + return -EAGAIN; + } + + if (error) + return error; + + attr->xattri_dela_state = XFS_DAS_FOUND_LBLK; + } else { + error = xfs_attr_node_addname_find_attr(attr); + if (error) + return error; + + error = xfs_attr_node_addname(attr); + if (error) + return error; + + /* + * If addname was successful, and we dont need to alloc or + * remove anymore blks, we're done. + */ + if (!args->rmtblkno && !args->rmtblkno2) + return 0; + + attr->xattri_dela_state = XFS_DAS_FOUND_NBLK; + } + + trace_xfs_attr_leaf_addname_return(attr->xattri_dela_state, args->dp); + return -EAGAIN; +} + /* * Set the attribute specified in @args. * This routine is meant to function as a delayed operation, and may return @@ -317,55 +376,8 @@ xfs_attr_set_iter( *leaf_bp = NULL; } - if (xfs_attr_is_leaf(dp)) { - error = xfs_attr_leaf_try_add(args, *leaf_bp); - if (error == -ENOSPC) { - error = xfs_attr3_leaf_to_node(args); - if (error) - return error; - - /* - * Finish any deferred work items and roll the - * transaction once more. The goal here is to - * call node_addname with the inode and - * transaction in the same state (inode locked - * and joined, transaction clean) no matter how - * we got to this step. - * - * At this point, we are still in - * XFS_DAS_UNINIT, but when we come back, we'll - * be a node, so we'll fall down into the node - * handling code below - */ - trace_xfs_attr_set_iter_return( - attr->xattri_dela_state, args->dp); - return -EAGAIN; - } else if (error) { - return error; - } - - attr->xattri_dela_state = XFS_DAS_FOUND_LBLK; - } else { - error = xfs_attr_node_addname_find_attr(attr); - if (error) - return error; + return xfs_attr_leaf_addname(attr); - error = xfs_attr_node_addname(attr); - if (error) - return error; - - /* - * If addname was successful, and we dont need to alloc - * or remove anymore blks, we're done. - */ - if (!args->rmtblkno && !args->rmtblkno2) - return 0; - - attr->xattri_dela_state = XFS_DAS_FOUND_NBLK; - } - trace_xfs_attr_set_iter_return(attr->xattri_dela_state, - args->dp); - return -EAGAIN; case XFS_DAS_FOUND_LBLK: /* * If there was an out-of-line value, allocate the blocks we From patchwork Tue Jul 27 06:19:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12401773 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A68C9C4338F for ; Tue, 27 Jul 2021 06:20:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93B286112D for ; Tue, 27 Jul 2021 06:20:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235773AbhG0GUI (ORCPT ); Tue, 27 Jul 2021 02:20:08 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:28258 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235719AbhG0GTx (ORCPT ); Tue, 27 Jul 2021 02:19:53 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16R6I7sd006844 for ; Tue, 27 Jul 2021 06:19:53 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 : content-type : mime-version; s=corp-2021-07-09; bh=A1QCuZONH/wxheI4TXSZhgKF/ClCJfzztQYwoR5vny0=; b=TU0xy5LhyFwm4IA6/HxL9oMNfu4W/PeCUOu7MJQyPU9zixmoO4FMILsxAiQV+AFXLKny KQQOS3s60eTGlh18sbB8Pc1lXVGhwT8IYafYrge4EyxK5/Q+wCwrhSIHGLtAyHnzATod WoYB8GcNCeEV0H2sV3AIPBcV6svglCuIWCqyqUSYyPiIhzf+uAO6ZarLsYzRF2NUuySc ErH/scFm2B+q/Pyro/AA9mXBhWCnc5+HM7WAS2MOQUrOj9+Q55zbzoeNdSfaaD+wC4yT Wg7bGtRn5TmwzP978SGsRVTtoDB6D6GzLFZqID8ADDCM63kTgLtCEHkdS01/eAJ0Q6L+ WA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=A1QCuZONH/wxheI4TXSZhgKF/ClCJfzztQYwoR5vny0=; b=xLUMXmgpDwmHnv/ShCLiSSqTBG3aLmhpHKAKjkpROkqOCj/ZwKlWEbULcQP8mg77OoBl 0K9NkRZqlWUbC0eoiHVyCLIr6xEZ07AU/U1fbRTMBBE+V/Bil84ySKAwW7hob9ur2ffu KS2jgdQ2lN3tzPlQY3GUUii/XKPH02M1owr3YW3KK7cZVR4DDT4LMl/JPrixS+blQMVK 5WhVxz50rMAKDh9O76sKsUAQHO1BTgIjjVwl4MJy5fuS2KtG2jLlrmeK+o1L6cd+mK3+ M7ctCkf3dg4NZF8hiUfbl4w3hU7bv951FrFErCJNkIEKpryZSLlcZr/Pm0iqhl7B5zkw SQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a2356gua4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:53 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16R6Eifr064983 for ; Tue, 27 Jul 2021 06:19:52 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2109.outbound.protection.outlook.com [104.47.70.109]) by userp3020.oracle.com with ESMTP id 3a234uvp04-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jul 2021 06:19:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H1DuscTHRlR8MwRw9D/ER3wFbiHFZwxIrB67WvdOhjvz0ELuo2OuYWQKvreePsUoyr8qLqwtGef+5xUSRqXvFOqGXfK0cfgLKozs/cy/kklxfbbHiwmC74xyIpXYES6UzNwW9EFcJvEiKtWJl125isuJfuYYXTUwum6Ph29rtY06+OxFqR9bymi1Isx41zRy457xSCDlfjNurbpOrp0xHkcUpJ1n+/MgezeAoC4at+sv+fP8ave87VXQeN8Mi52OtriECfEAXpn/Iz4QIBd+VcAAThg0u7Hd1zq2i50EEXm+S9MmHg3758SKc/ceDmAEnNpau/W2pCyfNpk92eg9Og== 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-SenderADCheck; bh=A1QCuZONH/wxheI4TXSZhgKF/ClCJfzztQYwoR5vny0=; b=YXQmf7+KBxyoMsMDbDdvf3ZL+nK+M7GkQWfKa4fwME/f4NQPR3NjySI0GO919+moYDI9OjcEtNh7YzSNK/QVlf9cwZMC88L19jX2kjm/82NpV8cKaO9Y73lP3O1owX/+F/rZKJFfDmw6D7Z8QFJ5qi6iS/cIKa8jEZHzeOpq528tHZ8E5twjsY2QDCWVRGDI3rcc27dxYtl2QNMBctAAidbV4SBz7XHa7cjn0Ia3wlG62i38R9gbV0Qnph8hOutXJeSJm5hPyPslebiCKSSQJaMivnyq4oneiXKcpZ85U9XuLg/whDfROQAK0PmYpgVzLs9KXqI+w53JyQWTeYC+6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A1QCuZONH/wxheI4TXSZhgKF/ClCJfzztQYwoR5vny0=; b=x4TzitfNfEpJvv2myPP7KB/fThIl7+lKNbl3Sko4/8Or67r3MlJVOUS2rEFTr6W2qRfVHvSQ4P3VtczVhLlr8r1iGkag0T2cJExhYPuoXGhkpPc/i5n8J1Zrshhq5CU43fcdwnvKQnR0chtkH/C0s2oN4SAjbRf9c4O/rmXpKr4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by BYAPR10MB2791.namprd10.prod.outlook.com (2603:10b6:a03:83::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 06:19:49 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::20c4:32a4:24ac:df89%8]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 06:19:49 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v22 27/27] xfsprogs: Add log item printing for ATTRI and ATTRD Date: Mon, 26 Jul 2021 23:19:04 -0700 Message-Id: <20210727061904.11084-28-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727061904.11084-1-allison.henderson@oracle.com> References: <20210727061904.11084-1-allison.henderson@oracle.com> X-ClientProxiedBy: SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.112.125) by SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 06:19:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aabc2527-f4cf-40bb-32e8-08d950c689d6 X-MS-TrafficTypeDiagnostic: BYAPR10MB2791: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:138; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Oo/Oq7cfYjCBNtTffbO1gAOlnqqQegHQikIUy65hW6BpjmYTMEAQCIe5tpu5XxT9FMwBPEbQH9kg8ssOIVgx8OtJEjJ5obgdbcZwLAyN/TOrM6Vk1zjJT3O9ScbxqRUR+nxE7a1cBhhOuT8bnkJw+qTm+0IsgJaKfH8IxrrQqdgc/APHI3rjNvhbHI2K8KYc149wPgs5Es4ud84zqxty0ESI0RrAHhFto2BkKUXleWWL8TV9/JoZX3OKqAU36LWLHmPjX8WSaZGQa0iHkfAJjGILC/euVmt+krdRplEg4DTbZ4o+PF4sp+BCsnn7kSm3/YEaERhi6kM9YRAP+Pj1LIpcqvaEMaJQJZtgIlwIi2jeCHPtRxbbnwBAlXvp6YF/EkCh8FOxaQtca+1fm6hRFcC+ALfhELA07MKP2c58UK5HixqOHjcanQU+W/Qfidl3wNed5A4ilhKFm8n090tnaZphZIPDqv5pjx5cpXPXFPwRIKYxT8b1UL/ySYBh+Vo1teoZETbyAJY87CmLqyKfLGeqy7P4taLz/yZ4pPXQhdRTyoX1FpeQncwdCq1yYKxSIp9LxJP0dDBaH3cMXK6eVmG/zInbxhrt8X0qSVmjXub02j6YOnJH6+QsbHmNGAj8Logvvk9UCRltBZ+UY1vrYjSeQghWQMNUhf07smn9c84Vu3J/0COX0+vCcoUuSRP/KxVLrdpICrNDBkGknDeaXw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(376002)(396003)(366004)(346002)(44832011)(2906002)(36756003)(52116002)(86362001)(6916009)(83380400001)(8936002)(478600001)(956004)(1076003)(38350700002)(66476007)(6512007)(66946007)(38100700002)(66556008)(316002)(6506007)(6666004)(6486002)(26005)(5660300002)(8676002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NgJHCpe0UB2xPE1OigWFfjgYdOHqSC3e3Z70qAkTzJlwHUtwKc8nn+5TE//zE3x90M6ngNb9D1bzIwJdZoWojVaB/l8cA47bWB/Pka/U2KKxR5vkzWDDrmckb7lEBdrFA1Pcph/fpf93mW1bSxIuDu2ZAI5GRmfea6O5RTloQEo8Uy5ELnqjG/cN521RHJU5RfZyICfiiAx96XqSPimeHMuenuraGNdXKNvirJ9oCig542LEUBFurwdEmVMGRpIXuS2Dv0fLBATmuX95WetovRmwtZ8ZYaVbSHwEwE2EIz9RE5TYIGf+zpGF1Wtidf25XCy/lm7aX3m2t6Z+H92/jplE41E/0hFEt/WIL5Yh2YH+RMoRAZ2CA9O8hehKHnlBPyFckAxsArzQZfnIDYPByu7qtj1A2Pc2qrkEJ23K5YNXvMeffzKaDTnG6n2zkbI3nJ9MfQgguz344j0v4e/1XBSrxZhpgMU+rfYVozv6/gvcwIl2ELgRYSf9Mhzowdq287P8hMM+Xm0A4WlqcQVSYpN4mzKwIZKg2iAO52jxa/QgfTL6u0dT+D8BAdxXJmPJqM+RTg+VMH2BRAji72/pdNmPSxrMcwEW8KNvK8I9/goG2rRM4FHNK0xu4NdwpIGf6Ia2l9Vnf39pjCWcXrcj19kVYiOYZvIrXH3uf/wjVzZiUmlnDMHztq06mdvnfV9xG+BnWkZOUVBwumUxsNXrJ2d2Saegemq+OprFfdDLOnvc4qQ83OXylZREbhxmbOAFIS8puYQobCdZ1+BajWjsiKkus/KQd70/YbXppZVIrjs3MR1Rza8P/+7pFj55bg2+jFYUfZxQJEQVe1/NQGawBU47UYTuADjQGnp2JeOAUi6n2mA/e+i2jIIQAME4K0EWgcT3eiQiq3croi8mtvi8y1lq5J6/d5NFTT+K5ns/+aEtIEB/Q+LQ1XVVRWDaRZUpg5RQ/llamDA/J0RIxoyqaYwjDtrQB+PkAmVA/46rk6ku1FpYQlVr5KqA/7jKHSGQTHj2nfZOaDPbZqMzm0j1M3wpIFmj1lQflkook3e2pR3jRr11iK5Auj8/hUCIJdlx3JGpXsQAR5BNeL7kpO4CXi4FWtYqI3nzqQyUOQWvOnv6loh6Yx9Y9H9zXodHxtFyRDGWDbkmxYtXjCIKK3LGjrn0tfwf35FtKxLukR+pGIe66E2o+dUwYTio4HKK4pAbi2fhuyDwEWSq5diwqVKU2/OB6AiG6iq3PJwFGhVxddtODSyOsHdsL688BUiOnMI1yagGf6Y22EapBeUeUKWwgEPxAAjF9PrjSG6kLyzDilj+2HB67xvDXlMh/QcW0xKx X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: aabc2527-f4cf-40bb-32e8-08d950c689d6 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 06:19:49.7750 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: B0DePv/93JA6YnGEPexFUsZVstf77PpBJuDkqcjwaO+3fkWOQmTD95jrBpoDUSM58gl848Owi0aEEu9UN+IXt1ngp0ZL6bKHIKVP5/KGuAc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2791 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10057 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270037 X-Proofpoint-ORIG-GUID: ZjfAjy0nKkeKwA5kH_MhjduC4DBIxUa4 X-Proofpoint-GUID: ZjfAjy0nKkeKwA5kH_MhjduC4DBIxUa4 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This patch implements a new set of log printing functions to print the ATTRI and ATTRD items and vectors in the log. These will be used during log dump and log recover operations. Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong --- logprint/log_misc.c | 48 +++++++++++- logprint/log_print_all.c | 12 +++ logprint/log_redo.c | 197 +++++++++++++++++++++++++++++++++++++++++++++++ logprint/logprint.h | 12 +++ 4 files changed, 268 insertions(+), 1 deletion(-) diff --git a/logprint/log_misc.c b/logprint/log_misc.c index 35e926a..d8c6038 100644 --- a/logprint/log_misc.c +++ b/logprint/log_misc.c @@ -54,11 +54,46 @@ print_stars(void) "***********************************\n"); } /* print_stars */ +void +print_hex_dump(char *ptr, int len) { + int i = 0; + + for (i = 0; i < len; i++) { + if (i % 16 == 0) + printf("%08x ", i); + + printf("%02x", ptr[i]); + + if ((i+1)%16 == 0) + printf("\n"); + else if ((i+1)%2 == 0) + printf(" "); + } + printf("\n"); +} + +bool +is_printable(char *ptr, int len) { + int i = 0; + + for (i = 0; i < len; i++) + if (!isprint(ptr[i]) ) + return false; + return true; +} + +void print_or_dump(char *ptr, int len) { + if (is_printable(ptr, len)) + printf("%.*s\n", len, ptr); + else + print_hex_dump(ptr, len); +} + /* * Given a pointer to a data segment, print out the data as if it were * a log operation header. */ -static void +void xlog_print_op_header(xlog_op_header_t *op_head, int i, char **ptr) @@ -961,6 +996,17 @@ xlog_print_record( be32_to_cpu(op_head->oh_len)); break; } + case XFS_LI_ATTRI: { + skip = xlog_print_trans_attri(&ptr, + be32_to_cpu(op_head->oh_len), + &i); + break; + } + case XFS_LI_ATTRD: { + skip = xlog_print_trans_attrd(&ptr, + be32_to_cpu(op_head->oh_len)); + break; + } case XFS_LI_RUI: { skip = xlog_print_trans_rui(&ptr, be32_to_cpu(op_head->oh_len), diff --git a/logprint/log_print_all.c b/logprint/log_print_all.c index c9c453f..89cb649 100644 --- a/logprint/log_print_all.c +++ b/logprint/log_print_all.c @@ -404,6 +404,12 @@ xlog_recover_print_logitem( case XFS_LI_EFI: xlog_recover_print_efi(item); break; + case XFS_LI_ATTRD: + xlog_recover_print_attrd(item); + break; + case XFS_LI_ATTRI: + xlog_recover_print_attri(item); + break; case XFS_LI_RUD: xlog_recover_print_rud(item); break; @@ -456,6 +462,12 @@ xlog_recover_print_item( case XFS_LI_EFI: printf("EFI"); break; + case XFS_LI_ATTRD: + printf("ATTRD"); + break; + case XFS_LI_ATTRI: + printf("ATTRI"); + break; case XFS_LI_RUD: printf("RUD"); break; diff --git a/logprint/log_redo.c b/logprint/log_redo.c index 297e203..502345d 100644 --- a/logprint/log_redo.c +++ b/logprint/log_redo.c @@ -653,3 +653,200 @@ xlog_recover_print_bud( f = item->ri_buf[0].i_addr; xlog_print_trans_bud(&f, sizeof(struct xfs_bud_log_format)); } + +/* Attr Items */ + +static int +xfs_attri_copy_log_format( + char *buf, + uint len, + struct xfs_attri_log_format *dst_attri_fmt) +{ + uint dst_len = sizeof(struct xfs_attri_log_format); + + if (len == dst_len) { + memcpy((char *)dst_attri_fmt, buf, len); + return 0; + } + + fprintf(stderr, _("%s: bad size of attri format: %u; expected %u\n"), + progname, len, dst_len); + return 1; +} + +int +xlog_print_trans_attri( + char **ptr, + uint src_len, + int *i) +{ + struct xfs_attri_log_format *src_f = NULL; + xlog_op_header_t *head = NULL; + uint dst_len; + int error = 0; + + dst_len = sizeof(struct xfs_attri_log_format); + if (src_len != dst_len) { + fprintf(stderr, _("%s: bad size of attri format: %u; expected %u\n"), + progname, src_len, dst_len); + return 1; + } + + /* + * memmove to ensure 8-byte alignment for the long longs in + * xfs_attri_log_format_t structure + */ + src_f = malloc(src_len); + if (!src_f) { + fprintf(stderr, _("%s: xlog_print_trans_attri: malloc failed\n"), + progname); + exit(1); + } + memmove((char*)src_f, *ptr, src_len); + *ptr += src_len; + + printf(_("ATTRI: #regs: %d name_len: %d, value_len: %d id: 0x%llx\n"), + src_f->alfi_size, src_f->alfi_name_len, src_f->alfi_value_len, + (unsigned long long)src_f->alfi_id); + + if (src_f->alfi_name_len > 0) { + printf(_("\n")); + (*i)++; + head = (xlog_op_header_t *)*ptr; + xlog_print_op_header(head, *i, ptr); + error = xlog_print_trans_attri_name(ptr, be32_to_cpu(head->oh_len)); + if (error) + goto error; + } + + if (src_f->alfi_value_len > 0) { + printf(_("\n")); + (*i)++; + head = (xlog_op_header_t *)*ptr; + xlog_print_op_header(head, *i, ptr); + error = xlog_print_trans_attri_value(ptr, be32_to_cpu(head->oh_len), + src_f->alfi_value_len); + } +error: + free(src_f); + + return error; +} /* xlog_print_trans_attri */ + +int +xlog_print_trans_attri_name( + char **ptr, + uint src_len) +{ + printf(_("ATTRI: name len:%u\n"), src_len); + print_or_dump(*ptr, src_len); + + *ptr += src_len; + + return 0; +} /* xlog_print_trans_attri */ + +int +xlog_print_trans_attri_value( + char **ptr, + uint src_len, + int value_len) +{ + int len = value_len; + + if (len > MAX_ATTR_VAL_PRINT) + len = MAX_ATTR_VAL_PRINT; + + printf(_("ATTRI: value len:%u\n"), value_len); + print_or_dump(*ptr, len); + + *ptr += src_len; + + return 0; +} /* xlog_print_trans_attri_value */ + +void +xlog_recover_print_attri( + struct xlog_recover_item *item) +{ + struct xfs_attri_log_format *f, *src_f = NULL; + uint src_len, dst_len; + + int region = 0; + + src_f = (struct xfs_attri_log_format *)item->ri_buf[0].i_addr; + src_len = item->ri_buf[region].i_len; + + /* + * An xfs_attri_log_format structure contains a attribute name and + * variable length value as the last field. + */ + dst_len = sizeof(struct xfs_attri_log_format); + + if ((f = ((struct xfs_attri_log_format *)malloc(dst_len))) == NULL) { + fprintf(stderr, _("%s: xlog_recover_print_attri: malloc failed\n"), + progname); + exit(1); + } + if (xfs_attri_copy_log_format((char*)src_f, src_len, f)) + goto out; + + printf(_("ATTRI: #regs: %d name_len: %d, value_len: %d id: 0x%llx\n"), + f->alfi_size, f->alfi_name_len, f->alfi_value_len, (unsigned long long)f->alfi_id); + + if (f->alfi_name_len > 0) { + region++; + printf(_("ATTRI: name len:%u\n"), f->alfi_name_len); + print_or_dump((char *)item->ri_buf[region].i_addr, + f->alfi_name_len); + } + + if (f->alfi_value_len > 0) { + int len = f->alfi_value_len; + + if (len > MAX_ATTR_VAL_PRINT) + len = MAX_ATTR_VAL_PRINT; + + region++; + printf(_("ATTRI: value len:%u\n"), f->alfi_value_len); + print_or_dump((char *)item->ri_buf[region].i_addr, len); + } + +out: + free(f); + +} + +int +xlog_print_trans_attrd(char **ptr, uint len) +{ + struct xfs_attrd_log_format *f; + struct xfs_attrd_log_format lbuf; + uint core_size = sizeof(struct xfs_attrd_log_format); + + memcpy(&lbuf, *ptr, MIN(core_size, len)); + f = &lbuf; + *ptr += len; + if (len >= core_size) { + printf(_("ATTRD: #regs: %d id: 0x%llx\n"), + f->alfd_size, + (unsigned long long)f->alfd_alf_id); + return 0; + } else { + printf(_("ATTRD: Not enough data to decode further\n")); + return 1; + } +} /* xlog_print_trans_attrd */ + +void +xlog_recover_print_attrd( + struct xlog_recover_item *item) +{ + struct xfs_attrd_log_format *f; + + f = (struct xfs_attrd_log_format *)item->ri_buf[0].i_addr; + + printf(_(" ATTRD: #regs: %d id: 0x%llx\n"), + f->alfd_size, + (unsigned long long)f->alfd_alf_id); +} diff --git a/logprint/logprint.h b/logprint/logprint.h index 38a7d3f..b4479c2 100644 --- a/logprint/logprint.h +++ b/logprint/logprint.h @@ -29,6 +29,9 @@ extern void xfs_log_print_trans(struct xlog *, int); extern void print_xlog_record_line(void); extern void print_xlog_op_line(void); extern void print_stars(void); +extern void print_hex_dump(char* ptr, int len); +extern bool is_printable(char* ptr, int len); +extern void print_or_dump(char* ptr, int len); extern struct xfs_inode_log_format * xfs_inode_item_format_convert(char *, uint, struct xfs_inode_log_format *); @@ -53,4 +56,13 @@ extern void xlog_recover_print_bui(struct xlog_recover_item *item); extern int xlog_print_trans_bud(char **ptr, uint len); extern void xlog_recover_print_bud(struct xlog_recover_item *item); +#define MAX_ATTR_VAL_PRINT 128 + +extern int xlog_print_trans_attri(char **ptr, uint src_len, int *i); +extern int xlog_print_trans_attri_name(char **ptr, uint src_len); +extern int xlog_print_trans_attri_value(char **ptr, uint src_len, int value_len); +extern void xlog_recover_print_attri(struct xlog_recover_item *item); +extern int xlog_print_trans_attrd(char **ptr, uint len); +extern void xlog_recover_print_attrd(struct xlog_recover_item *item); +extern void xlog_print_op_header(xlog_op_header_t *op_head, int i, char **ptr); #endif /* LOGPRINT_H */