Re: Crash with 512 byte blocks on 4K media

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 2, 2014 at 8:27 AM, OGAWA Hirofumi
<hirofumi@xxxxxxxxxxxxxxxxxx> wrote:
> One Thousand Gnomes <gnomes@xxxxxxxxxxxxxxxxxxx> writes:
>
>> A FAT mount of 512 byte block fs on 4K media now crashes. It used to just
>> error. This is of course doubly fun if you've got your own USB key
>> firmware and an automounting distribution 8-)
>
> This seems to be the bug of recent patch to fatfs. Does the following
> patch fix this?
>
> Thanks.
>
>
> Subject: [PATCH] fat: Fix missed error code by "add support for DOS 1.x formatted volumes"
>
> In "add support for DOS 1.x formatted volumes" patch, "error" is
> overwritten by fat_read_bpb().
>
> This patch reset "error" to -EIO, to return proper error.
>
> Cc: Conrad Meyer <cse.cem@xxxxxxxxx>
> Signed-off-by: OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
> ---
>
>  fs/fat/inode.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff -puN fs/fat/inode.c~fat-fix-error-handling fs/fat/inode.c
> --- linux-next/fs/fat/inode.c~fat-fix-error-handling    2014-06-03 00:20:03.773448083 +0900
> +++ linux-next-hirofumi/fs/fat/inode.c  2014-06-03 00:20:08.717435605 +0900
> @@ -1622,6 +1622,7 @@ int fat_fill_super(struct super_block *s
>         logical_sector_size = bpb.fat_sector_size;
>         sbi->sec_per_clus = bpb.fat_sec_per_clus;
>
> +       error = -EIO;
>         if (logical_sector_size < sb->s_blocksize) {
>                 fat_msg(sb, KERN_ERR, "logical sector size too small for device"
>                        " (logical sector size = %u)", logical_sector_size);
> _
> --
> OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>

Signed-off-by: Conrad Meyer <cse.cem@xxxxxxxxx>

Patch LGTM. Apologies for missing this on the first go-around.

Thanks,
Conrad
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux