[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251021175711.GJ3356773@frogsfrogsfrogs>
Date: Tue, 21 Oct 2025 10:57:11 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: Carlos Maiolino <cem@...nel.org>, linux-kernel@...r.kernel.org,
linux-xfs@...r.kernel.org,
Oleksandr Natalenko <oleksandr@...alenko.name>,
Pavel Reichl <preichl@...hat.com>, Vlastimil Babka <vbabka@...e.cz>,
Thorsten Leemhuis <linux@...mhuis.info>
Subject: Re: [PATCH 4/3] xfs: fix locking in xchk_nlinks_collect_dir
On Thu, Oct 16, 2025 at 10:48:07PM -0700, Christoph Hellwig wrote:
> > +static uint
> > +xchk_nlinks_ilock_dir(
> > + struct xfs_inode *ip)
> > +{
> > + uint lock_mode = XFS_ILOCK_SHARED;
> > +
> > + if (xfs_need_iread_extents(&ip->i_df))
> > + lock_mode = XFS_ILOCK_EXCL;
> > +
> > + if (xfs_has_parent(ip->i_mount) && xfs_inode_has_attr_fork(ip) &&
> > + xfs_need_iread_extents(&ip->i_af))
> > + lock_mode = XFS_ILOCK_EXCL;
>
> Please add a comment explaining the need for the conditions, this is too
> much black magic otherwise.
Done.
--D
Powered by blists - more mailing lists