Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce40733ce93de402ed629762f0e912d9af187cef
Commit:     ce40733ce93de402ed629762f0e912d9af187cef
Parent:     cb45bbe44b09f35bb12d67ffa7ecff862608aeae
Author:     Aneesh Kumar K.V <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 28 23:58:27 2008 -0500
Committer:  Theodore Ts'o <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 23:58:27 2008 -0500

    ext4: Check for return value from sb_set_blocksize
    
    sb_set_blocksize validates whether the specfied block size can be used by
    the file system. Make sure we fail mounting the file system if the
    blocksize specfied cannot be used.
    
    Signed-off-by: Aneesh Kumar K.V <[EMAIL PROTECTED]>
    Signed-off-by: Mingming Cao <[EMAIL PROTECTED]>
---
 fs/ext4/super.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 00560cf..055a0cd 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1812,7 +1812,6 @@ static int ext4_fill_super (struct super_block *sb, void 
*data, int silent)
        unsigned long def_mount_opts;
        struct inode *root;
        int blocksize;
-       int hblock;
        int db_count;
        int i;
        int needs_recovery;
@@ -1969,20 +1968,16 @@ static int ext4_fill_super (struct super_block *sb, 
void *data, int silent)
                goto failed_mount;
        }
 
-       hblock = bdev_hardsect_size(sb->s_bdev);
        if (sb->s_blocksize != blocksize) {
-               /*
-                * Make sure the blocksize for the filesystem is larger
-                * than the hardware sectorsize for the machine.
-                */
-               if (blocksize < hblock) {
-                       printk(KERN_ERR "EXT4-fs: blocksize %d too small for "
-                              "device blocksize %d.\n", blocksize, hblock);
+
+               /* Validate the filesystem blocksize */
+               if (!sb_set_blocksize(sb, blocksize)) {
+                       printk(KERN_ERR "EXT4-fs: bad block size %d.\n",
+                                       blocksize);
                        goto failed_mount;
                }
 
                brelse (bh);
-               sb_set_blocksize(sb, blocksize);
                logical_sb_block = sb_block * EXT4_MIN_BLOCK_SIZE;
                offset = do_div(logical_sb_block, blocksize);
                bh = sb_bread(sb, logical_sb_block);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to