Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
ext3: Always set dx_node's fake_dirent explicitly.
ext3: Fix an overflow in ext3_trim_fs.
jbd: Remove one to many n's in a word.
ext3: skip orphan cleanup on rocompat fs
ext2: Fix link count corruption under heavy link+rename load
ext3: speed up group trim with the right free block count.
ext3: Adjust trim start with first_data_block.
quota: return -ENOMEM when memory allocation fails

+23 -13
+12 -9
fs/ext3/balloc.c
··· 1991 1991 spin_unlock(sb_bgl_lock(sbi, group)); 1992 1992 percpu_counter_sub(&sbi->s_freeblocks_counter, next - start); 1993 1993 1994 + free_blocks -= next - start; 1994 1995 /* Do not issue a TRIM on extents smaller than minblocks */ 1995 1996 if ((next - start) < minblocks) 1996 1997 goto free_extent; ··· 2041 2040 cond_resched(); 2042 2041 2043 2042 /* No more suitable extents */ 2044 - if ((free_blocks - count) < minblocks) 2043 + if (free_blocks < minblocks) 2045 2044 break; 2046 2045 } 2047 2046 ··· 2091 2090 ext3_fsblk_t max_blks = le32_to_cpu(es->s_blocks_count); 2092 2091 int ret = 0; 2093 2092 2094 - start = range->start >> sb->s_blocksize_bits; 2093 + start = (range->start >> sb->s_blocksize_bits) + 2094 + le32_to_cpu(es->s_first_data_block); 2095 2095 len = range->len >> sb->s_blocksize_bits; 2096 2096 minlen = range->minlen >> sb->s_blocksize_bits; 2097 2097 trimmed = 0; ··· 2101 2099 return -EINVAL; 2102 2100 if (start >= max_blks) 2103 2101 goto out; 2104 - if (start < le32_to_cpu(es->s_first_data_block)) { 2105 - len -= le32_to_cpu(es->s_first_data_block) - start; 2106 - start = le32_to_cpu(es->s_first_data_block); 2107 - } 2108 2102 if (start + len > max_blks) 2109 2103 len = max_blks - start; 2110 2104 ··· 2127 2129 if (free_blocks < minlen) 2128 2130 continue; 2129 2131 2130 - if (len >= EXT3_BLOCKS_PER_GROUP(sb)) 2131 - len -= (EXT3_BLOCKS_PER_GROUP(sb) - first_block); 2132 - else 2132 + /* 2133 + * For all the groups except the last one, last block will 2134 + * always be EXT3_BLOCKS_PER_GROUP(sb), so we only need to 2135 + * change it for the last group in which case first_block + 2136 + * len < EXT3_BLOCKS_PER_GROUP(sb). 2137 + */ 2138 + if (first_block + len < EXT3_BLOCKS_PER_GROUP(sb)) 2133 2139 last_block = first_block + len; 2140 + len -= last_block - first_block; 2134 2141 2135 2142 ret = ext3_trim_all_free(sb, group, first_block, 2136 2143 last_block, minlen);
+1 -1
fs/ext3/namei.c
··· 1540 1540 goto cleanup; 1541 1541 node2 = (struct dx_node *)(bh2->b_data); 1542 1542 entries2 = node2->entries; 1543 + memset(&node2->fake, 0, sizeof(struct fake_dirent)); 1543 1544 node2->fake.rec_len = ext3_rec_len_to_disk(sb->s_blocksize); 1544 - node2->fake.inode = 0; 1545 1545 BUFFER_TRACE(frame->bh, "get_write_access"); 1546 1546 err = ext3_journal_get_write_access(handle, frame->bh); 1547 1547 if (err)
+7
fs/ext3/super.c
··· 1464 1464 return; 1465 1465 } 1466 1466 1467 + /* Check if feature set allows readwrite operations */ 1468 + if (EXT3_HAS_RO_COMPAT_FEATURE(sb, ~EXT3_FEATURE_RO_COMPAT_SUPP)) { 1469 + ext3_msg(sb, KERN_INFO, "Skipping orphan cleanup due to " 1470 + "unknown ROCOMPAT features"); 1471 + return; 1472 + } 1473 + 1467 1474 if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) { 1468 1475 if (es->s_last_orphan) 1469 1476 jbd_debug(1, "Errors on filesystem, "
+1 -1
fs/jbd/journal.c
··· 839 839 err = journal_bmap(journal, 0, &blocknr); 840 840 /* If that failed, give up */ 841 841 if (err) { 842 - printk(KERN_ERR "%s: Cannnot locate journal superblock\n", 842 + printk(KERN_ERR "%s: Cannot locate journal superblock\n", 843 843 __func__); 844 844 goto out_err; 845 845 }
+1 -1
fs/jbd2/journal.c
··· 991 991 err = jbd2_journal_bmap(journal, 0, &blocknr); 992 992 /* If that failed, give up */ 993 993 if (err) { 994 - printk(KERN_ERR "%s: Cannnot locate journal superblock\n", 994 + printk(KERN_ERR "%s: Cannot locate journal superblock\n", 995 995 __func__); 996 996 goto out_err; 997 997 }
+1 -1
fs/quota/quota_v2.c
··· 112 112 if (!info->dqi_priv) { 113 113 printk(KERN_WARNING 114 114 "Not enough memory for quota information structure.\n"); 115 - return -1; 115 + return -ENOMEM; 116 116 } 117 117 qinfo = info->dqi_priv; 118 118 if (version == 0) {