aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/file.c2
-rw-r--r--fs/reiserfs/inode.c26
-rw-r--r--fs/reiserfs/ioctl.c2
-rw-r--r--fs/reiserfs/xattr.c2
4 files changed, 17 insertions, 15 deletions
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index f318b58510fd..1627edd50810 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -48,8 +48,8 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
48 return 0; 48 return 0;
49 } 49 }
50 50
51 reiserfs_write_lock(inode->i_sb);
52 mutex_lock(&inode->i_mutex); 51 mutex_lock(&inode->i_mutex);
52 reiserfs_write_lock(inode->i_sb);
53 /* freeing preallocation only involves relogging blocks that 53 /* freeing preallocation only involves relogging blocks that
54 * are already in the current transaction. preallocation gets 54 * are already in the current transaction. preallocation gets
55 * freed at the end of each transaction, so it is impossible for 55 * freed at the end of each transaction, so it is impossible for
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 12dfdcfbee3d..52f1e2136546 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -39,14 +39,10 @@ void reiserfs_delete_inode(struct inode *inode)
39 39
40 /* The = 0 happens when we abort creating a new inode for some reason like lack of space.. */ 40 /* The = 0 happens when we abort creating a new inode for some reason like lack of space.. */
41 if (!(inode->i_state & I_NEW) && INODE_PKEY(inode)->k_objectid != 0) { /* also handles bad_inode case */ 41 if (!(inode->i_state & I_NEW) && INODE_PKEY(inode)->k_objectid != 0) { /* also handles bad_inode case */
42 mutex_lock(&inode->i_mutex);
43
44 reiserfs_delete_xattrs(inode); 42 reiserfs_delete_xattrs(inode);
45 43
46 if (journal_begin(&th, inode->i_sb, jbegin_count)) { 44 if (journal_begin(&th, inode->i_sb, jbegin_count))
47 mutex_unlock(&inode->i_mutex);
48 goto out; 45 goto out;
49 }
50 reiserfs_update_inode_transaction(inode); 46 reiserfs_update_inode_transaction(inode);
51 47
52 err = reiserfs_delete_object(&th, inode); 48 err = reiserfs_delete_object(&th, inode);
@@ -57,12 +53,8 @@ void reiserfs_delete_inode(struct inode *inode)
57 if (!err) 53 if (!err)
58 DQUOT_FREE_INODE(inode); 54 DQUOT_FREE_INODE(inode);
59 55
60 if (journal_end(&th, inode->i_sb, jbegin_count)) { 56 if (journal_end(&th, inode->i_sb, jbegin_count))
61 mutex_unlock(&inode->i_mutex);
62 goto out; 57 goto out;
63 }
64
65 mutex_unlock(&inode->i_mutex);
66 58
67 /* check return value from reiserfs_delete_object after 59 /* check return value from reiserfs_delete_object after
68 * ending the transaction 60 * ending the transaction
@@ -2348,6 +2340,7 @@ static int reiserfs_write_full_page(struct page *page,
2348 unsigned long end_index = inode->i_size >> PAGE_CACHE_SHIFT; 2340 unsigned long end_index = inode->i_size >> PAGE_CACHE_SHIFT;
2349 int error = 0; 2341 int error = 0;
2350 unsigned long block; 2342 unsigned long block;
2343 sector_t last_block;
2351 struct buffer_head *head, *bh; 2344 struct buffer_head *head, *bh;
2352 int partial = 0; 2345 int partial = 0;
2353 int nr = 0; 2346 int nr = 0;
@@ -2395,10 +2388,19 @@ static int reiserfs_write_full_page(struct page *page,
2395 } 2388 }
2396 bh = head; 2389 bh = head;
2397 block = page->index << (PAGE_CACHE_SHIFT - s->s_blocksize_bits); 2390 block = page->index << (PAGE_CACHE_SHIFT - s->s_blocksize_bits);
2391 last_block = (i_size_read(inode) - 1) >> inode->i_blkbits;
2398 /* first map all the buffers, logging any direct items we find */ 2392 /* first map all the buffers, logging any direct items we find */
2399 do { 2393 do {
2400 if ((checked || buffer_dirty(bh)) && (!buffer_mapped(bh) || 2394 if (block > last_block) {
2401 (buffer_mapped(bh) 2395 /*
2396 * This can happen when the block size is less than
2397 * the page size. The corresponding bytes in the page
2398 * were zero filled above
2399 */
2400 clear_buffer_dirty(bh);
2401 set_buffer_uptodate(bh);
2402 } else if ((checked || buffer_dirty(bh)) &&
2403 (!buffer_mapped(bh) || (buffer_mapped(bh)
2402 && bh->b_blocknr == 2404 && bh->b_blocknr ==
2403 0))) { 2405 0))) {
2404 /* not mapped yet, or it points to a direct item, search 2406 /* not mapped yet, or it points to a direct item, search
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c
index 745c88100895..a986b5e1e288 100644
--- a/fs/reiserfs/ioctl.c
+++ b/fs/reiserfs/ioctl.c
@@ -116,12 +116,12 @@ static int reiserfs_unpack(struct inode *inode, struct file *filp)
116 if (REISERFS_I(inode)->i_flags & i_nopack_mask) { 116 if (REISERFS_I(inode)->i_flags & i_nopack_mask) {
117 return 0; 117 return 0;
118 } 118 }
119 reiserfs_write_lock(inode->i_sb);
120 119
121 /* we need to make sure nobody is changing the file size beneath 120 /* we need to make sure nobody is changing the file size beneath
122 ** us 121 ** us
123 */ 122 */
124 mutex_lock(&inode->i_mutex); 123 mutex_lock(&inode->i_mutex);
124 reiserfs_write_lock(inode->i_sb);
125 125
126 write_from = inode->i_size & (blocksize - 1); 126 write_from = inode->i_size & (blocksize - 1);
127 /* if we are on a block boundary, we are already unpacked. */ 127 /* if we are on a block boundary, we are already unpacked. */
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 39fedaa88a0c..d935fb9394e3 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -424,7 +424,7 @@ int xattr_readdir(struct file *file, filldir_t filler, void *buf)
424 int res = -ENOTDIR; 424 int res = -ENOTDIR;
425 if (!file->f_op || !file->f_op->readdir) 425 if (!file->f_op || !file->f_op->readdir)
426 goto out; 426 goto out;
427 mutex_lock(&inode->i_mutex); 427 mutex_lock_nested(&inode->i_mutex, I_MUTEX_XATTR);
428// down(&inode->i_zombie); 428// down(&inode->i_zombie);
429 res = -ENOENT; 429 res = -ENOENT;
430 if (!IS_DEADDIR(inode)) { 430 if (!IS_DEADDIR(inode)) {