aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/balloc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-06-08 14:15:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-06-08 14:15:31 -0400
commit77249539cd987884f86df6fd5c43b3dae1841be1 (patch)
tree074f4c622b3f6da56c81d12bfb3409447c8d81a3 /fs/ext4/balloc.c
parent3e9ca0224152bac6ea812e3ccfe933d3932c21bd (diff)
parentb22b1f178f6799278d3178d894f37facb2085765 (diff)
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 bug fixes from Theodore Ts'o: "This update contains two bug fixes, both destined for the stable tree. Perhaps the most important is one which fixes ext4 when used with file systems originally formatted for use with ext3, but then later converted to take advantage of ext4." * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: don't set i_flags in EXT4_IOC_SETFLAGS ext4: fix the free blocks calculation for ext3 file systems w/ uninit_bg
Diffstat (limited to 'fs/ext4/balloc.c')
-rw-r--r--fs/ext4/balloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 99b6324290db..cee7812cc3cf 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -90,8 +90,8 @@ unsigned ext4_num_overhead_clusters(struct super_block *sb,
90 * unusual file system layouts. 90 * unusual file system layouts.
91 */ 91 */
92 if (ext4_block_in_group(sb, ext4_block_bitmap(sb, gdp), block_group)) { 92 if (ext4_block_in_group(sb, ext4_block_bitmap(sb, gdp), block_group)) {
93 block_cluster = EXT4_B2C(sbi, (start - 93 block_cluster = EXT4_B2C(sbi,
94 ext4_block_bitmap(sb, gdp))); 94 ext4_block_bitmap(sb, gdp) - start);
95 if (block_cluster < num_clusters) 95 if (block_cluster < num_clusters)
96 block_cluster = -1; 96 block_cluster = -1;
97 else if (block_cluster == num_clusters) { 97 else if (block_cluster == num_clusters) {
@@ -102,7 +102,7 @@ unsigned ext4_num_overhead_clusters(struct super_block *sb,
102 102
103 if (ext4_block_in_group(sb, ext4_inode_bitmap(sb, gdp), block_group)) { 103 if (ext4_block_in_group(sb, ext4_inode_bitmap(sb, gdp), block_group)) {
104 inode_cluster = EXT4_B2C(sbi, 104 inode_cluster = EXT4_B2C(sbi,
105 start - ext4_inode_bitmap(sb, gdp)); 105 ext4_inode_bitmap(sb, gdp) - start);
106 if (inode_cluster < num_clusters) 106 if (inode_cluster < num_clusters)
107 inode_cluster = -1; 107 inode_cluster = -1;
108 else if (inode_cluster == num_clusters) { 108 else if (inode_cluster == num_clusters) {
@@ -114,7 +114,7 @@ unsigned ext4_num_overhead_clusters(struct super_block *sb,
114 itbl_blk = ext4_inode_table(sb, gdp); 114 itbl_blk = ext4_inode_table(sb, gdp);
115 for (i = 0; i < sbi->s_itb_per_group; i++) { 115 for (i = 0; i < sbi->s_itb_per_group; i++) {
116 if (ext4_block_in_group(sb, itbl_blk + i, block_group)) { 116 if (ext4_block_in_group(sb, itbl_blk + i, block_group)) {
117 c = EXT4_B2C(sbi, start - itbl_blk + i); 117 c = EXT4_B2C(sbi, itbl_blk + i - start);
118 if ((c < num_clusters) || (c == inode_cluster) || 118 if ((c < num_clusters) || (c == inode_cluster) ||
119 (c == block_cluster) || (c == itbl_cluster)) 119 (c == block_cluster) || (c == itbl_cluster))
120 continue; 120 continue;