Re: Ext4 tree backports for 2.6.27.13 and 2.6.28.2

From: Fabio Comolli
Date: Tue Mar 31 2009 - 08:40:39 EST


OK. Now I have on my box the 2.6.27.19 kernel. Do you mean that I have
to apply 19->20, 20->21 and then this patch?

Then mount the fs as ext4dev?

Thanks,
Fabio

On Tue, Mar 31, 2009 at 2:33 PM, Theodore Tso <tytso@xxxxxxx> wrote:
> On Tue, Mar 31, 2009 at 02:02:26PM +0200, Fabio Comolli wrote:
>> Is there a patch for 2.6.27.X for people not using git?
>
> These patches that were referenced in the mail thread which you
> replied against have already been integrated into the latest 2.6.27.X
> series.
>
> There is another batch of patches which is being queued for the stable
> series, which I sent out last week. ÂThe for-stable branch and
> for-stable-2.6.27 branches are for people to do a final round of
> testing before I submit them to the stable series. ÂAt the moment,
> they are only available via git, but usually after a week or so, I'll
> send them out to stable@xxxxxxxxxx, and then usually within a week or
> so (unless Greg and Chris are travelling), a new stable series shows
> up with the latest ext4 bug fixes.
>
> If you really are interested in testing the latest pre-release stable
> patches for 2.6.27 --- these are versus 2.6.27.20, they're small
> enough that I'll include them here.
>
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â- Ted
>
> Eric Sandeen (4):
> Â Â Âext4: fix ext4_free_inode() vs. ext4_claim_inode() race
> Â Â Âext4: fix header check in ext4_ext_search_right() for deep extent trees.
> Â Â Âext4: fix bogus BUG_ONs in in mballoc code
> Â Â Âext4: fix bb_prealloc_list corruption due to wrong group locking
>
> Theodore Ts'o (1):
> Â Â Âext4: Print the find_group_flex() warning only once
>
> Âfs/ext4/extents.c | Â Â6 ++++--
> Âfs/ext4/ialloc.c Â| Â 16 ++++++++++------
> Âfs/ext4/mballoc.c | Â 13 +++++++++----
> Â3 files changed, 23 insertions(+), 12 deletions(-)
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index b24d3c5..acb98c9 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -1118,7 +1118,8 @@ ext4_ext_search_right(struct inode *inode, struct ext4_ext_path *path,
> Â Â Â Âstruct ext4_extent_idx *ix;
> Â Â Â Âstruct ext4_extent *ex;
> Â Â Â Âext4_fsblk_t block;
> - Â Â Â int depth, ee_len;
> + Â Â Â int depth; Â Â Â/* Note, NOT eh_depth; depth from top of tree */
> + Â Â Â int ee_len;
>
> Â Â Â ÂBUG_ON(path == NULL);
> Â Â Â Âdepth = path->p_depth;
> @@ -1177,7 +1178,8 @@ ext4_ext_search_right(struct inode *inode, struct ext4_ext_path *path,
> Â Â Â Â Â Â Â Âif (bh == NULL)
> Â Â Â Â Â Â Â Â Â Â Â Âreturn -EIO;
> Â Â Â Â Â Â Â Âeh = ext_block_hdr(bh);
> - Â Â Â Â Â Â Â if (ext4_ext_check_header(inode, eh, depth)) {
> + Â Â Â Â Â Â Â /* subtract from p_depth to get proper eh_depth */
> + Â Â Â Â Â Â Â if (ext4_ext_check_header(inode, eh, path->p_depth - depth)) {
> Â Â Â Â Â Â Â Â Â Â Â Âput_bh(bh);
> Â Â Â Â Â Â Â Â Â Â Â Âreturn -EIO;
> Â Â Â Â Â Â Â Â}
> diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
> index cce841f..b9457e1 100644
> --- a/fs/ext4/ialloc.c
> +++ b/fs/ext4/ialloc.c
> @@ -188,7 +188,7 @@ void ext4_free_inode (handle_t *handle, struct inode * inode)
> Â Â Â Âstruct ext4_group_desc * gdp;
> Â Â Â Âstruct ext4_super_block * es;
> Â Â Â Âstruct ext4_sb_info *sbi;
> - Â Â Â int fatal = 0, err;
> + Â Â Â int fatal = 0, err, cleared;
> Â Â Â Âext4_group_t flex_group;
>
> Â Â Â Âif (atomic_read(&inode->i_count) > 1) {
> @@ -242,10 +242,12 @@ void ext4_free_inode (handle_t *handle, struct inode * inode)
> Â Â Â Â Â Â Â Âgoto error_return;
>
> Â Â Â Â/* Ok, now we can actually update the inode bitmaps.. */
> - Â Â Â if (!ext4_clear_bit_atomic(sb_bgl_lock(sbi, block_group),
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â bit, bitmap_bh->b_data))
> - Â Â Â Â Â Â Â ext4_error (sb, "ext4_free_inode",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â "bit already cleared for inode %lu", ino);
> + Â Â Â spin_lock(sb_bgl_lock(sbi, block_group));
> + Â Â Â cleared = ext4_clear_bit(bit, bitmap_bh->b_data);
> + Â Â Â spin_unlock(sb_bgl_lock(sbi, block_group));
> + Â Â Â if (!cleared)
> + Â Â Â Â Â Â Â ext4_error(sb, "ext4_free_inode",
> + Â Â Â Â Â Â Â Â Â Â Â Â Â"bit already cleared for inode %lu", ino);
> Â Â Â Âelse {
> Â Â Â Â Â Â Â Âgdp = ext4_get_group_desc (sb, block_group, &bh2);
>
> @@ -685,6 +687,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode)
> Â Â Â Âstruct inode *ret;
> Â Â Â Âext4_group_t i;
> Â Â Â Âint free = 0;
> + Â Â Â static int once = 1;
> Â Â Â Âext4_group_t flex_group;
>
> Â Â Â Â/* Cannot create files in a deleted directory */
> @@ -704,7 +707,8 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode)
> Â Â Â Â Â Â Â Âret2 = find_group_flex(sb, dir, &group);
> Â Â Â Â Â Â Â Âif (ret2 == -1) {
> Â Â Â Â Â Â Â Â Â Â Â Âret2 = find_group_other(sb, dir, &group);
> - Â Â Â Â Â Â Â Â Â Â Â if (ret2 == 0 && printk_ratelimit())
> + Â Â Â Â Â Â Â Â Â Â Â if (ret2 == 0 && once)
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â once = 0;
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âprintk(KERN_NOTICE "ext4: find_group_flex "
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "failed, fallback succeeded dir %lu\n",
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â dir->i_ino);
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index 39d7cc1..f34dada 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -1450,7 +1450,7 @@ static void ext4_mb_measure_extent(struct ext4_allocation_context *ac,
> Â Â Â Âstruct ext4_free_extent *gex = &ac->ac_g_ex;
>
> Â Â Â ÂBUG_ON(ex->fe_len <= 0);
> - Â Â Â BUG_ON(ex->fe_len >= EXT4_BLOCKS_PER_GROUP(ac->ac_sb));
> + Â Â Â BUG_ON(ex->fe_len > EXT4_BLOCKS_PER_GROUP(ac->ac_sb));
> Â Â Â ÂBUG_ON(ex->fe_start >= EXT4_BLOCKS_PER_GROUP(ac->ac_sb));
> Â Â Â ÂBUG_ON(ac->ac_status != AC_STATUS_CONTINUE);
>
> @@ -3400,7 +3400,7 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac,
> Â Â Â Â}
> Â Â Â ÂBUG_ON(start + size <= ac->ac_o_ex.fe_logical &&
> Â Â Â Â Â Â Â Â Â Â Â Âstart > ac->ac_o_ex.fe_logical);
> - Â Â Â BUG_ON(size <= 0 || size >= EXT4_BLOCKS_PER_GROUP(ac->ac_sb));
> + Â Â Â BUG_ON(size <= 0 || size > EXT4_BLOCKS_PER_GROUP(ac->ac_sb));
>
> Â Â Â Â/* now prepare goal request */
>
> @@ -3698,6 +3698,7 @@ static void ext4_mb_put_pa(struct ext4_allocation_context *ac,
> Â Â Â Â Â Â Â Â Â Â Â Âstruct super_block *sb, struct ext4_prealloc_space *pa)
> Â{
> Â Â Â Âunsigned long grp;
> + Â Â Â ext4_fsblk_t grp_blk;
>
> Â Â Â Âif (!atomic_dec_and_test(&pa->pa_count) || pa->pa_free != 0)
> Â Â Â Â Â Â Â Âreturn;
> @@ -3712,8 +3713,12 @@ static void ext4_mb_put_pa(struct ext4_allocation_context *ac,
> Â Â Â Âpa->pa_deleted = 1;
> Â Â Â Âspin_unlock(&pa->pa_lock);
>
> - Â Â Â /* -1 is to protect from crossing allocation group */
> - Â Â Â ext4_get_group_no_and_offset(sb, pa->pa_pstart - 1, &grp, NULL);
> + Â Â Â grp_blk = pa->pa_pstart;
> + Â Â Â /* If linear, pa_pstart may be in the next group when pa is used up */
> + Â Â Â if (pa->pa_linear)
> + Â Â Â Â Â Â Â grp_blk--;
> +
> + Â Â Â ext4_get_group_no_and_offset(sb, grp_blk, &grp, NULL);
>
> Â Â Â Â/*
> Â Â Â Â * possible race:
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/