summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_filestream.c
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2010-12-01 13:13:56 +0100
committerMichal Marek <mmarek@suse.cz>2010-12-01 13:13:56 +0100
commit307991055b0ce65d53dc1eb501c456c10eb36360 (patch)
tree71bb9263dc71344e5d7b97ca6d5cf223f1f1a856 /fs/xfs/xfs_filestream.c
parentinitramfs: Really fix build break on symbol-prefixed archs (diff)
parent[media] Fix Kconfig errors due to two visible menus (diff)
downloadlinux-307991055b0ce65d53dc1eb501c456c10eb36360.tar.xz
linux-307991055b0ce65d53dc1eb501c456c10eb36360.zip
Merge branch 'kconfig_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-next into kbuild/rc-fixes
Diffstat (limited to 'fs/xfs/xfs_filestream.c')
-rw-r--r--fs/xfs/xfs_filestream.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/xfs/xfs_filestream.c b/fs/xfs/xfs_filestream.c
index 9b715dce5699..9124425b7f2f 100644
--- a/fs/xfs/xfs_filestream.c
+++ b/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