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=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_SANE_1 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 D6D7BC47247 for ; Thu, 30 Apr 2020 18:46:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B98912073E for ; Thu, 30 Apr 2020 18:46:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="MQQdz/6I" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726366AbgD3SqB (ORCPT ); Thu, 30 Apr 2020 14:46:01 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:52588 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726272AbgD3SqB (ORCPT ); Thu, 30 Apr 2020 14:46:01 -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 03UIfQBJ135701; Thu, 30 Apr 2020 18:45:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=m+Si/zLZYoNUc6sd1VMMxP8x3G32wHzPRNUZTzODung=; b=MQQdz/6IYIXo/h+hbGAsvD2uZPHkZAux3H/4Q30fyuQpRIJNhdB1NLUpBhhwwdNKevqE JWPZccfv52mpZFTBvifWexC+usKXqxgz/Eqzjba3u4WcrXmFf8p84cvMJclofU43UJS8 V1cHkqk3/+MVPmjEyen5DAvySZLYQXkR/khwnelia7xWiEUlYJ3UORpN/2zfPf8nF7Kw ypQEh8/Bg/PPrd7NAKchwwc1CJfRuMTgbLgzmLb/Tne6RVTRmNwIGBF7e89HfG/uXM65 FsvBcUBRkvanLUlNxBvsyPx4gPYjrChzqCng+uQfBfjUsUorl9LYALBqO4eNfULOEn6H rg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 30nucgd7jx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 30 Apr 2020 18:45:58 +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 03UIaKUK078254; Thu, 30 Apr 2020 18:45:57 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 30qtg1mtxp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 30 Apr 2020 18:45:57 +0000 Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 03UIjuqo022564; Thu, 30 Apr 2020 18:45:56 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 30 Apr 2020 11:45:56 -0700 Date: Thu, 30 Apr 2020 11:45:53 -0700 From: "Darrick J. Wong" To: Brian Foster Cc: linux-xfs@vger.kernel.org Subject: Re: [PATCH v3 08/17] xfs: fix duplicate verification from xfs_qm_dqflush() Message-ID: <20200430184553.GI6742@magnolia> References: <20200429172153.41680-1-bfoster@redhat.com> <20200429172153.41680-9-bfoster@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429172153.41680-9-bfoster@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9607 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004300144 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9607 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 priorityscore=1501 mlxlogscore=999 impostorscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004300144 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Wed, Apr 29, 2020 at 01:21:44PM -0400, Brian Foster wrote: > The pre-flush dquot verification in xfs_qm_dqflush() duplicates the > read verifier by checking the dquot in the on-disk buffer. Instead, > verify the in-core variant before it is flushed to the buffer. > > Signed-off-by: Brian Foster > Reviewed-by: Dave Chinner > Reviewed-by: Christoph Hellwig Fixes: 7224fa482a6d ("xfs: add full xfs_dqblk verifier") ? Otherwise this looks ok, Reviewed-by: Darrick J. Wong --D > --- > fs/xfs/xfs_dquot.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c > index af2c8e5ceea0..265feb62290d 100644 > --- a/fs/xfs/xfs_dquot.c > +++ b/fs/xfs/xfs_dquot.c > @@ -1116,13 +1116,12 @@ xfs_qm_dqflush( > dqb = bp->b_addr + dqp->q_bufoffset; > ddqp = &dqb->dd_diskdq; > > - /* > - * A simple sanity check in case we got a corrupted dquot. > - */ > - fa = xfs_dqblk_verify(mp, dqb, be32_to_cpu(ddqp->d_id), 0); > + /* sanity check the in-core structure before we flush */ > + fa = xfs_dquot_verify(mp, &dqp->q_core, be32_to_cpu(dqp->q_core.d_id), > + 0); > if (fa) { > xfs_alert(mp, "corrupt dquot ID 0x%x in memory at %pS", > - be32_to_cpu(ddqp->d_id), fa); > + be32_to_cpu(dqp->q_core.d_id), fa); > xfs_buf_relse(bp); > xfs_dqfunlock(dqp); > xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); > -- > 2.21.1 >