[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aPHYl6uFyxQjhwP5@infradead.org>
Date: Thu, 16 Oct 2025 22:48:07 -0700
From: Christoph Hellwig <hch@...radead.org>
To: "Darrick J. Wong" <djwong@...nel.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
> +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.
Powered by blists - more mailing lists