From patchwork Thu Jun 25 23:28:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 11626221 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B204517D4 for ; Thu, 25 Jun 2020 23:29:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9425D20CC7 for ; Thu, 25 Jun 2020 23:29:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="uE4FfySS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725998AbgFYX3m (ORCPT ); Thu, 25 Jun 2020 19:29:42 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:49474 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731578AbgFYX3O (ORCPT ); Thu, 25 Jun 2020 19:29:14 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05PNRxDA151816 for ; Thu, 25 Jun 2020 23:29:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2020-01-29; bh=H9nh7YBcFYTybQ92q2peSWm5UbHjZTBbKKxHUvISfFs=; b=uE4FfySSr5c4IgXvx+sSXr35Bl0MDc4GMLcuge0eDhyZ5wph2BpUwPPqElZiV34M05UR SAFs5SJTmSIu4nagxnpxwWlLUb34dntrXYIoZovT5E7xoHCPFkmtGd9jRkR92jSSWcUU oYdEU5anBQI+o/nbGPD75eEd0df8Rwngxht5FTXwqHwolBLp2iaXVx5EJb8K+JzNYxyV CzpS5+0rgZBH+Cw29Ss7m2Pps3hKkMgIhfkCWHL77NjVLAXxCf0nKCD9GId3IJ0DkxL8 THNxlbD+Y9daJSCE914N4tE9Dwc6q7QIMSwaidM6fqvLKll5T/vEMxW/VfQdVU4AH1P3 VA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 31uusu3a9v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 25 Jun 2020 23:29:00 +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 05PNSI6U117292 for ; Thu, 25 Jun 2020 23:29:00 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 31uuram0tb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 25 Jun 2020 23:29:00 +0000 Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 05PNT0Wa015718 for ; Thu, 25 Jun 2020 23:29:00 GMT Received: from localhost.localdomain (/67.1.142.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 25 Jun 2020 23:28:59 +0000 From: Allison Collins To: linux-xfs@vger.kernel.org Subject: [PATCH v10 05/26] xfsprogs: Pull up trans handling in xfs_attr3_leaf_flipflags Date: Thu, 25 Jun 2020 16:28:27 -0700 Message-Id: <20200625232848.14465-6-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200625232848.14465-1-allison.henderson@oracle.com> References: <20200625232848.14465-1-allison.henderson@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9663 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 spamscore=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006250136 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9663 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 bulkscore=0 cotscore=-2147483648 malwarescore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=999 phishscore=0 priorityscore=1501 spamscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006250136 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Since delayed operations cannot roll transactions, pull up the transaction handling into the calling function Signed-off-by: Allison Collins Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Rajendra --- libxfs/xfs_attr.c | 14 ++++++++++++++ libxfs/xfs_attr_leaf.c | 7 +------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 88ddfb5..313aa5f 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -622,6 +622,13 @@ xfs_attr_leaf_addname( 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 @@ -968,6 +975,13 @@ restart: 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 diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c index 553b3c0..9ea85d1 100644 --- a/libxfs/xfs_attr_leaf.c +++ b/libxfs/xfs_attr_leaf.c @@ -2950,10 +2950,5 @@ xfs_attr3_leaf_flipflags( XFS_DA_LOGRANGE(leaf2, name_rmt, sizeof(*name_rmt))); } - /* - * Commit the flag value change and start the next trans in series. - */ - error = xfs_trans_roll_inode(&args->trans, args->dp); - - return error; + return 0; }