From 042eabdcd1ac65e30d9cce091bdd1dd94756eb7e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sat, 6 Nov 2010 11:42:44 +0000 Subject: [PATCH] --- yaml --- r: 221755 b: refs/heads/master c: 785ce41805ea7b6a9b2775ed9f4cf10cd7a90c03 h: refs/heads/master i: 221753: f9f7ed151bc331a685e9505978153680f59a2e48 221751: eee22a25b9accb1ed89d5fa0a94d92e95a7fb7ec v: v3 --- [refs] | 2 +- trunk/fs/xfs/xfs_filestream.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 2b6a4d85dfaa..9ca06e511ef2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bfe2741967eaa3434fa9b3d8f24b1422d4540e7d +refs/heads/master: 785ce41805ea7b6a9b2775ed9f4cf10cd7a90c03 diff --git a/trunk/fs/xfs/xfs_filestream.c b/trunk/fs/xfs/xfs_filestream.c index 9b715dce5699..9124425b7f2f 100644 --- a/trunk/fs/xfs/xfs_filestream.c +++ b/trunk/fs/xfs/xfs_filestream.c @@ -744,9 +744,15 @@ xfs_filestream_new_ag( * 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 * 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) - 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