dosfs: Avoid error caused by bdbuf configuration

The success of a block size change depends on the bdbuf configuration.
Do not treat a failed block size change as a hard error.  This is only a
missed performance optimization.
This commit is contained in:
Sebastian Huber
2012-12-14 10:18:31 +01:00
parent d0b9295fd9
commit 4fdc3ee0aa
+5 -10
View File
@@ -773,17 +773,12 @@ fat_init_volume_info(fat_fs_info_t *fs_info, const char *device)
if (is_cluster_aligned(vol, vol->data_fsec)
&& (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc)))
{
vol->bytes_per_block = vol->bpc;
vol->bytes_per_block_log2 = vol->bpc_log2;
vol->sectors_per_block = vol->spc;
sc = rtems_bdbuf_set_block_size (vol->dd, vol->bytes_per_block, true);
if (RTEMS_SUCCESSFUL != sc)
sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true);
if (sc == RTEMS_SUCCESSFUL)
{
close(vol->fd);
free(fs_info->vhash);
free(fs_info->rhash);
free(fs_info->uino);
rtems_set_errno_and_return_minus_one( EIO );
vol->bytes_per_block = vol->bpc;
vol->bytes_per_block_log2 = vol->bpc_log2;
vol->sectors_per_block = vol->spc;
}
}