summaryrefslogtreecommitdiff
path: root/fs/ext4
diff options
context:
space:
mode:
authorAkira Fujita <a-fujita@rs.jp.nec.com>2009-11-23 07:24:41 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-14 09:44:52 -0800
commita752b960d4b57e0d307e1c40b1b47ab849832c0f (patch)
tree676386472245fd3837723d81f8c3dd7e694b1ae7 /fs/ext4
parent52a4345d3d82b77bea320bf223716298468be3de (diff)
downloadlwn-a752b960d4b57e0d307e1c40b1b47ab849832c0f.tar.gz
lwn-a752b960d4b57e0d307e1c40b1b47ab849832c0f.zip
ext4: fix possible recursive locking warning in EXT4_IOC_MOVE_EXT
(cherry picked from commit 49bd22bc4d603a2a4fc2a6a60e156cbea52eb494) If CONFIG_PROVE_LOCKING is enabled, the double_down_write_data_sem() will trigger a false-positive warning of a recursive lock. Since we take i_data_sem for the two inodes ordered by their inode numbers, this isn't a problem. Use of down_write_nested() will notify the lock dependency checker machinery that there is no problem here. This problem was reported by Brian Rogers: http://marc.info/?l=linux-ext4&m=125115356928011&w=1 Reported-by: Brian Rogers <brian@xyzw.org> Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/move_extent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index a7410b34c5ed..2ca6aa3f34e6 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -189,7 +189,7 @@ double_down_write_data_sem(struct inode *orig_inode, struct inode *donor_inode)
}
down_write(&EXT4_I(first)->i_data_sem);
- down_write(&EXT4_I(second)->i_data_sem);
+ down_write_nested(&EXT4_I(second)->i_data_sem, SINGLE_DEPTH_NESTING);
}
/**