[Ocfs2-commits] smushran commits r3070 - branches/ocfs2-1.2/fs/ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Nov 20 14:44:44 PST 2007


Author: smushran
Date: 2007-11-20 14:44:43 -0800 (Tue, 20 Nov 2007)
New Revision: 3070

Modified:
   branches/ocfs2-1.2/fs/ocfs2/alloc.c
Log:
ocfs2: Remove overzealous BUG_ON()

The truncate code was never supposed to BUG() on an allocator it doesn't
know about, but rather to ignore it. Right now, this does nothing, but when
we change our allocation paths to use all suballocator files, this will
allow current versions of the fs module to work fine.

Authored-by: Mark Fasheh <mfasheh>
Signed-off-by: mfasheh

Modified: branches/ocfs2-1.2/fs/ocfs2/alloc.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/alloc.c	2007-11-20 22:43:11 UTC (rev 3069)
+++ branches/ocfs2-1.2/fs/ocfs2/alloc.c	2007-11-20 22:44:43 UTC (rev 3070)
@@ -1714,17 +1714,29 @@
 
 			ocfs2_remove_from_cache(inode, eb_bh);
 
-			BUG_ON(eb->h_suballoc_slot);
 			BUG_ON(el->l_recs[0].e_clusters);
 			BUG_ON(el->l_recs[0].e_cpos);
 			BUG_ON(el->l_recs[0].e_blkno);
-			status = ocfs2_free_extent_block(handle,
-							 tc->tc_ext_alloc_inode,
-							 tc->tc_ext_alloc_bh,
-							 eb);
-			if (status < 0) {
-				mlog_errno(status);
-				goto bail;
+			if (eb->h_suballoc_slot == 0) {
+				/*
+				 * This code only understands how to
+				 * lock the suballocator in slot 0,
+				 * which is fine because allocation is
+				 * only ever done out of that
+				 * suballocator too. A future version
+				 * might change that however, so avoid
+				 * a free if we don't know how to
+				 * handle it. This way an fs incompat
+				 * bit will not be necessary.
+				 */
+				status = ocfs2_free_extent_block(handle,
+								 tc->tc_ext_alloc_inode,
+								 tc->tc_ext_alloc_bh,
+								 eb);
+				if (status < 0) {
+					mlog_errno(status);
+					goto bail;
+				}
 			}
 		}
 		brelse(eb_bh);




More information about the Ocfs2-commits mailing list