diff options
author | Jan Kara <jack@suse.cz> | 2008-07-11 19:27:31 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-07-11 19:27:31 -0400 |
commit | cf108bca465dde0c015f32dd453b99457d31c7c7 (patch) | |
tree | b1c9dfc1936579e4fd2a48f77f702effc39029e2 /fs/ext4/ext4.h | |
parent | c7d206b3379f7d6462e778b74f475c470ee3dcaf (diff) |
ext4: Invert the locking order of page_lock and transaction start
This changes are needed to support data=ordered mode handling via
inodes. This enables us to get rid of the journal heads and buffer
heads for data buffers in the ordered mode. With the changes, during
tranasaction commit we writeout the inode pages using the
writepages()/writepage(). That implies we take page lock during
transaction commit. This can cause a deadlock with the locking order
page_lock -> jbd2_journal_start, since the jbd2_journal_start can wait
for the journal_commit to happen and the journal_commit now needs to
take the page lock. To avoid this dead lock reverse the locking order.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 98760d14e2cd..f65829bbe7aa 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -1066,7 +1066,7 @@ extern void ext4_set_inode_flags(struct inode *); | |||
1066 | extern void ext4_get_inode_flags(struct ext4_inode_info *); | 1066 | extern void ext4_get_inode_flags(struct ext4_inode_info *); |
1067 | extern void ext4_set_aops(struct inode *inode); | 1067 | extern void ext4_set_aops(struct inode *inode); |
1068 | extern int ext4_writepage_trans_blocks(struct inode *); | 1068 | extern int ext4_writepage_trans_blocks(struct inode *); |
1069 | extern int ext4_block_truncate_page(handle_t *handle, struct page *page, | 1069 | extern int ext4_block_truncate_page(handle_t *handle, |
1070 | struct address_space *mapping, loff_t from); | 1070 | struct address_space *mapping, loff_t from); |
1071 | extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct page *page); | 1071 | extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct page *page); |
1072 | 1072 | ||
@@ -1225,7 +1225,7 @@ extern int ext4_ext_get_blocks(handle_t *handle, struct inode *inode, | |||
1225 | ext4_lblk_t iblock, | 1225 | ext4_lblk_t iblock, |
1226 | unsigned long max_blocks, struct buffer_head *bh_result, | 1226 | unsigned long max_blocks, struct buffer_head *bh_result, |
1227 | int create, int extend_disksize); | 1227 | int create, int extend_disksize); |
1228 | extern void ext4_ext_truncate(struct inode *, struct page *); | 1228 | extern void ext4_ext_truncate(struct inode *); |
1229 | extern void ext4_ext_init(struct super_block *); | 1229 | extern void ext4_ext_init(struct super_block *); |
1230 | extern void ext4_ext_release(struct super_block *); | 1230 | extern void ext4_ext_release(struct super_block *); |
1231 | extern long ext4_fallocate(struct inode *inode, int mode, loff_t offset, | 1231 | extern long ext4_fallocate(struct inode *inode, int mode, loff_t offset, |