[PATCH] xfs: fix in the setting of logbsize

Ales Novak alnovak at suse.cz
Fri Jun 5 08:28:45 CDT 2015


Logbsize should be integer multiple of log stripe unit size. If it's
not, various operations will lead to crashes, due to invalid buffer
sizes, i.e. we've seen crashes in the callpath xlog_sync->xlog_pack_data.

However, this rule is only mentioned in the documentation, while it
could be checked during the mount.

Signed-off-by: Ales Novak <alnovak at suse.cz>
---
 fs/xfs/xfs_super.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 8fcc4cc..1a3766d 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1352,6 +1352,11 @@ xfs_finish_flags(
 			xfs_warn(mp,
 		"logbuf size must be greater than or equal to log stripe size");
 			return -EINVAL;
+		} else if (mp->m_logbsize > 0 && mp->m_sb.sb_logsunit > 0 &&
+			   mp->m_logbsize % mp->m_sb.sb_logsunit) {
+			xfs_warn(mp,
+		"logbuf size must be integer multiple of log stripe size");
+			return -EINVAL;
 		}
 	} else {
 		/* Fail a mount if the logbuf is larger than 32K */
-- 
1.8.4.5



More information about the xfs mailing list