1 Index: rtems-051009/cpukit/libcsupport/src/mount.c
2 ===================================================================
3 --- rtems-051009.orig/cpukit/libcsupport/src/mount.c
4 +++ rtems-051009/cpukit/libcsupport/src/mount.c
5 @@ -85,9 +85,9 @@ int mount(
7 * Is there a file system operations table?
10 if ( fs_ops == NULL ) {
12 + printk("mount: fs_ops cannot be zero\n",mount_point);
16 @@ -98,12 +98,14 @@ int mount(
17 if ( options != RTEMS_FILESYSTEM_READ_ONLY &&
18 options != RTEMS_FILESYSTEM_READ_WRITE ) {
20 + printk("mount: bad options\n");
24 /* Do they support being mounted at all ? */
25 if ( !fs_ops->fsmount_me_h ) {
27 + printk("mount: mounting not supported for this fs\n");
28 goto cleanup_and_bail;
31 @@ -118,6 +120,7 @@ int mount(
32 temp_mt_entry = malloc( size );
34 if ( !temp_mt_entry ) {
35 + printk("mount: cannot allocate memory for temp_mt_entry\n");
39 @@ -139,8 +142,10 @@ int mount(
42 if ( rtems_filesystem_evaluate_path(
43 - mount_point, RTEMS_LIBIO_PERMS_RWX, &loc, TRUE ) == -1 )
44 + mount_point, RTEMS_LIBIO_PERMS_RWX, &loc, TRUE ) == -1 ){
45 + printk("mount: evaluate mount point path \"%s\" failed\n",mount_point);
46 goto cleanup_and_bail;
51 @@ -150,6 +155,7 @@ int mount(
53 if (!loc.ops->node_type_h) {
55 + printk("mount: mount point \"%s\" has no node_type_h\n",mount_point);
56 goto cleanup_and_bail;
59 @@ -159,6 +165,7 @@ int mount(
61 if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {
63 + printk("mount: mount point \"%s\" is not a directory\n",mount_point);
64 goto cleanup_and_bail;
67 @@ -168,6 +175,7 @@ int mount(
69 if ( Is_node_fs_root( &loc ) ){
71 + printk("mount: mount point \"%s\" Is_node_fs_root\n",mount_point);
72 goto cleanup_and_bail;
75 @@ -191,10 +199,12 @@ int mount(
77 if ( !loc.ops->mount_h ){
79 + printk("mount: mount point \"%s\" does not support mount_h\n",mount_point);
80 goto cleanup_and_bail;
83 if ( loc.ops->mount_h( temp_mt_entry ) ) {
84 + printk("mount: mount_h at mount point \"%s\" failed\n",mount_point);
85 goto cleanup_and_bail;
88 @@ -220,6 +230,7 @@ int mount(
89 if ( loc.ops->unmount_h ) {
90 loc.ops->unmount_h( temp_mt_entry );
92 + printk("mount: unmounting because problem arose\n",mount_point);
93 goto cleanup_and_bail;
96 @@ -240,6 +251,7 @@ cleanup_and_bail:
98 rtems_filesystem_freenode( loc_to_free );
100 + printk("mount: bailing out\n");
104 Index: rtems-051009/cpukit/libmisc/fsmount/fsmount.c
105 ===================================================================
106 --- rtems-051009.orig/cpukit/libmisc/fsmount/fsmount.c
107 +++ rtems-051009/cpukit/libmisc/fsmount/fsmount.c
108 @@ -160,13 +160,15 @@ int rtems_fsmount
109 fstab_ptr->mount_options,
111 fstab_ptr->mount_point);
113 if (tmp_rc != RTEMS_SUCCESSFUL) {
114 if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNT_FAILED)) {
115 fprintf(stdout,"fsmount: mounting of \"%s\" to"
116 - " \"%s\" failed: %s\n",
117 + " \"%s\" failed: %s , tmp_rc=%d\n",
119 fstab_ptr->mount_point,
124 if (0 != (fstab_ptr->abort_reasons & FSMOUNT_MNT_FAILED)) {
126 Index: rtems-051009/cpukit/libfs/src/dosfs/msdos_initsupp.c
127 ===================================================================
128 --- rtems-051009.orig/cpukit/libfs/src/dosfs/msdos_initsupp.c
129 +++ rtems-051009/cpukit/libfs/src/dosfs/msdos_initsupp.c
130 @@ -69,6 +69,7 @@ msdos_initialize_support(
134 + printk("msdos_initialize_support: fat_init_volume_info failed\n");
138 @@ -84,6 +85,7 @@ msdos_initialize_support(
140 fat_shutdown_drive(temp_mt_entry);
142 + printk("msdos_initialize_support: fat_file_open\n");
146 @@ -104,6 +106,7 @@ msdos_initialize_support(
147 cl_buf_size = (fs_info->fat.vol.bpc > fs_info->fat.vol.rdir_size) ?
148 fs_info->fat.vol.bpc :
149 fs_info->fat.vol.rdir_size;
150 + printk("msdos_initialize_support: FAT12/16\n");
154 @@ -113,9 +116,11 @@ msdos_initialize_support(
155 fat_file_close(temp_mt_entry, fat_fd);
156 fat_shutdown_drive(temp_mt_entry);
158 + printk("msdos_initialize_support: fat_file_size\n");
161 cl_buf_size = fs_info->fat.vol.bpc;
162 + printk("msdos_initialize_support: FAT32\n");
165 fs_info->cl_buf = (uint8_t *)calloc(cl_buf_size, sizeof(char));
166 @@ -124,6 +129,7 @@ msdos_initialize_support(
167 fat_file_close(temp_mt_entry, fat_fd);
168 fat_shutdown_drive(temp_mt_entry);
170 + printk("msdos_initialize_support: alloc fs_info->cl_buf\n");
171 set_errno_and_return_minus_one(ENOMEM);
174 @@ -138,6 +144,7 @@ msdos_initialize_support(
175 fat_shutdown_drive(temp_mt_entry);
176 free(fs_info->cl_buf);
178 + printk("msdos_initialize_support: semaphore\n");
179 set_errno_and_return_minus_one( EIO );
182 Index: rtems-051009/cpukit/libfs/src/dosfs/fat.c
183 ===================================================================
184 --- rtems-051009.orig/cpukit/libfs/src/dosfs/fat.c
185 +++ rtems-051009/cpukit/libfs/src/dosfs/fat.c
186 @@ -217,17 +217,23 @@ fat_init_volume_info(rtems_filesystem_mo
189 rc = stat(mt_entry->dev, &stat_buf);
192 + printk("fat_init_volume_info: stat\n");
196 /* rtmes feature: no block devices, all are character devices */
197 - if (!S_ISCHR(stat_buf.st_mode))
198 + if (!S_ISCHR(stat_buf.st_mode)){
199 + printk("fat_init_volume_info: S_ISCHR\n");
200 set_errno_and_return_minus_one(ENOTBLK);
203 /* check that device is registred as block device and lock it */
204 vol->dd = rtems_disk_lookup(stat_buf.st_dev);
205 - if (vol->dd == NULL)
206 + if (vol->dd == NULL){
207 + printk("fat_init_volume_info: vol->dd == NULL\n");
208 set_errno_and_return_minus_one(ENOTBLK);
211 vol->dev = stat_buf.st_dev;
213 @@ -235,6 +241,7 @@ fat_init_volume_info(rtems_filesystem_mo
216 rtems_disk_release(vol->dd);
217 + printk("fat_init_volume_info: open\n");
221 @@ -243,6 +250,7 @@ fat_init_volume_info(rtems_filesystem_mo
224 rtems_disk_release(vol->dd);
225 + printk("fat_init_volume_info: read BPB\n");
226 set_errno_and_return_minus_one( EIO );
229 @@ -255,6 +263,7 @@ fat_init_volume_info(rtems_filesystem_mo
232 rtems_disk_release(vol->dd);
233 + printk("fat_init_volume_info: vol->bps %d\n",vol->bps);
234 set_errno_and_return_minus_one( EINVAL );
237 @@ -271,6 +280,7 @@ fat_init_volume_info(rtems_filesystem_mo
240 rtems_disk_release(vol->dd);
241 + printk("fat_init_volume_info: vol->spc == 0\n");
242 set_errno_and_return_minus_one(EINVAL);
245 @@ -283,6 +293,7 @@ fat_init_volume_info(rtems_filesystem_mo
246 if ((vol->bpc = vol->bps << vol->spc_log2) > MS_BYTES_PER_CLUSTER_LIMIT)
248 rtems_disk_release(vol->dd);
249 + printk("fat_init_volume_info: bytes per cluster value greater than 32K is invalid\n");
250 set_errno_and_return_minus_one(EINVAL);
253 @@ -357,6 +368,7 @@ fat_init_volume_info(rtems_filesystem_mo
254 if( vol->info_sec == 0 )
256 rtems_disk_release(vol->dd);
257 + printk("fat_init_volume_info: FAT_GET_BR_FAT32_FS_INFO_SECTOR\n");
258 set_errno_and_return_minus_one( EINVAL );
261 @@ -366,6 +378,7 @@ fat_init_volume_info(rtems_filesystem_mo
264 rtems_disk_release(vol->dd);
265 + printk("fat_init_volume_info: _fat_block_read 0\n");
269 @@ -373,6 +386,7 @@ fat_init_volume_info(rtems_filesystem_mo
270 FAT_FSINFO_LEAD_SIGNATURE_VALUE)
272 rtems_disk_release(vol->dd);
273 + printk("fat_init_volume_info: FAT_GET_FSINFO_LEAD_SIGNATURE\n");
274 set_errno_and_return_minus_one( EINVAL );
277 @@ -382,6 +396,7 @@ fat_init_volume_info(rtems_filesystem_mo
280 rtems_disk_release(vol->dd);
281 + printk("fat_init_volume_info: _fat_block_read FAT_FSI_INFO\n");
285 @@ -392,6 +407,7 @@ fat_init_volume_info(rtems_filesystem_mo
288 rtems_disk_release(vol->dd);
289 + printk("fat_init_volume_info: fat_fat32_update_fsinfo_sector\n");
293 @@ -412,6 +428,7 @@ fat_init_volume_info(rtems_filesystem_mo
294 if ( fs_info->vhash == NULL )
296 rtems_disk_release(vol->dd);
297 + printk("fat_init_volume_info: fs_info->vhash == NULL\n");
298 set_errno_and_return_minus_one( ENOMEM );
301 @@ -423,6 +440,7 @@ fat_init_volume_info(rtems_filesystem_mo
303 rtems_disk_release(vol->dd);
304 free(fs_info->vhash);
305 + printk("fat_init_volume_info: fs_info->rhash == NULL\n");
306 set_errno_and_return_minus_one( ENOMEM );
308 for (i = 0; i < FAT_HASH_SIZE; i++)
309 @@ -437,6 +455,7 @@ fat_init_volume_info(rtems_filesystem_mo
310 rtems_disk_release(vol->dd);
311 free(fs_info->vhash);
312 free(fs_info->rhash);
313 + printk("fat_init_volume_info: fs_info->uino == NULL\n");
314 set_errno_and_return_minus_one( ENOMEM );
316 fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t));
317 @@ -446,6 +465,7 @@ fat_init_volume_info(rtems_filesystem_mo
318 free(fs_info->vhash);
319 free(fs_info->rhash);
321 + printk("fat_init_volume_info: fs_info->sec_buf\n");
322 set_errno_and_return_minus_one( ENOMEM );