Thread (7 messages) 7 messages, 3 authors, 2012-02-16

Re: [PATCH] ext4: s_dirtyclusters_counter should tranform to unit of cluster before assigning to "dirty_clusters" in ext4_has_free_clusters()

From: Aditya Kali <hidden>
Date: 2012-02-16 20:12:49

On Tue, Feb 14, 2012 at 7:19 PM, Robin Dong [off-list ref] 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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help