aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <glommer@br.ibm.com>2005-10-30 18:02:48 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 20:37:23 -0500
commit5b11687924e40790deb0d5f959247ade82196665 (patch)
tree29aa104cc40bd2c85e7bba0f4b404b04cd6f207a /fs/ext3
parent2384f55f8aa520172c995965bd2f8a9740d53095 (diff)
[PATCH] Locking problems while EXT3FS_DEBUG on
I noticed some problems while running ext3 with the debug flag set on. More precisely, I was unable to umount the filesystem. Some investigation took me to the patch that follows. At a first glance , the lock/unlock I've taken out seems really not necessary, as the main code (outside debug) does not lock the super. The only additional danger operations that debug code introduces seems to be related to bitmap, but bitmap operations tends to be all atomic anyway. I also took the opportunity to fix 2 spelling errors. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ext3')
-rw-r--r--fs/ext3/balloc.c5
-rw-r--r--fs/ext3/ialloc.c2
-rw-r--r--fs/ext3/inode.c2
3 files changed, 3 insertions, 6 deletions
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
index 0213db4911a2..032c7ba1b13f 100644
--- a/fs/ext3/balloc.c
+++ b/fs/ext3/balloc.c
@@ -1010,7 +1010,7 @@ retry:
1010 * allocation within the reservation window. 1010 * allocation within the reservation window.
1011 * 1011 *
1012 * This will avoid keeping on searching the reservation list again and 1012 * This will avoid keeping on searching the reservation list again and
1013 * again when someboday is looking for a free block (without 1013 * again when somebody is looking for a free block (without
1014 * reservation), and there are lots of free blocks, but they are all 1014 * reservation), and there are lots of free blocks, but they are all
1015 * being reserved. 1015 * being reserved.
1016 * 1016 *
@@ -1416,12 +1416,12 @@ unsigned long ext3_count_free_blocks(struct super_block *sb)
1416 unsigned long bitmap_count, x; 1416 unsigned long bitmap_count, x;
1417 struct buffer_head *bitmap_bh = NULL; 1417 struct buffer_head *bitmap_bh = NULL;
1418 1418
1419 lock_super(sb);
1420 es = EXT3_SB(sb)->s_es; 1419 es = EXT3_SB(sb)->s_es;
1421 desc_count = 0; 1420 desc_count = 0;
1422 bitmap_count = 0; 1421 bitmap_count = 0;
1423 gdp = NULL; 1422 gdp = NULL;
1424 1423
1424 smp_rmb();
1425 for (i = 0; i < ngroups; i++) { 1425 for (i = 0; i < ngroups; i++) {
1426 gdp = ext3_get_group_desc(sb, i, NULL); 1426 gdp = ext3_get_group_desc(sb, i, NULL);
1427 if (!gdp) 1427 if (!gdp)
@@ -1440,7 +1440,6 @@ unsigned long ext3_count_free_blocks(struct super_block *sb)
1440 brelse(bitmap_bh); 1440 brelse(bitmap_bh);
1441 printk("ext3_count_free_blocks: stored = %u, computed = %lu, %lu\n", 1441 printk("ext3_count_free_blocks: stored = %u, computed = %lu, %lu\n",
1442 le32_to_cpu(es->s_free_blocks_count), desc_count, bitmap_count); 1442 le32_to_cpu(es->s_free_blocks_count), desc_count, bitmap_count);
1443 unlock_super(sb);
1444 return bitmap_count; 1443 return bitmap_count;
1445#else 1444#else
1446 desc_count = 0; 1445 desc_count = 0;
diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c
index 6549945f9ac1..0eb4f90268da 100644
--- a/fs/ext3/ialloc.c
+++ b/fs/ext3/ialloc.c
@@ -704,7 +704,6 @@ unsigned long ext3_count_free_inodes (struct super_block * sb)
704 unsigned long bitmap_count, x; 704 unsigned long bitmap_count, x;
705 struct buffer_head *bitmap_bh = NULL; 705 struct buffer_head *bitmap_bh = NULL;
706 706
707 lock_super (sb);
708 es = EXT3_SB(sb)->s_es; 707 es = EXT3_SB(sb)->s_es;
709 desc_count = 0; 708 desc_count = 0;
710 bitmap_count = 0; 709 bitmap_count = 0;
@@ -727,7 +726,6 @@ unsigned long ext3_count_free_inodes (struct super_block * sb)
727 brelse(bitmap_bh); 726 brelse(bitmap_bh);
728 printk("ext3_count_free_inodes: stored = %u, computed = %lu, %lu\n", 727 printk("ext3_count_free_inodes: stored = %u, computed = %lu, %lu\n",
729 le32_to_cpu(es->s_free_inodes_count), desc_count, bitmap_count); 728 le32_to_cpu(es->s_free_inodes_count), desc_count, bitmap_count);
730 unlock_super(sb);
731 return desc_count; 729 return desc_count;
732#else 730#else
733 desc_count = 0; 731 desc_count = 0;
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 8b38f2232796..b5da5244e144 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -491,7 +491,7 @@ static unsigned long ext3_find_goal(struct inode *inode, long block,
491 * the same format as ext3_get_branch() would do. We are calling it after 491 * the same format as ext3_get_branch() would do. We are calling it after
492 * we had read the existing part of chain and partial points to the last 492 * we had read the existing part of chain and partial points to the last
493 * triple of that (one with zero ->key). Upon the exit we have the same 493 * triple of that (one with zero ->key). Upon the exit we have the same
494 * picture as after the successful ext3_get_block(), excpet that in one 494 * picture as after the successful ext3_get_block(), except that in one
495 * place chain is disconnected - *branch->p is still zero (we did not 495 * place chain is disconnected - *branch->p is still zero (we did not
496 * set the last link), but branch->key contains the number that should 496 * set the last link), but branch->key contains the number that should
497 * be placed into *branch->p to fill that gap. 497 * be placed into *branch->p to fill that gap.