public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: fix in the setting of logbsize
@ 2015-06-05 13:28 Ales Novak
  2015-06-05 22:22 ` Dave Chinner
  0 siblings, 1 reply; 8+ messages in thread
From: Ales Novak @ 2015-06-05 13:28 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Ales Novak, linux-kernel, xfs

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@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

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-07-03 15:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-05 13:28 [PATCH] xfs: fix in the setting of logbsize Ales Novak
2015-06-05 22:22 ` Dave Chinner
2015-06-05 23:03   ` Eric Sandeen
2015-06-06 22:32     ` Dave Chinner
2015-07-03 15:09       ` Ales Novak
2015-06-07  9:16   ` Ales Novak
2015-06-08 13:04     ` Mark Tinguely
2015-06-25 22:58       ` Ales Novak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox