On 08/12/13 05:50, Dave Chinner wrote:
From: Jie Liu<jeff.liu@xxxxxxxxxx>
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.
[ dchinner: For CRC enable filesystems, abort the mounting of the
filesystem as mkfs should never make a log too small for the given
filesystem configuration. ]
[ dchinner: make a note of the fact that the log size limits in
block counts are in units of filesystem blocks, not basic blocks. ]
Signed-off-by: Jie Liu<jeff.liu@xxxxxxxxxx>
Signed-off-by: Dave Chinner<dchinner@xxxxxxxxxx>
---
fs/xfs/xfs_fs.h | 4 +++-
fs/xfs/xfs_log.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 49 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/xfs_fs.h b/fs/xfs/xfs_fs.h
index 74b24b2..53e33c2 100644
--- a/fs/xfs/xfs_fs.h
+++ b/fs/xfs/xfs_fs.h
@@ -240,7 +240,9 @@ typedef struct xfs_fsop_resblks {
/*
- * Minimum and maximum sizes need for growth checks
+ * Minimum and maximum sizes need for growth checks.
+ *
+ * Block counts are in units of filesystem blocks, not basic blocks.
*/
#define XFS_MIN_AG_BLOCKS 64
#define XFS_MIN_LOG_BLOCKS 512ULL
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 704f095..b5703cc 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -631,6 +632,50 @@ xfs_log_mount(
...
+ } else if (mp->m_sb.sb_logblocks> XFS_MAX_LOG_BLOCKS) {
oops - missed that.
+ xfs_warn(mp,
+ "Log size %d blocks too large, maximum size is %lld blocks",
+ mp->m_sb.sb_logblocks, XFS_MAX_LOG_BLOCKS);
+ error = EINVAL;
Also, the code to this point in the series has been compared (patches
and individual files). The items that I mentioned in the previous review
have been dealt this.
Reviewed-by: Mark Tinguely <tinguely@xxxxxxx>
|