From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 3E311C2BB85 for ; Wed, 15 Apr 2020 06:40:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2850B20784 for ; Wed, 15 Apr 2020 06:40:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2634927AbgDOGkZ (ORCPT ); Wed, 15 Apr 2020 02:40:25 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:22022 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2634921AbgDOGkY (ORCPT ); Wed, 15 Apr 2020 02:40:24 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03F6YMOm055860 for ; Wed, 15 Apr 2020 02:40:23 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 30dnmqtdyp-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Apr 2020 02:40:23 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 15 Apr 2020 07:39:47 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 15 Apr 2020 07:39:45 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03F6dDV221758324 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Apr 2020 06:39:13 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F3ED6AE058; Wed, 15 Apr 2020 06:40:18 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 38166AE04D; Wed, 15 Apr 2020 06:40:18 +0000 (GMT) Received: from localhost.localdomain (unknown [9.79.180.162]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 15 Apr 2020 06:40:17 +0000 (GMT) From: Chandan Rajendra To: Allison Collins Cc: linux-xfs@vger.kernel.org Subject: Re: [PATCH v8 02/20] xfs: Check for -ENOATTR or -EEXIST Date: Wed, 15 Apr 2020 12:13:23 +0530 Organization: IBM In-Reply-To: <20200403221229.4995-3-allison.henderson@oracle.com> References: <20200403221229.4995-1-allison.henderson@oracle.com> <20200403221229.4995-3-allison.henderson@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-TM-AS-GCONF: 00 x-cbid: 20041506-4275-0000-0000-000003C022D5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20041506-4276-0000-0000-000038D5987F Message-Id: <3808247.e9iCYBVUDu@localhost.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-15_01:2020-04-14,2020-04-15 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 phishscore=0 adultscore=0 suspectscore=1 mlxlogscore=999 spamscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004150046 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Saturday, April 4, 2020 3:42 AM Allison Collins wrote: > Delayed operations cannot return error codes. So we must check for > these conditions first before starting set or remove operations > The changes are logically correct. Reviewed-by: Chandan Rajendra > Signed-off-by: Allison Collins > Reviewed-by: Darrick J. Wong > --- > fs/xfs/libxfs/xfs_attr.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c > index 2a0d3d3..f7e289e 100644 > --- a/fs/xfs/libxfs/xfs_attr.c > +++ b/fs/xfs/libxfs/xfs_attr.c > @@ -404,6 +404,17 @@ xfs_attr_set( > args->total, 0, quota_flags); > if (error) > goto out_trans_cancel; > + > + error = xfs_has_attr(args); > + if (error == -EEXIST && (args->attr_flags & XATTR_CREATE)) > + goto out_trans_cancel; > + > + if (error == -ENOATTR && (args->attr_flags & XATTR_REPLACE)) > + goto out_trans_cancel; > + > + if (error != -ENOATTR && error != -EEXIST) > + goto out_trans_cancel; > + > error = xfs_attr_set_args(args); > if (error) > goto out_trans_cancel; > @@ -411,6 +422,10 @@ xfs_attr_set( > if (!args->trans) > goto out_unlock; > } else { > + error = xfs_has_attr(args); > + if (error != -EEXIST) > + goto out_trans_cancel; > + > error = xfs_attr_remove_args(args); > if (error) > goto out_trans_cancel; > -- chandan