befs: check return of sb_min_blocksize
authorLuis de Bethencourt <luisbg@osg.samsung.com>
Sat, 23 Jul 2016 12:36:42 +0000 (22:36 +1000)
committerLuis de Bethencourt <luisbg@osg.samsung.com>
Tue, 9 Aug 2016 14:18:06 +0000 (15:18 +0100)
Confirm sb_min_blocksize() succeeded before continuing.

Link: http://lkml.kernel.org/r/1465700235-22881-1-git-send-email-luisbg@osg.samsung.com
Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/befs/linuxvfs.c

index c734f21fd5812fdb0df2b139783fe046d7362e5f..453bb68da219d779cbdb5dda7d64012a79eb9315 100644 (file)
@@ -756,6 +756,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
        long ret = -EINVAL;
        const unsigned long sb_block = 0;
        const off_t x86_sb_off = 512;
+       int blocksize;
 
        save_mount_options(sb, data);
 
@@ -788,7 +789,11 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
         * least 1k to get the second 512 bytes of the volume.
         * -WD 10-26-01
         */ 
-       sb_min_blocksize(sb, 1024);
+       blocksize = sb_min_blocksize(sb, 1024);
+       if (!blocksize) {
+               befs_error(sb, "unable to set blocksize");
+               goto unacquire_priv_sbp;
+       }
 
        if (!(bh = sb_bread(sb, sb_block))) {
                if (!silent)
This page took 0.025204 seconds and 5 git commands to generate.