[Ocfs2-commits] mfasheh commits r2791 - branches/ocfs2-1.2-cert/patches

svn-commits@oss.oracle.com svn-commits at oss.oracle.com
Mon Mar 27 16:34:51 CST 2006


Author: mfasheh
Signed-off-by: jlbec
Date: 2006-03-27 16:34:50 -0600 (Mon, 27 Mar 2006)
New Revision: 2791

Added:
   branches/ocfs2-1.2-cert/patches/ocfs2-extend_tracing2.patch
Modified:
   branches/ocfs2-1.2-cert/patches/series
Log:
* add new extend tracing patch

Signed-off-by: jlbec



Added: branches/ocfs2-1.2-cert/patches/ocfs2-extend_tracing2.patch
===================================================================
--- branches/ocfs2-1.2-cert/patches/ocfs2-extend_tracing2.patch	2006-03-27 22:29:12 UTC (rev 2790)
+++ branches/ocfs2-1.2-cert/patches/ocfs2-extend_tracing2.patch	2006-03-27 22:34:50 UTC (rev 2791)
@@ -0,0 +1,125 @@
+Index: fs/ocfs2/file.c
+===================================================================
+--- fs/ocfs2/file.c	(revision 2788)
++++ fs/ocfs2/file.c	(working copy)
+@@ -733,7 +733,8 @@ leave:
+ int ocfs2_extend_file(struct ocfs2_super *osb,
+ 		      struct inode *inode,
+ 		      u64 new_i_size,
+-		      u64 *bytes_extended)
++		      u64 *bytes_extended,
++		      int seen_extend)
+ {
+ 	int status = 0;
+ 	int restart_func = 0;
+@@ -747,6 +748,8 @@ int ocfs2_extend_file(struct ocfs2_super
+ 	struct ocfs2_alloc_context *data_ac = NULL;
+ 	struct ocfs2_alloc_context *meta_ac = NULL;
+ 	enum ocfs2_alloc_restarted why;
++	int seen_all = 0;
++	int seen_trans = 0;
+ 
+ 	mlog_entry("(Inode %"MLFu64" new_i_size=%"MLFu64")\n",
+ 		   OCFS2_I(inode)->ip_blkno, new_i_size);
+@@ -758,6 +761,8 @@ int ocfs2_extend_file(struct ocfs2_super
+ 		goto leave;
+ 
+ restart_all:
++	seen_all++;
++
+ 	handle = ocfs2_alloc_handle(osb);
+ 	if (handle == NULL) {
+ 		status = -ENOMEM;
+@@ -778,18 +783,23 @@ restart_all:
+ 		status = -EIO;
+ 		goto leave;
+ 	}
+-	mlog_bug_on_msg(i_size_read(inode) !=
+-			(le64_to_cpu(fe->i_size) - *bytes_extended),
+-			"Inode %"MLFu64" i_size = %lld, dinode i_size "
+-			"= %"MLFu64", bytes_extended = %"MLFu64", new_i_size "
+-			"= %"MLFu64"\n", OCFS2_I(inode)->ip_blkno,
+-			i_size_read(inode), le64_to_cpu(fe->i_size),
+-			*bytes_extended, new_i_size);
+-	mlog_bug_on_msg(new_i_size < i_size_read(inode),
+-			"Inode %"MLFu64", i_size = %lld, new sz = %"MLFu64"\n",
+-			OCFS2_I(inode)->ip_blkno, i_size_read(inode),
+-			new_i_size);
+-
++	if (i_size_read(inode) != (le64_to_cpu(fe->i_size) - *bytes_extended)) {
++		mlog(ML_ERROR, "Inode %"MLFu64" i_size = %lld, dinode i_size "
++		     "= %"MLFu64", bytes_extended = %"MLFu64", new_i_size "
++		     "= %"MLFu64" seen all: %d seen trans: %d seen extend %d\n", OCFS2_I(inode)->ip_blkno,
++		     i_size_read(inode), le64_to_cpu(fe->i_size),
++		     *bytes_extended, new_i_size, seen_all, seen_trans, seen_extend);
++		mlog_meta_lvb(ML_ERROR, &OCFS2_I(inode)->ip_meta_lockres);
++		BUG();
++	}
++	if (new_i_size < i_size_read(inode)) {
++		mlog(ML_ERROR,
++		     "Inode %"MLFu64", i_size = %lld, new sz = %"MLFu64" seen all: %d seen trans: %d seen extend: %d\n",
++		     OCFS2_I(inode)->ip_blkno, i_size_read(inode),
++		     new_i_size, seen_all, seen_trans, seen_extend);
++		mlog_meta_lvb(ML_ERROR, &OCFS2_I(inode)->ip_meta_lockres);
++		BUG();
++	}
+ 	if (i_size_read(inode) == new_i_size)
+   		goto leave;
+ 
+@@ -852,6 +862,7 @@ do_start_trans:
+ 	}
+ 
+ restarted_transaction:
++	seen_trans++;
+ 	/* reserve a write to the file entry early on - that we if we
+ 	 * run out of credits in the allocation path, we can still
+ 	 * update i_size. */
+@@ -1039,7 +1050,7 @@ int ocfs2_setattr(struct dentry *dentry,
+ 			status = ocfs2_truncate_file(osb, newsize, inode);
+ 		else
+ 			status = ocfs2_extend_file(osb, inode, newsize,
+-						   &bytes_added);
++						   &bytes_added, 1);
+ 		if (status < 0 && (!bytes_added)) {
+ 			if (status != -ENOSPC)
+ 				mlog_errno(status);
+Index: fs/ocfs2/file.h
+===================================================================
+--- fs/ocfs2/file.h	(revision 2788)
++++ fs/ocfs2/file.h	(working copy)
+@@ -50,7 +50,8 @@ int ocfs2_sync_inode(struct inode *inode
+ int ocfs2_extend_file(struct ocfs2_super *osb,
+ 		      struct inode *inode,
+ 		      u64 new_i_size,
+-		      u64 *bytes_extended);
++		      u64 *bytes_extended,
++		      int num_calls);
+ 
+ int ocfs2_set_inode_size(struct ocfs2_journal_handle *handle,
+ 			 struct inode *inode,
+Index: fs/ocfs2/mmap.c
+===================================================================
+--- fs/ocfs2/mmap.c	(revision 2788)
++++ fs/ocfs2/mmap.c	(working copy)
+@@ -529,6 +529,7 @@ ssize_t ocfs2_write_lock_maybe_extend(st
+ 	int level = filp->f_flags & O_APPEND;
+ 	loff_t saved_ppos;
+ 	u64 bytes_added = 0;
++	int seen_extend = 0;
+ 
+ 	osb = OCFS2_SB(inode->i_sb);
+ 
+@@ -675,11 +676,12 @@ lock:
+ 		     "i_size=%lld, need=%"MLFu64"\n", i_size_read(inode),
+ 		     info->wl_newsize);
+ 
++		seen_extend++;
+ 		/* If we extend AT ALL here then we update our state
+ 		 * and continue the write call, regardless of error --
+ 		 * this is basically a short write. */
+ 		status = ocfs2_extend_file(osb, inode, info->wl_newsize,
+-					   &bytes_added);
++					   &bytes_added, seen_extend);
+ 		if (status < 0 && (!bytes_added)) {
+ 			if (status != -ERESTARTSYS
+ 			    && status != -EINTR

Modified: branches/ocfs2-1.2-cert/patches/series
===================================================================
--- branches/ocfs2-1.2-cert/patches/series	2006-03-27 22:29:12 UTC (rev 2790)
+++ branches/ocfs2-1.2-cert/patches/series	2006-03-27 22:34:50 UTC (rev 2791)
@@ -1,6 +1,6 @@
 em-silence-eexist.patch -p0
 mar20-full-3.patch -p0
-ocfs2-extend_file_more_info_on_oops.patch -p0
+ocfs2-extend_tracing2.patch -p0
 ocfs2-journal_start_stop_msgs.patch -p0
 ocfs2-reco_nofs.patch -p0
 ocfs2_dlm-do_lvb_puts_inline2.patch -p0




More information about the Ocfs2-commits mailing list