aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3/inode.c')
-rw-r--r--fs/ext3/inode.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index d59d5a667b0b..2c361377e0a5 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -702,7 +702,7 @@ ext3_get_block_handle(handle_t *handle, struct inode *inode, sector_t iblock,
702 if (!create || err == -EIO) 702 if (!create || err == -EIO)
703 goto cleanup; 703 goto cleanup;
704 704
705 down(&ei->truncate_sem); 705 mutex_lock(&ei->truncate_mutex);
706 706
707 /* 707 /*
708 * If the indirect block is missing while we are reading 708 * If the indirect block is missing while we are reading
@@ -723,7 +723,7 @@ ext3_get_block_handle(handle_t *handle, struct inode *inode, sector_t iblock,
723 } 723 }
724 partial = ext3_get_branch(inode, depth, offsets, chain, &err); 724 partial = ext3_get_branch(inode, depth, offsets, chain, &err);
725 if (!partial) { 725 if (!partial) {
726 up(&ei->truncate_sem); 726 mutex_unlock(&ei->truncate_mutex);
727 if (err) 727 if (err)
728 goto cleanup; 728 goto cleanup;
729 clear_buffer_new(bh_result); 729 clear_buffer_new(bh_result);
@@ -759,13 +759,13 @@ ext3_get_block_handle(handle_t *handle, struct inode *inode, sector_t iblock,
759 err = ext3_splice_branch(handle, inode, iblock, chain, 759 err = ext3_splice_branch(handle, inode, iblock, chain,
760 partial, left); 760 partial, left);
761 /* 761 /*
762 * i_disksize growing is protected by truncate_sem. Don't forget to 762 * i_disksize growing is protected by truncate_mutex. Don't forget to
763 * protect it if you're about to implement concurrent 763 * protect it if you're about to implement concurrent
764 * ext3_get_block() -bzzz 764 * ext3_get_block() -bzzz
765 */ 765 */
766 if (!err && extend_disksize && inode->i_size > ei->i_disksize) 766 if (!err && extend_disksize && inode->i_size > ei->i_disksize)
767 ei->i_disksize = inode->i_size; 767 ei->i_disksize = inode->i_size;
768 up(&ei->truncate_sem); 768 mutex_unlock(&ei->truncate_mutex);
769 if (err) 769 if (err)
770 goto cleanup; 770 goto cleanup;
771 771
@@ -1227,7 +1227,7 @@ static int journal_dirty_data_fn(handle_t *handle, struct buffer_head *bh)
1227 * ext3_file_write() -> generic_file_write() -> __alloc_pages() -> ... 1227 * ext3_file_write() -> generic_file_write() -> __alloc_pages() -> ...
1228 * 1228 *
1229 * Same applies to ext3_get_block(). We will deadlock on various things like 1229 * Same applies to ext3_get_block(). We will deadlock on various things like
1230 * lock_journal and i_truncate_sem. 1230 * lock_journal and i_truncate_mutex.
1231 * 1231 *
1232 * Setting PF_MEMALLOC here doesn't work - too many internal memory 1232 * Setting PF_MEMALLOC here doesn't work - too many internal memory
1233 * allocations fail. 1233 * allocations fail.
@@ -2161,7 +2161,7 @@ void ext3_truncate(struct inode * inode)
2161 * From here we block out all ext3_get_block() callers who want to 2161 * From here we block out all ext3_get_block() callers who want to
2162 * modify the block allocation tree. 2162 * modify the block allocation tree.
2163 */ 2163 */
2164 down(&ei->truncate_sem); 2164 mutex_lock(&ei->truncate_mutex);
2165 2165
2166 if (n == 1) { /* direct blocks */ 2166 if (n == 1) { /* direct blocks */
2167 ext3_free_data(handle, inode, NULL, i_data+offsets[0], 2167 ext3_free_data(handle, inode, NULL, i_data+offsets[0],
@@ -2228,7 +2228,7 @@ do_indirects:
2228 2228
2229 ext3_discard_reservation(inode); 2229 ext3_discard_reservation(inode);
2230 2230
2231 up(&ei->truncate_sem); 2231 mutex_unlock(&ei->truncate_mutex);
2232 inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC; 2232 inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
2233 ext3_mark_inode_dirty(handle, inode); 2233 ext3_mark_inode_dirty(handle, inode);
2234 2234