lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 2 Feb 2012 15:48:49 +0800
From:	Robin Dong <hao.bigrat@...il.com>
To:	linux-ext4@...r.kernel.org
Subject: Re: [PATCH] ext4: s_dirtyclusters_counter should tranform to unit of
 cluster before assigning to "dirty_clusters" in ext4_has_free_clusters()

2012/2/1 Robin Dong <hao.bigrat@...il.com>:
> From: Robin Dong <sanbai@...bao.com>
>
> Creating 4-byte files until ENOSPC in a delay-allocation and bigalloc ext4 fs and then sync it, the dmseg will report like:
>
>        [  482.154538] EXT4-fs (sdb6): delayed block allocation failed for inode 1664 at logical offset 0 with max blocks 1 with error -28
>        [  482.154540] EXT4-fs (sdb6): This should not happen!! Data will be lost
>
> The reason is ext4_has_free_clusters reporting wrong result. Actually, the unit of sbi->s_dirtyclusters_counter is block, so we should tranform it to cluster for argument "dirty_clusters", just like "free_clusters".

Sorry, the description is in confusion, the correct version is:

The reason is ext4_has_free_clusters reporting wrong result. Actually,
the unit of argument "dirty_clusters" is block, so we should tranform
the
sbi->s_dirtyclusters_counter to block , just like "free_clusters".

>
> Cc: "Theodore Ts'o" <tytso@....edu>
> Reported-by: Eric Sandeen <sandeen@...hat.com>
> Signed-off-by: Robin Dong <sanbai@...bao.com>
> ---
>  fs/ext4/balloc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
> index f9e2cd8..8ff10c4 100644
> --- a/fs/ext4/balloc.c
> +++ b/fs/ext4/balloc.c
> @@ -427,7 +427,7 @@ static int ext4_has_free_clusters(struct ext4_sb_info *sbi,
>        if (free_clusters - (nclusters + root_clusters + dirty_clusters) <
>                                        EXT4_FREECLUSTERS_WATERMARK) {
>                free_clusters  = EXT4_C2B(sbi, percpu_counter_sum_positive(fcc));
> -               dirty_clusters = percpu_counter_sum_positive(dcc);
> +               dirty_clusters = EXT4_C2B(sbi, percpu_counter_sum_positive(dcc));
>        }
>        /* Check whether we have space after accounting for current
>         * dirty clusters & root reserved clusters.
> --
> 1.7.4.1
>



-- 
--
Best Regard
Robin Dong
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux - Powered by OpenVZ