[rtems commit] dosfs: Avoid error caused by bdbuf configuration

Sebastian Huber sebh at rtems.org
Fri Dec 14 09:14:24 UTC 2012


Module:    rtems
Branch:    master
Commit:    4fdc3ee0aa9d319aa19a83f986d57995b8b44991
Changeset: http://git.rtems.org/rtems/commit/?id=4fdc3ee0aa9d319aa19a83f986d57995b8b44991

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Dec 13 18:21:08 2012 +0100

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.

---

 cpukit/libfs/src/dosfs/fat.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/cpukit/libfs/src/dosfs/fat.c b/cpukit/libfs/src/dosfs/fat.c
index c82bf5a..a672f42 100644
--- a/cpukit/libfs/src/dosfs/fat.c
+++ b/cpukit/libfs/src/dosfs/fat.c
@@ -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;
         }
     }
 




More information about the vc mailing list