[Ocfs2-commits] mfasheh commits r2368 - trunk/fs/ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Jun 3 19:58:47 CDT 2005


Author: mfasheh
Signed-off-by: jlbec
Date: 2005-06-03 19:58:45 -0500 (Fri, 03 Jun 2005)
New Revision: 2368

Modified:
   trunk/fs/ocfs2/localalloc.c
Log:
* Don't fail mount just because another node failed during it's recovery of 
  a slot 

* take local alloc i_sem in ocfs2_begin_local_alloc_recovery  

Signed-off-by: jlbec



Modified: trunk/fs/ocfs2/localalloc.c
===================================================================
--- trunk/fs/ocfs2/localalloc.c	2005-06-04 00:19:55 UTC (rev 2367)
+++ trunk/fs/ocfs2/localalloc.c	2005-06-04 00:58:45 UTC (rev 2368)
@@ -126,6 +126,7 @@
 		mlog_errno(status);
 		goto bail;
 	}
+
 	status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno,
 				  &alloc_bh, 0, inode);
 	if (status < 0) {
@@ -142,33 +143,29 @@
 		goto bail;
 	}
 
+	if ((OCFS2_LOCAL_ALLOC(alloc)->la_size == 0) || 
+	    (OCFS2_LOCAL_ALLOC(alloc)->la_size > ocfs2_local_alloc_size(inode->i_sb))) {
+		mlog(ML_ERROR, "Local alloc size is invalid (la_size = %u)\n",
+		     OCFS2_LOCAL_ALLOC(alloc)->la_size);
+		status = -EINVAL;
+		goto bail;
+	}
+
 	/* do a little verification. */
 	num_used = ocfs2_local_alloc_count_bits(alloc);
 
-	/* nowadays the local alloc has always been recovered before
-	 * we load it so there should be no bits used from the main
-	 * bitmap. */
+	/* hopefully the local alloc has always been recovered before
+	 * we load it. */
 	if (num_used
 	    || alloc->id1.bitmap1.i_used
 	    || alloc->id1.bitmap1.i_total
-	    || OCFS2_LOCAL_ALLOC(alloc)->la_bm_off) {
+	    || OCFS2_LOCAL_ALLOC(alloc)->la_bm_off)
 		mlog(ML_ERROR, "Local alloc hasn't been recovered!\n"
 		     "found = %u, set = %u, taken = %u, off = %u\n",
 		     num_used, le32_to_cpu(alloc->id1.bitmap1.i_used),
 		     le32_to_cpu(alloc->id1.bitmap1.i_total),
 		     OCFS2_LOCAL_ALLOC(alloc)->la_bm_off);
-		status = -EBUSY;
-		goto bail;
-	}
 
-	if ((OCFS2_LOCAL_ALLOC(alloc)->la_size == 0) || 
-	    (OCFS2_LOCAL_ALLOC(alloc)->la_size > ocfs2_local_alloc_size(inode->i_sb))) {
-		mlog(ML_ERROR, "Local alloc size is invalid (la_size = %u)\n",
-		     OCFS2_LOCAL_ALLOC(alloc)->la_size);
-		status = -EINVAL;
-		goto bail;
-	}
-
 	osb->local_alloc_bh = alloc_bh;
 	osb->local_alloc_state = OCFS2_LA_ENABLED;
 
@@ -330,6 +327,8 @@
 		goto bail;
 	}
 
+	down(&inode->i_sem);
+
 	status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno,
 				  &alloc_bh, 0, inode);
 	if (status < 0) {
@@ -360,8 +359,10 @@
 	if (alloc_bh)
 		brelse(alloc_bh);
 
-	if (inode)
+	if (inode) {
+		up(&inode->i_sem);
 		iput(inode);
+	}
 
 	mlog_exit(status);
 	return status;



More information about the Ocfs2-commits mailing list