aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/alloc.c
diff options
context:
space:
mode:
authorTao Ma <tao.ma@oracle.com>2010-11-04 03:14:11 -0400
committerJoel Becker <joel.becker@oracle.com>2010-12-16 03:46:02 -0500
commit50308d813bf26500fed671882469939fd19403a3 (patch)
tree4fab5caccf450f3528c1e88c7a0299680578c1ec /fs/ocfs2/alloc.c
parentb0c3844d8af6b9f3f18f31e1b0502fbefa2166be (diff)
ocfs2: Try to free truncate log when meeting ENOSPC in write.
Recently, one of our colleagues meet with a problem that if we write/delete a 32mb files repeatly, we will get an ENOSPC in the end. And the corresponding bug is 1288. http://oss.oracle.com/bugzilla/show_bug.cgi?id=1288 The real problem is that although we have freed the clusters, they are in truncate log and they will be summed up so that we can free them once in a whole. So this patch just try to resolve it. In case we see -ENOSPC in ocfs2_write_begin_no_lock, we will check whether the truncate log has enough clusters for our need, if yes, we will try to flush the truncate log at that point and try again. This method is inspired by Mark Fasheh <mfasheh@suse.com>. Thanks. Cc: Mark Fasheh <mfasheh@suse.com> Signed-off-by: Tao Ma <tao.ma@oracle.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/alloc.c')
-rw-r--r--fs/ocfs2/alloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 592fae5007d1..8ec418dd9e36 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -5858,6 +5858,7 @@ int ocfs2_truncate_log_append(struct ocfs2_super *osb,
5858 5858
5859 ocfs2_journal_dirty(handle, tl_bh); 5859 ocfs2_journal_dirty(handle, tl_bh);
5860 5860
5861 osb->truncated_clusters += num_clusters;
5861bail: 5862bail:
5862 mlog_exit(status); 5863 mlog_exit(status);
5863 return status; 5864 return status;
@@ -5929,6 +5930,8 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
5929 i--; 5930 i--;
5930 } 5931 }
5931 5932
5933 osb->truncated_clusters = 0;
5934
5932bail: 5935bail:
5933 mlog_exit(status); 5936 mlog_exit(status);
5934 return status; 5937 return status;