lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGr1F2EtO6Oyf7RTfVwgAd2hC6wtYJLoS39mGM0N4qW3F-GXFQ@mail.gmail.com>
Date:	Thu, 16 Feb 2012 12:12:28 -0800
From:	Aditya Kali <adityakali@...gle.com>
To:	Robin Dong <hao.bigrat@...il.com>
Cc:	"Ted Ts'o" <tytso@....edu>, 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()

On Tue, Feb 14, 2012 at 7:19 PM, Robin Dong <hao.bigrat@...il.com> wrote:
> But I found the code in ext4_ext_map_blocks():
>
>        if ((sbi->s_cluster_ratio > 1) &&
>            ext4_find_delalloc_cluster(inode, map->m_lblk, 0))
>                map->m_flags |= EXT4_MAP_FROM_CLUSTER;
>
> thus, even the delayed allocated block in the page-cache (have not be
> allocated) already have been checked. Therefore in my opinion, the
> EXT4_MAP_FROM_CLUSTER is a sufficient check.
>
> Follow the case of your long comment :) ,  process will go like this
> in MY CODE ABOVE :
>
> [0-3], [4-7], [8-11]
>
> 1. delay-allocation write blocks 10&11
>    we reserve 1 cluster, the i_reserved_data_blocks is 1 now
> 2. delay-allocation write blocks 3 to 8
>    we reserve other 2 clusters, so 3 clusters totally, the
> i_reserved_data_blocks is 3 now
> 3. writeout the blocks 3 to 8
>    claim all 3 clusters, i_reserved_data_blocks is 0 now
>    At this moment, we really have allocated 3 clusters, and the
> remain 10&11 block would never occupy another cluster (it would
> definitely go into the [8-11] cluster), so, why need we reserve one
> more cluster quota ?
> 4.  writeout the 10&11 blocks
>    the 10&11 blocks will be set EXT4_MAP_FROM_CLUSTER flag ( by
> get_implied_cluster_alloc as the 8~9 block have been allocated), and
> it will not call ext4_da_update_reserve_space any more
>
> As this, no warning, no reserve-and-release ping pong....at least in my imaging
>
I couldn't look into this in detail, but your logic seems totally
fine. But when I wrote this code, I remember being able to reproduce
the quota warnings by running xfstests (some corner case that needed
this code).

> Could you please point out what I missed ?
>
> Thanks
>

--
Aditya
--
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