Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 785ce418 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Alex Elder
Browse files

xfs: tell lockdep about parent iolock usage in filestreams



The filestreams code may take the iolock on the parent inode while
holding it on a child.  This is the only place in XFS where we take
both the child and parent iolock, so just telling lockdep about it
is enough.  The lock flag required for that was already added as
part of the ilock lockdep annotations and unused so far.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAlex Elder <aelder@sgi.com>
parent bfe27419
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -744,9 +744,15 @@ xfs_filestream_new_ag(
	 * If the file's parent directory is known, take its iolock in exclusive
	 * If the file's parent directory is known, take its iolock in exclusive
	 * mode to prevent two sibling files from racing each other to migrate
	 * mode to prevent two sibling files from racing each other to migrate
	 * themselves and their parent to different AGs.
	 * themselves and their parent to different AGs.
	 *
	 * Note that we lock the parent directory iolock inside the child
	 * iolock here.  That's fine as we never hold both parent and child
	 * iolock in any other place.  This is different from the ilock,
	 * which requires locking of the child after the parent for namespace
	 * operations.
	 */
	 */
	if (pip)
	if (pip)
		xfs_ilock(pip, XFS_IOLOCK_EXCL);
		xfs_ilock(pip, XFS_IOLOCK_EXCL | XFS_IOLOCK_PARENT);


	/*
	/*
	 * A new AG needs to be found for the file.  If the file's parent
	 * A new AG needs to be found for the file.  If the file's parent