summaryrefslogtreecommitdiff
path: root/legacy/eeze
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-08-01 12:43:55 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-08-01 12:43:55 +0000
commit52c05aaa013dc29d03490c03778657c48d4e3b42 (patch)
tree096ab55f0f52a43b338e4dbfad4b0d276c7d7146 /legacy/eeze
parenta0970878ccbd2df8299e04d8462d32f87c667788 (diff)
eeze mount operations will now only retry up to 3 times when they fail before emitting an error event
SVN revision: 74736
Diffstat (limited to 'legacy/eeze')
-rw-r--r--legacy/eeze/ChangeLog4
-rw-r--r--legacy/eeze/src/lib/eeze_disk_mount.c34
-rw-r--r--legacy/eeze/src/lib/eeze_disk_private.h1
3 files changed, 30 insertions, 9 deletions
diff --git a/legacy/eeze/ChangeLog b/legacy/eeze/ChangeLog
index d6189bfea4..6fde511eca 100644
--- a/legacy/eeze/ChangeLog
+++ b/legacy/eeze/ChangeLog
@@ -114,3 +114,7 @@
1142012-07-30 Mike Blumenkrantz 1142012-07-30 Mike Blumenkrantz
115 115
116 * Add EEZE_DISK_MOUNTOPT_NODEV option for disabling device nodes on mount 116 * Add EEZE_DISK_MOUNTOPT_NODEV option for disabling device nodes on mount
117
1182012-07-31 Mike Blumenkrantz
119
120 * Prevent mount operations from retrying infinitely on failure
diff --git a/legacy/eeze/src/lib/eeze_disk_mount.c b/legacy/eeze/src/lib/eeze_disk_mount.c
index 41bd8c6b35..7517e108fd 100644
--- a/legacy/eeze/src/lib/eeze_disk_mount.c
+++ b/legacy/eeze/src/lib/eeze_disk_mount.c
@@ -159,9 +159,17 @@ _eeze_disk_mount_result_handler(void *data __UNUSED__, int type __UNUSED__, Ecor
159 break; 159 break;
160 160
161 default: 161 default:
162 INF("Could not unmount disk, retrying"); 162 if (disk->mount_fail_count++ < 3)
163 disk->mounter = ecore_exe_run(eina_strbuf_string_get(disk->unmount_cmd), disk); 163 {
164 eeze_events = eina_list_append(eeze_events, disk); 164 INF("Could not unmount disk, retrying");
165 disk->mounter = ecore_exe_run(eina_strbuf_string_get(disk->unmount_cmd), disk);
166 eeze_events = eina_list_append(eeze_events, disk);
167 }
168 else
169 {
170 disk->mount_fail_count = 0;
171 _eeze_disk_mount_error_handler(disk, "Maximimum number of mount-related failures reached");
172 }
165 return ECORE_CALLBACK_RENEW; 173 return ECORE_CALLBACK_RENEW;
166 } 174 }
167 else 175 else
@@ -184,12 +192,20 @@ _eeze_disk_mount_result_handler(void *data __UNUSED__, int type __UNUSED__, Ecor
184 break; 192 break;
185 193
186 default: 194 default:
187 INF("Could not eject disk, retrying"); 195 if (disk->mount_fail_count++ < 3)
188 if (disk->mount_status & EEZE_DISK_UNMOUNTING) 196 {
189 disk->mounter = ecore_exe_run(eina_strbuf_string_get(disk->unmount_cmd), disk); 197 INF("Could not eject disk, retrying");
190 else 198 if (disk->mount_status & EEZE_DISK_UNMOUNTING)
191 disk->mounter = ecore_exe_run(eina_strbuf_string_get(disk->eject_cmd), disk); 199 disk->mounter = ecore_exe_run(eina_strbuf_string_get(disk->unmount_cmd), disk);
192 eeze_events = eina_list_append(eeze_events, disk); 200 else
201 disk->mounter = ecore_exe_run(eina_strbuf_string_get(disk->eject_cmd), disk);
202 eeze_events = eina_list_append(eeze_events, disk);
203 }
204 else
205 {
206 disk->mount_fail_count = 0;
207 _eeze_disk_mount_error_handler(disk, "Maximimum number of mount-related failures reached");
208 }
193 return ECORE_CALLBACK_RENEW; 209 return ECORE_CALLBACK_RENEW;
194 } 210 }
195 return ECORE_CALLBACK_RENEW; 211 return ECORE_CALLBACK_RENEW;
diff --git a/legacy/eeze/src/lib/eeze_disk_private.h b/legacy/eeze/src/lib/eeze_disk_private.h
index 080035fefa..85fcd690cd 100644
--- a/legacy/eeze/src/lib/eeze_disk_private.h
+++ b/legacy/eeze/src/lib/eeze_disk_private.h
@@ -52,6 +52,7 @@ struct _Eeze_Disk
52 Eina_Bool mounted : 1; 52 Eina_Bool mounted : 1;
53 Ecore_Exe *mounter; 53 Ecore_Exe *mounter;
54 Ecore_Timer *mount_fail_delay; 54 Ecore_Timer *mount_fail_delay;
55 unsigned int mount_fail_count;
55 int fail_pol_check; 56 int fail_pol_check;
56 57
57 const char *syspath; 58 const char *syspath;