xfs
[Top] [All Lists]

[PATCH] Don't assert if trying to mount with blocksize > pagesize

To: xfs-dev <xfs-dev@xxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
Subject: [PATCH] Don't assert if trying to mount with blocksize > pagesize
From: Lachlan McIlroy <lachlan@xxxxxxx>
Date: Thu, 26 Jun 2008 12:56:45 +1000
Reply-to: lachlan@xxxxxxx
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080421)
If we don't do the blocksize/PAGESIZE check before
calling xfs_sb_validate_fsb_count() we can assert
if we try to mount with a blocksize > pagesize.
The assert is valid so leave it and just move the
blocksize/pagesize check earlier.

--- fs/xfs/xfs_mount.c_1.436    2008-06-26 12:44:06.000000000 +1000
+++ fs/xfs/xfs_mount.c  2008-06-26 12:48:15.000000000 +1000
@@ -258,6 +258,19 @@ xfs_mount_validate_sb(
                return XFS_ERROR(EFSCORRUPTED);
        }

+       /*
+        * Until this is fixed only page-sized or smaller data blocks work.
+        */
+       if (unlikely(sbp->sb_blocksize > PAGE_SIZE)) {
+               xfs_fs_mount_cmn_err(flags,
+                       "file system with blocksize %d bytes",
+                       sbp->sb_blocksize);
+               xfs_fs_mount_cmn_err(flags,
+                       "only pagesize (%ld) or less will currently work.",
+                       PAGE_SIZE);
+               return XFS_ERROR(ENOSYS);
+       }
+
        if (xfs_sb_validate_fsb_count(sbp, sbp->sb_dblocks) ||
            xfs_sb_validate_fsb_count(sbp, sbp->sb_rblocks)) {
                xfs_fs_mount_cmn_err(flags,
@@ -279,19 +292,6 @@ xfs_mount_validate_sb(
                return XFS_ERROR(ENOSYS);
        }

-       /*
-        * Until this is fixed only page-sized or smaller data blocks work.
-        */
-       if (unlikely(sbp->sb_blocksize > PAGE_SIZE)) {
-               xfs_fs_mount_cmn_err(flags,
-                       "file system with blocksize %d bytes",
-                       sbp->sb_blocksize);
-               xfs_fs_mount_cmn_err(flags,
-                       "only pagesize (%ld) or less will currently work.",
-                       PAGE_SIZE);
-               return XFS_ERROR(ENOSYS);
-       }
-
        return 0;
}


<Prev in Thread] Current Thread [Next in Thread>