Content-Type: multipart/mixed; boundary="===============2733347604039253464==" MIME-Version: 1.0 From: Darrick J. Wong To: kbuild-all@lists.01.org Subject: Re: [djwong-xfs:repair-quota 54/55] fs/xfs/scrub/quotacheck.c:484:1-7: preceding lock on line 450 (fwd) Date: Tue, 23 Jun 2020 10:47:29 -0700 Message-ID: <20200623174729.GG7625@magnolia> In-Reply-To: List-Id: --===============2733347604039253464== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Tue, Jun 23, 2020 at 06:00:11PM +0200, Julia Lawall wrote: > Hello, > = > There is a strange alternation between goto out_xqclock and goto > out_ilock. Please check that it is as intended. Yep, definitely broken error handling. Thank you for pointing this out! --D > julia > = > ---------- Forwarded message ---------- > Date: Tue, 23 Jun 2020 09:38:36 +0800 > From: kernel test robot > To: kbuild(a)lists.01.org > Cc: lkp(a)intel.com, Julia Lawall > Subject: [djwong-xfs:repair-quota 54/55] fs/xfs/scrub/quotacheck.c:484:1-= 7: > preceding lock on line 450 > = > CC: kbuild-all(a)lists.01.org > CC: "Darrick J. Wong" > TO: "Darrick J. Wong" > = > tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.= git repair-quota > head: 46c1bb2989f596b35ff8fd23fc42a15d36b27e96 > commit: 7d1edf310e9cb46eccfc844765af018a43088cb0 [54/55] xfs: track quota= updates during live quotacheck > :::::: branch date: 7 hours ago > :::::: commit date: 7 hours ago > config: powerpc64-randconfig-c021-20200622 (attached as .config) > compiler: powerpc-linux-gcc (GCC) 9.3.0 > = > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > Reported-by: Julia Lawall > = > = > coccinelle warnings: (new ones prefixed by >>) > = > >> fs/xfs/scrub/quotacheck.c:484:1-7: preceding lock on line 450 > = > # https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/co= mmit/?id=3D7d1edf310e9cb46eccfc844765af018a43088cb0 > git remote add djwong-xfs https://git.kernel.org/pub/scm/linux/kernel/git= /djwong/xfs-linux.git > git remote update djwong-xfs > git checkout 7d1edf310e9cb46eccfc844765af018a43088cb0 > vim +484 fs/xfs/scrub/quotacheck.c > = > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 416 > e46a7f62683636 Darrick J. Wong 2020-06-05 417 /* Record this inode's qu= ota usage in our shadow quota counter data. */ > e46a7f62683636 Darrick J. Wong 2020-06-05 418 STATIC int > e46a7f62683636 Darrick J. Wong 2020-06-05 419 xqcheck_inode( > e46a7f62683636 Darrick J. Wong 2020-06-05 420 struct xqcheck *xqc, > e46a7f62683636 Darrick J. Wong 2020-06-05 421 struct xfs_inode *ip) > e46a7f62683636 Darrick J. Wong 2020-06-05 422 { > e46a7f62683636 Darrick J. Wong 2020-06-05 423 struct xfs_trans *tp =3D= xqc->sc->tp; > e46a7f62683636 Darrick J. Wong 2020-06-05 424 xfs_qcnt_t nblks; > e46a7f62683636 Darrick J. Wong 2020-06-05 425 xfs_filblks_t rtblks = =3D 0; /* total rt blks */ > e46a7f62683636 Darrick J. Wong 2020-06-05 426 uint ilock_flags =3D 0; > e46a7f62683636 Darrick J. Wong 2020-06-05 427 xfs_dqid_t id; > e46a7f62683636 Darrick J. Wong 2020-06-05 428 int error; > e46a7f62683636 Darrick J. Wong 2020-06-05 429 > e46a7f62683636 Darrick J. Wong 2020-06-05 430 /* Figure out the data /= rt device block counts. */ > e46a7f62683636 Darrick J. Wong 2020-06-05 431 if (XFS_IS_REALTIME_INOD= E(ip)) { > e46a7f62683636 Darrick J. Wong 2020-06-05 432 struct xfs_ifork *ifp = =3D XFS_IFORK_PTR(ip, XFS_DATA_FORK); > e46a7f62683636 Darrick J. Wong 2020-06-05 433 > e46a7f62683636 Darrick J. Wong 2020-06-05 434 ilock_flags =3D xfs_ilo= ck_data_map_shared(ip); > e46a7f62683636 Darrick J. Wong 2020-06-05 435 > e46a7f62683636 Darrick J. Wong 2020-06-05 436 if (!(ifp->if_flags & X= FS_IFEXTENTS)) { > e46a7f62683636 Darrick J. Wong 2020-06-05 437 error =3D xfs_iread_ex= tents(tp, ip, XFS_DATA_FORK); > e46a7f62683636 Darrick J. Wong 2020-06-05 438 if (error) > e46a7f62683636 Darrick J. Wong 2020-06-05 439 goto out_ilock; > e46a7f62683636 Darrick J. Wong 2020-06-05 440 } > e46a7f62683636 Darrick J. Wong 2020-06-05 441 > e46a7f62683636 Darrick J. Wong 2020-06-05 442 xfs_bmap_count_leaves(i= fp, &rtblks); > e46a7f62683636 Darrick J. Wong 2020-06-05 443 } else { > e46a7f62683636 Darrick J. Wong 2020-06-05 444 ilock_flags =3D XFS_ILO= CK_SHARED; > e46a7f62683636 Darrick J. Wong 2020-06-05 445 xfs_ilock(ip, ilock_fla= gs); > e46a7f62683636 Darrick J. Wong 2020-06-05 446 } > e46a7f62683636 Darrick J. Wong 2020-06-05 447 nblks =3D (xfs_qcnt_t)ip= ->i_d.di_nblocks - rtblks; > e46a7f62683636 Darrick J. Wong 2020-06-05 448 > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 449 /* Update the shadow dqu= ot counters if we haven't already failed. */ > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 @450 mutex_lock(&xqc->lock); > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 451 if (xqc->hook_dead) { > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 452 error =3D -ECANCELED; > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 453 goto out_xqclock; > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 454 } > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 455 > e46a7f62683636 Darrick J. Wong 2020-06-05 456 id =3D xfs_qm_id_for_quo= tatype(ip, XFS_DQ_USER); > e46a7f62683636 Darrick J. Wong 2020-06-05 457 error =3D xqcheck_update= _incore(xqc, xqc->ucounts, id, 1, nblks, rtblks); > e46a7f62683636 Darrick J. Wong 2020-06-05 458 if (error) > e46a7f62683636 Darrick J. Wong 2020-06-05 459 goto out_ilock; > e46a7f62683636 Darrick J. Wong 2020-06-05 460 > e46a7f62683636 Darrick J. Wong 2020-06-05 461 id =3D xfs_qm_id_for_quo= tatype(ip, XFS_DQ_GROUP); > e46a7f62683636 Darrick J. Wong 2020-06-05 462 error =3D xqcheck_update= _incore(xqc, xqc->gcounts, id, 1, nblks, rtblks); > e46a7f62683636 Darrick J. Wong 2020-06-05 463 if (error) > e46a7f62683636 Darrick J. Wong 2020-06-05 464 goto out_ilock; > e46a7f62683636 Darrick J. Wong 2020-06-05 465 > e46a7f62683636 Darrick J. Wong 2020-06-05 466 id =3D xfs_qm_id_for_quo= tatype(ip, XFS_DQ_PROJ); > e46a7f62683636 Darrick J. Wong 2020-06-05 467 error =3D xqcheck_update= _incore(xqc, xqc->pcounts, id, 1, nblks, rtblks); > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 468 if (error) > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 469 goto out_xqclock; > e46a7f62683636 Darrick J. Wong 2020-06-05 470 > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 471 /* > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 472 * Update the quotacheck= scan cursor so that the quota hooks will > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 473 * capture any quota upd= ates made on behalf of this inode after we > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 474 * unlock it. > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 475 */ > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 476 xqc->last_ino =3D ip->i_= ino; > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 477 > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 478 out_xqclock: > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 479 if (error) > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 480 xqc->hook_dead =3D true; > 7d1edf310e9cb4 Darrick J. Wong 2020-06-09 481 mutex_unlock(&xqc->lock); > e46a7f62683636 Darrick J. Wong 2020-06-05 482 out_ilock: > e46a7f62683636 Darrick J. Wong 2020-06-05 483 xfs_iunlock(ip, ilock_fl= ags); > e46a7f62683636 Darrick J. Wong 2020-06-05 @484 return error; > e46a7f62683636 Darrick J. Wong 2020-06-05 485 } > e46a7f62683636 Darrick J. Wong 2020-06-05 486 > = > :::::: The code at line 484 was first introduced by commit > :::::: e46a7f62683636c9d03ed2b5fbfae74bff39a2b2 xfs: implement live quota= check inode scan > = > :::::: TO: Darrick J. Wong > :::::: CC: Darrick J. Wong > = > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============2733347604039253464==--