linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ext4: s_freeclusters_counter should not tranform to unit of block before assigning to "free_clusters" in ext4_has_free_cluste
@ 2012-03-13 11:38 Robin Dong
  2012-03-13 11:38 ` [PATCH 2/3] ext4: modify the implementation of quota reservation in bigalloc-delay-allocation Robin Dong
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Robin Dong @ 2012-03-13 11:38 UTC (permalink / raw)
  To: linux-ext4; +Cc: Robin Dong, Robin Dong

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".

Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Robin Dong <sanbai@taobao.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..2c518f8 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -426,7 +426,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));
+		free_clusters  = percpu_counter_sum_positive(fcc);
 		dirty_clusters = percpu_counter_sum_positive(dcc);
 	}
 	/* Check whether we have space after accounting for current
-- 
1.7.3.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-16  3:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-13 11:38 [PATCH 1/3] ext4: s_freeclusters_counter should not tranform to unit of block before assigning to "free_clusters" in ext4_has_free_cluste Robin Dong
2012-03-13 11:38 ` [PATCH 2/3] ext4: modify the implementation of quota reservation in bigalloc-delay-allocation Robin Dong
2012-03-13 11:38 ` [PATCH 3/3] ext4: modify the process of invalidate_page for the new implemention of quota reservation Robin Dong
2012-03-24 21:05 ` [PATCH 1/3] ext4: s_freeclusters_counter should not tranform to unit of block before assigning to "free_clusters" in ext4_has_free_cluste Ted Ts'o
2012-04-16  3:35   ` Robin Dong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).