Skip to contentSkip to conversation

xfs: move the comment on log device near the right log dev check in xfs_mount_validate_sb

PATCH In review Wang Sheng-Hui 2 participants 2 messages Feb 8, 2015 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: move the comment on log device near the right log dev check in xfs_mount_validate_sb

The beginning is about magic and version number check. Move the comment on log device near the log dev check logic.

---
 fs/xfs/libxfs/xfs_sb.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
fs/xfs/libxfs/xfs_sb.c +9 -8
index 752915f..b4bb852 100644
@@ -174,20 +174,13 @@ xfs_mount_validate_sb(
 	bool		check_inprogress,
 	bool		check_version)
 {
+	/* check magic number and version number */
 
-	/*
-	 * If the log device and data device have the
-	 * same device number, the log is internal.
-	 * Consequently, the sb_logstart should be non-zero.  If
-	 * we have a zero sb_logstart in this case, we may be trying to mount
-	 * a volume filesystem in a non-volume manner.
-	 */
 	if (sbp->sb_magicnum != XFS_SB_MAGIC) {
 		xfs_warn(mp, "bad magic number");
 		return -EWRONGFS;
 	}
 
-
 	if (!xfs_sb_good_version(sbp)) {
 		xfs_warn(mp, "bad version");
 		return -EWRONGFS;
@@ -245,6 +238,14 @@ xfs_mount_validate_sb(
 			return -EFSCORRUPTED;
 	}
 
+	/*
+	 * If the log device and data device have the
+	 * same device number, the log is internal.
+	 * Consequently, the sb_logstart should be non-zero.  If
+	 * we have a zero sb_logstart in this case, we may be trying to mount
+	 * a volume filesystem in a non-volume manner.
+	 */
+
 	if (unlikely(
 	    sbp->sb_logstart == 0 && mp->m_logdev_targp == mp->m_ddev_targp)) {
 		xfs_warn(mp,
Signature · 8 lines
2.1.2



_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw
Quoted 4 lines · Wang Sheng-Hui

The beginning is about magic and version number check. Move the comment on log device near the log dev check logic.

The comment is old and redundant. The error messages document the reason for the checks better than the comment and the comments about volume mounts date back to Irix and so aren't relevant any more. So just remove the comment.

fs/xfs/libxfs/xfs_sb.c xfs_mount_validate_sb( · line 177

Quoted 13 lines
---
 fs/xfs/libxfs/xfs_sb.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
fs/xfs/libxfs/xfs_sb.c +1 -0
index 752915f..b4bb852 100644
@@ -174,20 +174,13 @@ xfs_mount_validate_sb(
 	bool		check_inprogress,
 	bool		check_version)
 {
+	/* check magic number and version number */

No need to add a redundant comment - it is obvious what the code it refers to is checking.

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

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