Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp225909imu; Tue, 27 Nov 2018 11:25:58 -0800 (PST) X-Google-Smtp-Source: AJdET5cYjh9JxHTOWDWRyEHGQiNkW4fg2iLivwFls6ihEVRSSnJ8PHOIrVs8ZKU5Rgr2bK+G9NRe X-Received: by 2002:a62:1447:: with SMTP id 68mr33823447pfu.257.1543346758658; Tue, 27 Nov 2018 11:25:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543346758; cv=none; d=google.com; s=arc-20160816; b=uqj4TCKU2e3IczsBsFpV1+yMfRYfLFguJANPw501DMjA+nBpB6a+8QPUKVZLGjdNv8 FV1owmK2U21RvO3z39HFm3IVzT2p09wZ47cXzhgoWzA4FUb2bU8zoj/A0w4ig9BFjLXG aJomQ6dfVxpBWuc+I1DZ2rKzVDTtGKy3VpCu4KCb2eTWmq24ummGhyBHkY9PJ4I9MB5I 7OxYFQePy/KqJE7gRCTUZpeuX935B+8SLMZoOYkDzlOVbCvXuY8mu8q5Gv8QjQm7EgQu VvgLTHRRNnDotXxEtNphhRktlf4IhS6x3v10UWPpb2LNzV9QZFc0Vxew6Ri4LbNwz6Rs o9AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date:dkim-signature; bh=yiTuleaTQ9T92kvKXA4hTuFDIUskdv//2MBFzmEeG4I=; b=pqvYa+QQnwIgnRO0GD/vn9QYSPlzBRtFnEdDvEgyPQaecLU2LjNTzjl6d7e+86Ww6s y1Gi9p0/5SfehLK6EvKFt12gzT1y8POAhjVrT1bf5E2mtZFK/BBdfrU1jgUW24Vy6l1q DrYAzYnQ0HrVXplqTDEF9h7iAi74FDhKSbuuV7iZUQWY6fcyev35djskde+vFGcEltET MFd9lFGo0wsvVbZuofP9+/xfxpWTt1Y4YXkmGHGoiAjLjFf/lirGl2B8uB7nAHkUJUKD 18QYy6J0osjujn10vhrjMtpH/9k89mfGfXSXDRlOOXGC2m2UYndYvYwCRFfD2Ddtb7U0 vb8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=KbJBw924; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z22si4963322pfd.197.2018.11.27.11.25.40; Tue, 27 Nov 2018 11:25:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=KbJBw924; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730878AbeK1DXu (ORCPT + 99 others); Tue, 27 Nov 2018 22:23:50 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:44022 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730663AbeK1DXu (ORCPT ); Tue, 27 Nov 2018 22:23:50 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wARGOMCH103358; Tue, 27 Nov 2018 16:25:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=yiTuleaTQ9T92kvKXA4hTuFDIUskdv//2MBFzmEeG4I=; b=KbJBw924bhiE77cpi7vnxNtUIIXTyNVutvoP410fXy8YdG9uiUI+7HRRVbrhc0SE7vXh iEWXLjOdTx90iN15POkAxyZI8k21y1FMFpZKAAMh+s+/KKWB5wBJmdApEDVrriuahhUp Ww6GWaua+GMmWwecPLIqRzGQfHrQ2Ni34yPKxqviI4ka2Sw8HHOlM4CNNq19bwNFNPgu WLGlS6bobGTr0iaAvpm59OQaCEC4f8T2x6nxTxExQFcemdtamoe4CUgv5a0wxF8qh7xT mbBTgvznjbGoWZ8Mdrz5rs9ZZI/Otx+W6bdqzwl59q4B/lj7Rv95ebaV4apK0y02pUfJ +g== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2nxx2u5417-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Nov 2018 16:25:18 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wARGPHfm017957 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Nov 2018 16:25:17 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wARGPH8Y004144; Tue, 27 Nov 2018 16:25:17 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Nov 2018 08:25:17 -0800 Date: Tue, 27 Nov 2018 08:25:16 -0800 From: "Darrick J. Wong" To: Pan Bian , Brian Foster , Dave Chinner , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2] xfs: libxfs: move xfs_perag_put late Message-ID: <20181127162516.GG6792@magnolia> References: <1543278818-117362-1-git-send-email-bianpan2016@163.com> <20181127091602.eaeczahefobpx544@hades.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181127091602.eaeczahefobpx544@hades.usersys.redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9090 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811270139 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 27, 2018 at 10:16:02AM +0100, Carlos Maiolino wrote: > On Tue, Nov 27, 2018 at 08:33:38AM +0800, Pan Bian wrote: > > The function xfs_alloc_get_freelist calls xfs_perag_put to drop the > > reference. However, pag->pagf_btreeblks is read and write after the > > put operation. This patch moves the put operation late. > > I'm not a native English speaker too, but I believe it should be "is read and > written after..." > > But, for the code itself, you can add: > > Reviewed-by: Carlos Maiolino > > Cheers > > > > > Signed-off-by: Pan Bian Looks ok, will amend the changelog on the way in. Reviewed-by: Darrick J. Wong --D > > --- > > V2: correct the commit log > > --- > > fs/xfs/libxfs/xfs_alloc.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c > > index e1c0c0d..4be387d 100644 > > --- a/fs/xfs/libxfs/xfs_alloc.c > > +++ b/fs/xfs/libxfs/xfs_alloc.c > > @@ -2435,7 +2435,6 @@ xfs_alloc_get_freelist( > > be32_add_cpu(&agf->agf_flcount, -1); > > xfs_trans_agflist_delta(tp, -1); > > pag->pagf_flcount--; > > - xfs_perag_put(pag); > > > > logflags = XFS_AGF_FLFIRST | XFS_AGF_FLCOUNT; > > if (btreeblk) { > > @@ -2443,6 +2442,7 @@ xfs_alloc_get_freelist( > > pag->pagf_btreeblks++; > > logflags |= XFS_AGF_BTREEBLKS; > > } > > + xfs_perag_put(pag); > > > > xfs_alloc_log_agf(tp, agbp, logflags); > > *bnop = bno; > > -- > > 2.7.4 > > > > > > -- > Carlos