Skip to contentSkip to conversation

xfs: Validate log space at mount time

PATCH In review Jeff Liu 1 participant 1 message May 17, 2013 XFS filesystem

lore
Share & tools
lore

Jeff Liu

author
#0 lore raw

PATCH v2 8/8 xfs: Validate log space at mount time

From: Jie Liu <[email protected]>

Validate log space during log mount stage, the underlying function will drop a warning message via syslog in critical level if the log space is too small or too large.

---
 fs/xfs/xfs_log.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
fs/xfs/xfs_log.c +12 -0
index 304b3d0..2a631d9 100644
@@ -30,6 +30,7 @@
 #include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
 #include "xfs_log_recover.h"
+#include "xfs_log_rlimit.h"
 #include "xfs_trans_priv.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
@@ -631,6 +632,17 @@ xfs_log_mount(
 	}
 
 	/*
+	 * Validate the given log space and drop a critical message via syslog
+	 * if the log size is too small that would lead to some unexpected
+	 * situations in transaction log space reservation stage.
+	 * Note: we can't just reject the mount if the validation fails.  This
+	 * would mean that people would have to downgrade their kernel just to
+	 * remedy the situation as there is no way to grow the log (short of
+	 * black magic surgery with xfs_db).
+	 */
+	xfs_log_validate_logspace(mp);
+
+	/*
 	 * Initialize the AIL now we have a log.
 	 */
 	error = xfs_trans_ail_init(mp);
Signature · 6 lines
1.7.9.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs